The Apache Haus Forum

Advanced search  

News:

Welcome to Apache Haus Distribution Forum

Pages: [1] 2   Go Down

Author Topic: Errors while compiling Apache 2.4.1 openssl 1.0.1 on Linux  (Read 60811 times)

shishir

  • Newbie
  • *
  • Offline Offline
  • Posts: 6
Errors while compiling Apache 2.4.1 openssl 1.0.1 on Linux
« 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
Logged

mario

  • Administrator
  • Member Elite
  • *****
  • Offline Offline
  • Posts: 621
Re: Errors while compiling Apache 2.4.1 openssl 1.0.1 on Linux
« Reply #1 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
Logged

shishir

  • Newbie
  • *
  • Offline Offline
  • Posts: 6
Re: Errors while compiling Apache 2.4.1 openssl 1.0.1 on Linux
« Reply #2 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?
Logged

mario

  • Administrator
  • Member Elite
  • *****
  • Offline Offline
  • Posts: 621
Re: Errors while compiling Apache 2.4.1 openssl 1.0.1 on Linux
« Reply #3 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
Logged

shishir

  • Newbie
  • *
  • Offline Offline
  • Posts: 6
Re: Errors while compiling Apache 2.4.1 openssl 1.0.1 on Linux
« Reply #4 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
Logged

mario

  • Administrator
  • Member Elite
  • *****
  • Offline Offline
  • Posts: 621
Re: Errors while compiling Apache 2.4.1 openssl 1.0.1 on Linux
« Reply #5 on: April 24, 2012, 03:19:55 PM »

Did you run make clean before trying?

by the way, which Linux are you using?
Logged

shishir

  • Newbie
  • *
  • Offline Offline
  • Posts: 6
Re: Errors while compiling Apache 2.4.1 openssl 1.0.1 on Linux
« Reply #6 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?
Logged

shishir

  • Newbie
  • *
  • Offline Offline
  • Posts: 6
Re: Errors while compiling Apache 2.4.1 openssl 1.0.1 on Linux
« Reply #7 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
Logged

paulnorwich

  • Newbie
  • *
  • Offline Offline
  • Posts: 2
Re: Errors while compiling Apache 2.4.1 openssl 1.0.1 on Linux
« Reply #8 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
Logged

paulnorwich

  • Newbie
  • *
  • Offline Offline
  • Posts: 2
Re: Errors while compiling Apache 2.4.1 openssl 1.0.1 on Linux
« Reply #9 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.
Logged

eriddles

  • Newbie
  • *
  • Offline Offline
  • Posts: 1
Re: Errors while compiling Apache 2.4.1 openssl 1.0.1 on Linux
« Reply #10 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 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.
« Last Edit: January 29, 2020, 01:36:18 PM by eriddles »
Logged

mario

  • Administrator
  • Member Elite
  • *****
  • Offline Offline
  • Posts: 621
Re: Errors while compiling Apache 2.4.1 openssl 1.0.1 on Linux
« Reply #11 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
Logged

tomahawk

  • Newbie
  • *
  • Offline Offline
  • Posts: 1
Re: Errors while compiling Apache 2.4.1 openssl 1.0.1 on Linux
« Reply #12 on: June 21, 2016, 04:13:27 AM »

Yes the issue can be solved by reading about the 4 Minutes Fighter Abs 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
« Last Edit: August 17, 2016, 06:48:25 AM by tomahawk »
Logged

sarajames

  • Newbie
  • *
  • Offline Offline
  • Posts: 1
Re: Errors while compiling Apache 2.4.1 openssl 1.0.1 on Linux
« Reply #13 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
Logged

mario

  • Administrator
  • Member Elite
  • *****
  • Offline Offline
  • Posts: 621
Re: Errors while compiling Apache 2.4.1 openssl 1.0.1 on Linux
« Reply #14 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.
Logged
Pages: [1] 2   Go Up
 

Sitemap 1 2 3 4 5 6 7 8 9 10 11 12 13