Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.
  • Arch Linux 2011.08.19 (Linux 3.4.2 i686)
  • Apache 2.2.22 → 2.2.22 (recompile & reinstall)
  • OpenSSL 1.0.1.c-1

These details are likely irrelevant, but: I’m using yaourt with customizepkg to build Apache from source every time there’s an upgrade available so I can change the suexec docroot to what I want without manually editing the PKGBUILD myself.

In the past this has worked flawlessly; however, it seems that now, for whatever reason, Apache won’t compile. I just did a full system upgrade so that may have something to do with it.

Here is the configure line from the modified PKGBUILD:

../configure --enable-layout=Arch \
    --enable-modules=all \
    --enable-mods-shared=all \
    --enable-so \
    --enable-suexec \
    --with-suexec-caller=http \
    --with-suexec-docroot=/srv/www \
    --with-suexec-logfile=/var/log/httpd/suexec.log \
    --with-suexec-bin=/usr/sbin/suexec \
    --with-suexec-uidmin=99 --with-suexec-gidmin=99 \
    --enable-ldap --enable-authnz-ldap \
    --enable-cache --enable-disk-cache --enable-mem-cache --enable-file-cache \
    --enable-ssl --with-ssl \
    --enable-deflate --enable-cgid \
    --enable-proxy --enable-proxy-connect \
    --enable-proxy-http --enable-proxy-ftp \
    --enable-dbd \
    --with-apr=/usr/bin/apr-1-config \
    --with-apr-util=/usr/bin/apu-1-config \
    --with-pcre=/usr \
    --with-mpm=${mpm}

When I try to build though, it seems to run fine until it gets to the OpenSSL stuff:

mkdir modules/ssl
checking whether to enable mod_ssl... checking dependencies
checking for SSL/TLS toolkit base... none
checking for OpenSSL version... checking openssl/opensslv.h usability... yes
checking openssl/opensslv.h presence... yes
checking for openssl/opensslv.h... yes
checking openssl/ssl.h usability... yes
checking openssl/ssl.h presence... yes
checking for openssl/ssl.h... yes
OK
  forcing SSL_LIBS to "-lssl -lcrypto  "
  adding "-lssl" to LIBS
  adding "-lcrypto" to LIBS
checking openssl/engine.h usability... yes
checking openssl/engine.h presence... yes
checking for openssl/engine.h... yes
checking for SSLeay_version... no
checking for SSL_CTX_new... no
checking for ENGINE_init... no
checking for ENGINE_load_builtin_engines... no
checking for SSL_set_cert_store... no
configure: error: ... Error, SSL/TLS libraries were missing or unusable
==> ERROR: A failure occurred in build().
    Aborting...
==> ERROR: Makepkg was unable to build apache.
==> Restart building apache ? [y/N]
==> -------------------------------
==> 

Googling around, many reported the solution being export LDFLAGS=-ldl, but this has had no effect for me, whether set in the build script or in my bash profile.

share|improve this question
    
You say you've just done a full upgrade. Did you get the OpenSSL dev package? I think you'll need that so that the Apache build can use the headers. –  D_Bye Jul 16 '12 at 11:15
    
I looked for it, but couldn’t find any such package in either the official repository or AUR. –  Hugh Guiney Jul 16 '12 at 15:47
    
OK, turns out the dev package on Arch is just called “openssl”, which I have. –  Hugh Guiney Jul 16 '12 at 15:58

3 Answers 3

Looks like httpd configuration is including the wrong version of OpenSSL.

checking for openssl/engine.h... yes
checking for SSLeay_version... no
checking for SSL_CTX_new... no

This can happen if you have multiple installations of OpenSSL. Try setting the --with-ssl option to match the prefix of your latest OpenSSL installation.

--enable-ssl \
--with-ssl=/usr/local \
share|improve this answer

Other google searches may lead you to setting some environment variables like these:

$ env LDFLAGS=-ldl

OR

$ export LIBS=-ldl

The first one failed for me and gave me the same error, but the second one worked.

share|improve this answer
    
not working for me –  Cerber Mar 5 at 15:14
    
This did not work for me, and the second one broke my build-essentials –  Thomas K Aug 13 at 7:08

I had the same problem when upgrading openssl from 0.9.8zb to 1.0.1i.

$/tmp/src/openssl-1.0.1i/ ./config --prefix=/usr/local/openssl -fPIC
$/tmp/src/openssl-1.0.1i/ make test
$/tmp/src/openssl-1.0.1i/ sudo make install

$/tmp/src/httpd-2.2.27/ ./config --enable-so --enable-ssl=shared --with-ssl=/usr/local/openssl
...
$configure: error: ... Error, SSL/TLS libraries were missing or unusable

None of the solutions with setting environment would fix the error message I got.

My solution was:

$/tmp/src/openssl-1.0.1i/ ./config --prefix=/usr/local/openssl-1.0.1 -shared -fPIC
$/tmp/src/openssl-1.0.1i/ make clean
$/tmp/src/openssl-1.0.1i/ make
$/tmp/src/openssl-1.0.1i/ make test
$/tmp/src/openssl-1.0.1i/ sudo make install

$sudo /sbin/ldconfig -v /usr/local/openssl-1.0.1/lib

$/tmp/src/httpd-2.2.27/ make clean && make distclean
$/tmp/src/httpd-2.2.27/ ./configure --enable-so --enable-ssl=shared --with-ssl=/usr/local/openssl-1.0.1
$/tmp/src/httpd-2.2.27/ make
$/tmp/src/httpd-2.2.27/ sudo make install

The problem was fixed by the -shared value in the openssl configuration. Now I'm faced with another problem saying that a sslv2 method is not accessible. But that's not related to this problem, and I don't have an answer for it yet..

I'll continue to search for answers regarding the sslv2 problem and post it to the relevant stackexchange topic when I've solved it.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.