The Apache Haus Forum

Forum Topics => Apache Programming and Building => Topic started by: shishir on April 24, 2012, 12:01:03 PM

Title: Errors while compiling Apache 2.4.1 openssl 1.0.1 on Linux
Post by: shishir on April 24, 2012, 12:01:03 PM
Hi,

I am trying to compile Apache 2.4.1 with openssl 1.0.1 on Linux 2.6.32-71.el6.x86_64.
Following is the last block of the 'make' command of apache.

make[4]: Entering directory `/root/shishir/httpd-2.4.1/modules/ssl'
/root/shishir/httpd-2.4.1/srclib/apr/libtool --silent --mode=link gcc -std=gnu99 -g -O2 -pthread -o mod_ssl.la -rpath /usr/pw/apache/modules -module -avoid-version mod_ssl.lo ssl_engine_config.lo ssl_engine_dh.lo ssl_eng
ine_init.lo ssl_engine_io.lo ssl_engine_kernel.lo ssl_engine_log.lo ssl_engine_mutex.lo ssl_engine_pphrase.lo ssl_engine_rand.lo ssl_engine_vars.lo ssl_scache.lo ssl_util_stapling.lo ssl_util.lo ssl_util_ssl.lo ssl_engine_ocsp.lo
ssl_util_ocsp.lo -L/usr/pw/apache/openssl/lib -lssl -lcrypto -lrt -lcrypt -lpthread -export-symbols-regex ssl_module
/usr/bin/ld: /usr/pw/apache/openssl/lib/libssl.a(s3_srvr.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/pw/apache/openssl/lib/libssl.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[4]: *** [mod_ssl.la] Error 1
make[4]: Leaving directory `/root/shishir/httpd-2.4.1/modules/ssl'



Please note, make test for openssl came successful.

Please suggest what can be wrong while reading libssl.a?

Thanks,
Shishir
Title: Re: Errors while compiling Apache 2.4.1 openssl 1.0.1 on Linux
Post by: mario on April 24, 2012, 12:05:19 PM
For me it worked only when I installed OpenSSL in the system and used that.

See in your error message? /usr/pw/apache/openssl/lib/libssl.a that is not /root/shishir/httpd-2.4.1/srclib/openssl

Code: [Select]
wget http://openssl.org/source/openssl-1.0.1.tar.gz
 tar xfz openssl-1.0.1.tar.gz
 cd openssl-*
 ./config --prefix=/usr zlib-dynamic --openssldir=/etc/ssl shared
 make
 sudo make install

Code: [Select]
./buildconf
./configure --prefix=/opt/apache2 --enable-pie --enable-mods-shared=all --enable-so --disable-include --enable-deflate --enable-headers --enable-expires --enable-ssl=shared --enable-mpms-shared=all --with-mpm=event --enable-rewrite --with-z=/home/mario/apache24/httpd-2.4.2/srclib/zlib --enable-module=ssl --enable-fcgid --with-included-apr
Title: Re: Errors while compiling Apache 2.4.1 openssl 1.0.1 on Linux
Post by: shishir on April 24, 2012, 12:25:21 PM
i have used the following..
for openssl
./config no-threads --prefix=/usr/pw/apache/openssl
make
make install

for httpd2.4.1
./configure --prefix=/usr/pw/apache --with-ssl=/usr/pw/apache/openssl --enable-ssl=shared --enable-mods-shated=most
--with-expat=builtin --with-included-apr --with-pcre=/root/shishir/pcre-8.30/pcre-config

is this wrong? or require some correction?
is zlib required here?
Title: Re: Errors while compiling Apache 2.4.1 openssl 1.0.1 on Linux
Post by: mario on April 24, 2012, 01:02:53 PM
zlib is for mod deflate needed.

For openssl you may try
Code: [Select]
./config no-threads shared --prefix=/usr/pw/apache/openssl
cause your error message says: recompile with -fPIC that is the shared option for gcc
Title: Re: Errors while compiling Apache 2.4.1 openssl 1.0.1 on Linux
Post by: shishir on April 24, 2012, 02:31:51 PM
Thanks for the inputs, tried as suggest
./config no-threads shared --prefix=/usr/pw/apache/openssl

and got a new error

/usr/bin/ld: libcrypto.a(e_4758cca.o): relocation R_X86_64_32 against `.data' can not be used when making a shared object; recompile with -fPIC
libcrypto.a(e_4758cca.o): could not read symbols: Bad value
Title: Re: Errors while compiling Apache 2.4.1 openssl 1.0.1 on Linux
Post by: mario on April 24, 2012, 03:19:55 PM
Did you run make clean before trying?

by the way, which Linux are you using?
Title: Re: Errors while compiling Apache 2.4.1 openssl 1.0.1 on Linux
Post by: shishir on May 08, 2012, 03:54:08 PM
yea it worked for that phase..thanks for the tip.

but this time i can see mod_ssl.so in my \apache\modules list but when i try to start the apache it is throwing the below error.

httpd: Syntax error on line 155 of /usr/pw/apache/conf/httpd.conf: Cannot load /usr/pw/apache/modules/mod_ssl.so into server: /usr/pw/apache/modules/mod_ssl.so: undefined symbol: SSL_SESSION_get_compress_id

Any suggestions on this?
Title: Re: Errors while compiling Apache 2.4.1 openssl 1.0.1 on Linux
Post by: shishir on May 23, 2012, 11:41:09 AM
Hi,

Any suggestions on


httpd: Syntax error on line 155 of /usr/pw/apache/conf/httpd.conf: Cannot load /usr/pw/apache/modules/mod_ssl.so into server: /usr/pw/apache/modules/mod_ssl.so: undefined symbol: SSL_SESSION_get_compress_id

Thanks,
Shishir
Title: Re: Errors while compiling Apache 2.4.1 openssl 1.0.1 on Linux
Post by: paulnorwich on June 29, 2012, 02:08:03 PM
I'm seeing this same error on RHEL6.2, with openssl 1.0.1c and Apache 2.4.1:

httpd: Syntax error on line 33 of /usr/local/apache/conf/httpd.conf: Cannot load /usr/local/apache/modules/mod_ssl.so into server: /usr/local/apache/modules/mod_ssl.so: undefined symbol: SSL_SESSION_get_compress_id

Does anyone have any idea what I can do to solve this?

Thanks,
Paul
Title: Re: Errors while compiling Apache 2.4.1 openssl 1.0.1 on Linux
Post by: paulnorwich on June 29, 2012, 03:52:45 PM
I discovered my problem was that at runtime this was linking to my OS's openssl libraries rather than the openssl I'd built in /usr/local/openssl

export LD_LIBRARY_PATH=/usr/local/openssl/lib

then running apache fixed it.
Title: Re: Errors while compiling Apache 2.4.1 openssl 1.0.1 on Linux
Post by: eriddles on March 26, 2016, 01:46:10 PM
Hi,

Any suggestions on


httpd: Syntax error on line 155 of /usr/pw/apache/conf/httpd.conf: Cannot load /usr/pw/apache/modules/mod_ssl.so into the 3 week diet (https://skinnyexpress.com/the-3-week-diet-review) server: /usr/pw/apache/modules/mod_ssl.so: undefined symbol: SSL_SESSION_get_compress_id

Thanks,
Shishir

Hi Shishir, I'm getting this error too. I found your post after pasting the error into google. Do you know what this code means and how to get rid of it? Thanks.
Title: Re: Errors while compiling Apache 2.4.1 openssl 1.0.1 on Linux
Post by: mario on March 28, 2016, 09:43:50 PM
Yes the issue can be solved by export LD_LIBRARY_PATH=/usr/local/openssl/lib

You can see an example in https://github.com/JBlond/debian_build_apache24
Title: Re: Errors while compiling Apache 2.4.1 openssl 1.0.1 on Linux
Post by: tomahawk on June 21, 2016, 04:13:27 AM
Yes the issue can be solved by reading about the 4 Minutes Fighter Abs (http://fitnessbond.com/4-minute-fighter-abs-review/) export LD_LIBRARY_PATH=/usr/local/openssl/lib

You can see an example in https://github.com/JBlond/debian_build_apache24

Thank you very much Mario, github very useful. Thanks
Title: Re: Errors while compiling Apache 2.4.1 openssl 1.0.1 on Linux
Post by: lordoftheflies on July 09, 2016, 10:17:22 AM
Quote
Hi,

Any suggestions on


httpd: Syntax error on line 155 of /usr/pw/apache/conf/httpd.conf: Cannot load /usr/pw/apache/modules/mod_ssl.so into plexus review (http://fatburnerdepot.com/review/plexus-slim-review-does-it-work/) server: /usr/pw/apache/modules/mod_ssl.so: undefined symbol: SSL_SESSION_get_compress_id

Thanks,
Shishir

I found this post by searching google for my problem, i used the github recommendation to solve the problem but now my computer is freezing everytime i run anything, i'm starting to think this is beyond me  ???
Title: Re: Errors while compiling Apache 2.4.1 openssl 1.0.1 on Linux
Post by: sarajames on July 11, 2016, 01:53:38 AM
Thank you, yes! Finally figured out how to solve my compiling issue with Apache!

Much appreciated, Sara
Title: Re: Errors while compiling Apache 2.4.1 openssl 1.0.1 on Linux
Post by: mario on July 12, 2016, 10:36:08 AM
I found this post by searching google for my problem, i used the github recommendation to solve the problem but now my computer is freezing everytime i run anything, i'm starting to think this is beyond me  ???

how is your folder structure? How did you configure your apache build?

it seems that your apache is compiled against a different OpenSSL version than it was compiled against.
Title: Re: Errors while compiling Apache 2.4.1 openssl 1.0.1 on Linux
Post by: ClaireEllison on December 13, 2016, 09:21:12 PM
Hi,  Any suggestions on   httpd: Syntax error on line 155 of /usr/pw/apache/conf/httpd.conf: Cannot load /usr/pw/apache/modules/ server: /usr/pw/apache/modules/mod_ssl.so: undefined symbol: SSL_SESSION_get_compress_id  Thanks, Shishir
Title: Re: Errors while compiling Apache 2.4.1 openssl 1.0.1 on Linux
Post by: mario on December 14, 2016, 09:31:15 AM
Quote from: ClaireEllison
Hi,  Any suggestions on   httpd: Syntax error on line 155 of /usr/pw/apache/conf/httpd.conf: Cannot load /usr/pw/apache/modules/ server: /usr/pw/apache/modules/mod_ssl.so: undefined symbol: SSL_SESSION_get_compress_id  Thanks, Shishir

You compiled against a wroing OpenSSL Version. So solve this see what I posted before.

Yes the issue can be solved by export LD_LIBRARY_PATH=/usr/local/openssl/lib

You can see an example in https://github.com/JBlond/debian_build_apache24
Title: Re: Errors while compiling Apache 2.4.1 openssl 1.0.1 on Linux
Post by: ClaireEllison on January 29, 2017, 10:10:31 PM
I found this post by searching google for my problem, i used the github recommendation to solve the problem but now my computer is freezing everytime i run anything, i'm starting to think this is beyond me  ???
Title: Re: Errors while compiling Apache 2.4.1 openssl 1.0.1 on Linux
Post by: mario on January 30, 2017, 05:03:51 PM
You mix different OpenSSL Versions. That is why oyu have to tell the compiler which path to use.

example
export LDFLAGS="-Wl,-rpath,/opt/openssl/lib"
Title: Re: Errors while compiling Apache 2.4.1 openssl 1.0.1 on Linux
Post by: DarrenG on September 24, 2017, 05:48:57 PM
Hi,

I am trying to compile Apache 2.4.1 with openssl 1.0.1 on Linux 2.6.32-71.el6.x86_64.
Following is the last block of the 'make' command of apache.

make[4]: Entering directory `/root/shishir/httpd-2.4.1/modules/ssl'
/root/shishir/httpd-2.4.1/srclib/apr/libtool --silent --mode=link gcc -std=gnu99 -g -O2 -pthread -o mod_ssl.la -rpath /usr/pw/apache/modules -module -avoid-version mod_ssl.lo ssl_engine_config.lo ssl_engine_dh.lo ssl_eng
ine_init.lo ssl_engine_io.lo ssl_engine_kernel.lo ssl_engine_log.lo ssl_engine_mutex.lo ssl_engine_pphrase.lo ssl_engine_rand.lo ssl_engine_vars.lo ssl_scache.lo ssl_util_stapling.lo ssl_util.lo ssl_util_ssl.lo ssl_engine_ocsp.lo
ssl_util_ocsp.lo -L/usr/pw/apache/openssl/lib -lssl -lcrypto -lrt -lcrypt -lpthread -export-symbols-regex ssl_module
/usr/bin/ld: /usr/pw/apache/openssl/lib/libssl.a(s3_srvr.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/pw/apache/openssl/lib/libssl.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[4]: *** [mod_ssl.la] Error 1
make[4]: Leaving directory `/root/shishir/httpd-2.4.1/modules/ssl'



Please note, make test for openssl came successful (http://phenq-fr.com).

Please suggest what can be wrong while reading libssl.a?

Thanks,
Shishir

Needs open SSL mate.
Title: Re: Errors while compiling Apache 2.4.1 openssl 1.0.1 on Linux
Post by: DarrenG on April 02, 2018, 03:18:52 PM
Do we have any update here? Did i (http://phenq-it.com)t go well? I think that Mario gave you the answer basically..