LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 10-05-2011, 10:26 AM   #1
angstwad
LQ Newbie
 
Registered: Oct 2011
Distribution: CentOS
Posts: 3

Rep: Reputation: Disabled
Can't get Apache 2.2.21 to compile with OpenSSL support


Alright -- having a bad couple days here compiling Apache 2.2.21 on CentOS 5.7 with the following configure commands:

Code:
  ./configure --enable-ssl=shared --with-ssl=/usr/local/openssl
I've compiled from source OpenSSL 1.0.0e from source:

Code:
 ./config --prefix=/usr/local --openssldir=/usr/local/openssl shared zlib-dynamic
I attempt to start Apache and it returns:

Code:
httpd: Syntax error on line 54 of /usr/local/apache2/conf/httpd.conf: Cannot load /usr/local/apache2/modules/mod_ssl.so into server: /usr/local/apache2/modules/mod_ssl.so: undefined symbol: SSL_get_servername
If I look at how the libraries are linked, this is what I get:

Code:
[root@web1 modules]# ldd mod_ssl.so 
libssl.so.6 => /lib64/libssl.so.6 (0x00002aaaaace4000)
libcrypto.so.6 => /lib64/libcrypto.so.6 (0x00002aaaaaf30000)
libdl.so.2 => /lib64/libdl.so.2 (0x00002aaaab281000)
libz.so.1 => /lib64/libz.so.1 (0x00002aaaab486000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00002aaaab69a000)
libc.so.6 => /lib64/libc.so.6 (0x00002aaaab8b5000)
libgssapi_krb5.so.2 => /usr/lib64/libgssapi_krb5.so.2 (0x00002aaaabc0e000)
libkrb5.so.3 => /usr/lib64/libkrb5.so.3 (0x00002aaaabe3c000)
libcom_err.so.2 => /lib64/libcom_err.so.2 (0x00002aaaac0d1000)
libk5crypto.so.3 => /usr/lib64/libk5crypto.so.3 (0x00002aaaac2d4000)
/lib64/ld-linux-x86-64.so.2 (0x0000555555554000)
libkrb5support.so.0 => /usr/lib64/libkrb5support.so.0 (0x00002aaaac4f9000)
libkeyutils.so.1 => /lib64/libkeyutils.so.1 (0x00002aaaac702000)
libresolv.so.2 => /lib64/libresolv.so.2 (0x00002aaaac904000)
libselinux.so.1 => /lib64/libselinux.so.1 (0x00002aaaacb19000)
libsepol.so.1 => /lib64/libsepol.so.1 (0x00002aaaacd32000)
Basically, I've tired compiling from source OpenSSL (both 0.9.8r and 1e), having yum reinstall from the repos, done a `make clean` and remade both OpenSSL and Apache numerous times -- but I can't get it to compile into the apache base or dynamically as a shared object file.

After doing a `make clean` and `make distclean`, I've reconfigured with the same parameters as above without any effect.

The config.log is at Pastebin.
 
Old 10-05-2011, 11:29 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,

Quote:
[root@web1 modules]# ldd mod_ssl.so
libssl.so.6 => /lib64/libssl.so.6 (0x00002aaaaace4000)
...
You're using your system's openssl package, not the one compiled by you. You can install also the openssl-dev package of your distro, so apache will compile nicely.
If you want to use your compiled openssl, the you should use LDFLAGS and CPPFLAGS in the ./configure command, like:
Code:
LDFLAGS=-L/usr/local/ssl/lib CPPFLAGS=-I/usr/local/ssl/include ./configure ...
This way, to run apache you need also to add the path to the ssl libs in LD_LIBRARY_PATH:
Code:
export LD_LIBRARY_PATH=/usr/local/ssl/lib:$LD_LIBRARY_PATH
/usr/local/apache2/bin/apachectl start
 
Old 10-05-2011, 12:30 PM   #3
angstwad
LQ Newbie
 
Registered: Oct 2011
Distribution: CentOS
Posts: 3

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by bathory View Post
If you want to use your compiled openssl, the you should use LDFLAGS and CPPFLAGS in the ./configure command, like:
Code:
LDFLAGS=-L/usr/local/ssl/lib CPPFLAGS=-I/usr/local/ssl/include ./configure ...
I recompiled with new flags after a
Code:
make clean && make distclean
without any change to the mod_ssl.so's deps. The lib path is:

Code:
[root@web1 modules]# echo $LD_LIBRARY_PATH
/usr/local/openssl/lib:

Last edited by angstwad; 10-05-2011 at 12:32 PM.
 
Old 10-05-2011, 01:13 PM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Doh, this is what I get after compiling apache as in my previous post
Code:
ldd /usr/local/apache/modules/mod_ssl.so
        linux-gate.so.1 =>  (0xb7885000)
        libssl.so.1.0.0 => /usr/local/ssl/lib/libssl.so.1.0.0 (0xb7810000)
        libcrypto.so.1.0.0 => /usr/local/ssl/lib/libcrypto.so.1.0.0 (0xb76b9000)
        libdl.so.2 => /lib/libdl.so.2 (0xb768b000)
        libpthread.so.0 => /lib/libpthread.so.0 (0xb7671000)
        libc.so.6 => /lib/libc.so.6 (0xb750f000)
        /lib/ld-linux.so.2 (0xb7886000)
 
Old 10-05-2011, 04:15 PM   #5
angstwad
LQ Newbie
 
Registered: Oct 2011
Distribution: CentOS
Posts: 3

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by bathory View Post
Doh, this is what I get after compiling apache as in my previous post
No matter what I'm doing I cannot get it to load the openssl libraries. I've check and rechecked ld.so.conf to make sure the OpenSSL path is there, reloaded and checked the output of 'ldconfig -v', compiled and recompiled both OpenSSL and Apache, installed from the CentOS repositories and reinstalled, without any luck whatsoever.

Anyone have any clue? This is driving me crazy.
 
Old 10-05-2011, 05:34 PM   #6
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
Originally Posted by angstwad View Post
I recompiled with new flags after a
Code:
make clean && make distclean
without any change to the mod_ssl.so's deps. The lib path is:

Code:
[root@web1 modules]# echo $LD_LIBRARY_PATH
/usr/local/openssl/lib:
I just noticed that you have installed openssl under /usr/local/openssl and not under the default /usr/local/ssl, so I guess you've changed the LDFLAGS and CPPFLAGS, LD_LIBRARY_PATH, ld.so.conf etc, accordingly.
You may also try to preload the ssl shared libraries, either using the full path to them in /etc/ld.so.preload, or using LD_PRELOAD, prior starting apache:
Code:
export LD_PRELOAD="/usr/local/openssl/lib/libssl.so /usr/local/openssl/lib/libcrypto.so"
/usr/local/apache2/bin/apachectl start
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to compile Apache 2.2 with LDAP support? laggerific Linux - Software 1 04-27-2009 03:15 PM
Compile Curl module with openssl spazmatic Linux - Newbie 0 04-06-2009 11:45 AM
How to compile OpenSSL under Solaris 8? johncsl82 Solaris / OpenSolaris 3 02-06-2009 05:55 AM
OpenSSL & Compile Errors digital14 Linux - Desktop 7 03-10-2008 04:50 AM
Apache Openssl compile fails rioguia Linux - Software 2 11-07-2003 08:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 04:54 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration