You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by "Poggenpohl, Daniel" <da...@fernuni-hagen.de> on 2016/04/07 17:21:30 UTC
[users@httpd] Self-compiled httpd and OpenSSL: Trying to start httpd without
using LD_LIBRARY_PATH
Hello,
I'm working with Solaris 11.3 32Bit.
I've compiled and installed OpenSSL 1.0.2g with SSLv2 support (yeah, I know, but I can't get my setup to work without it) using:
cd /basedir/installers/openssl-1.0.2g
./Configure shared --openssldir=/basedir/openssl/1.0.2g enable-ssl2 solaris-x86-gcc
make clean
make depend
make
make install
My system has OpenSSL 1.0.1q pre-installed.
My runtime search path for libraries is:
# output of crle
Configuration file [version 4]: /var/ld/ld.config
Platform: 32-bit LSB 80386
Default Library Path (ELF): /lib:/usr/lib:/opt/oracle/instantclient
Trusted Directories (ELF): /lib/secure:/usr/lib/secure (system default)
I've compiled Apache HTTPD 2.4.18 with the following options:
cd /basedir/installers/httpd-2.4.18
OPENSSLDIR=/basedir/openssl/1.0.2g \
PKG_CONFIG_PATH=$OPENSSLDIR/lib/pkgconfig:$PKG_CONFIG_PATH \
; \
./configure --prefix=/basedir/apache2/2.4.18 \
--enable-rewrite --enable-so --enable-dav --enable-deflate \
--enable-authnz-ldap --enable-ldap --with-ldap \
--enable-ssl --with-ssl=$OPENSSLDIR \
--disable-version \
--with-pcre --with-mpm=prefork --enable-nonportable-atomics=yes --with-included-apr --with-crypto \
CPPFLAGS="-I$OPENSSLDIR/include" \
LDFLAGS="-L$OPENSSLDIR/lib -R $OPENSSLDIR/lib"
nano srclib/apr/libtool # fix export_symbols_cmds global_symbols_pipe bug
gmake
gmake install
When I export LD_LIBRARY_PATH in envvars using the OPENSSLDIR/lib, apache via PHPInfo finds 1.0.2g. When I don't use LD_LIBRARY_PATH, the system 1.0.1q is used.
Can I do something about this? Or is this effect because of PHP?
Regards,
Daniel Poggenpohl
Dipl.-Inf. Daniel Poggenpohl
FernUniversität in Hagen
Zentrum für Medien und IT (ZMI)
Universitätsstraße 21
58084 Hagen
AVZ, Raum A107
Tel.: +49 (2331) 987-2801
Fax: +49 (2331) 987-2720
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] Self-compiled httpd and OpenSSL: Trying to start
httpd without using LD_LIBRARY_PATH
Posted by Rainer Jung <ra...@kippdata.de>.
Hi Chris,
Am 08.04.2016 um 18:09 schrieb Rainer Canavan:
> On Fri, Apr 8, 2016 at 6:02 PM, Christopher Schultz
> <ch...@christopherschultz.net> wrote:
> [...]
>> I'm speaking from a position of ignorance, here, but can a dynamic
>> library modify the main process's search path? If only mod_ssl is
>> compiled with the static-path to OpenSSL but httpd is not (and it's
>> not clear to me that httpd is missing this static-path), surely the
>> loadable module isn't modifying the process's library load-path, is it?
>
> The manpage would indicate that the rnupath is only valid for the library
> for which it has been set:
>
> https://docs.oracle.com/cd/E19683-01/816-0210/6m6nb7md6/index.html
>
> The runtime linker uses a prescribed search path for locating the
> dynamic dependencies of an object. The default search paths are
> therunpath recorded in the object, followed by /usr/lib for 32-bit
> objects or /usr/lib/64 for 64-bit objects. This latter component can
> be modified using a configuration file created with crle(1). The
> runpath is specified when the dynamic object is constructed using the
> -Roption to ld(1). LD_LIBRARY_PATH can be used to indicate directories
> to be searched before the default directories.
Adding to that for Solaris:
- there's the loading of the dependencies
and
- there's symbol resolution in the loaded objects
The loading of the dependencies happens immediately. The name of the
dependencies are encoded in the shared object as the NEEDED entries.
Example:
index tag value
[0] NEEDED 0x1331 libssl.so.1.0.0
[1] NEEDED 0x1341 libcrypto.so.1.0.0
These are shared object names, not file names.
Looking at some file libssl.so we can see its shared object name:
index tag value
...
[7] SONAME 0x4930 libssl.so.1.0.0
Aha, so that file would satisfy the dependency. The SONAMEs are
typically chosen to express API compatibility.
Where are the files searched for? That's the question Rainer Canavan
just answered. First on the RUNPATH set in the shared object for which
we are looking for the dependencies, then in the LD_LIBRARY_PATH, then
in the globally defined search path.
Example RUNPATH entry:
index tag value
...
[6] RUNPATH 0x101ff /some/path/lib
[7] RPATH 0x101ff /some/path/lib
The ldd command (and ldd -v) shows us the list of dependencies and where
they are found, but "elfdump -d" resp. "objdump -p" helps to understand,
what the modules/libs originally demanded.
Finally there comes symbol resolution, i.e. a function that is called in
a shared object, but provided by another loaded shared object like the
OpenSSL library. Such a symbol is searched for in the binary and the
full tree of loaded shared objects and dependencies of this process. On
Solaris the default order - which can be changed during build time - is
always first searching in the main binary and then in the other shared
objects in the order they were loaded. So e.g. a symbol needed by
mod_ssl will first be looked up in httpd, then in the libs loaded by
httpd directly, then in the various web server modules and their
dependencies until finally found e.g. in libssl. One can build modules
so that symbols are always first searched in their direct dependencies
before searching in the rest of the process, but that's not the default.
Regards,
Rainer (the other one)
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] Self-compiled httpd and OpenSSL: Trying to start
httpd without using LD_LIBRARY_PATH
Posted by Rainer Canavan <ra...@sevenval.com>.
On Fri, Apr 8, 2016 at 6:02 PM, Christopher Schultz
<ch...@christopherschultz.net> wrote:
[...]
> I'm speaking from a position of ignorance, here, but can a dynamic
> library modify the main process's search path? If only mod_ssl is
> compiled with the static-path to OpenSSL but httpd is not (and it's
> not clear to me that httpd is missing this static-path), surely the
> loadable module isn't modifying the process's library load-path, is it?
The manpage would indicate that the rnupath is only valid for the library
for which it has been set:
https://docs.oracle.com/cd/E19683-01/816-0210/6m6nb7md6/index.html
The runtime linker uses a prescribed search path for locating the
dynamic dependencies of an object. The default search paths are
therunpath recorded in the object, followed by /usr/lib for 32-bit
objects or /usr/lib/64 for 64-bit objects. This latter component can
be modified using a configuration file created with crle(1). The
runpath is specified when the dynamic object is constructed using the
-Roption to ld(1). LD_LIBRARY_PATH can be used to indicate directories
to be searched before the default directories.
rainer
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] Self-compiled httpd and OpenSSL: Trying to start
httpd without using LD_LIBRARY_PATH
Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Rainer,
On 4/8/16 11:30 AM, Rainer Jung wrote:
> Am 08.04.2016 um 10:41 schrieb Rainer Canavan:
>> On Fri, Apr 8, 2016 at 12:31 AM, Yann Ylavic
>> <yl...@gmail.com> wrote:
>>> On Thu, Apr 7, 2016 at 5:21 PM, Poggenpohl, Daniel
>>> <da...@fernuni-hagen.de> wrote:
>>>>
>>>> LDFLAGS="-L$OPENSSLDIR/lib -R $OPENSSLDIR/lib"
>>>
>>> I don't know which compiler you are using, but gcc's -R is not
>>> working correctly (on Linux at least), whereas
>>> "-Wl,-rpath,$OPENSSLDIR/lib" is...
>>
>> -R used to work for us on Solaris with gcc to compile/link/run
>> our own httpd / php / curl / openssl stack. However, I'm not sure
>> which linker we used to use. If ldd claims it's picking up the
>> correct libraries, I'd assume it should work at runtime as well.
>> In case there's any doubt, lsof may show which libraries are
>> actually used.
>
> ... and you can check the result of the "-R" or "-Wl,-rpath"
> compilation using "elfdump":
>
> elfdump -d /path/to/modules/mod_ssl.so
>
> will show you exactly, what NEEDED library names the linker has put
> into mod_ssl.so and also the RPATH and RUNPATH setting it has
> written to that shared object.
>
> You can use that command on any shared object or binary (PHP libs
> etc.). I typically use it on Solaris Sparc, but I expect it to work
> as-is on Solaris x86. On Linux the info is available via "objdump
> -p".
I'm speaking from a position of ignorance, here, but can a dynamic
library modify the main process's search path? If only mod_ssl is
compiled with the static-path to OpenSSL but httpd is not (and it's
not clear to me that httpd is missing this static-path), surely the
loadable module isn't modifying the process's library load-path, is it?
- -chris
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iEYEARECAAYFAlcH1fgACgkQ9CaO5/Lv0PDj/ACgikEWnZYxThJD5o1qqFwUkeUk
SiIAoLSZk/T16ua3Qkywx8yrX1IXapgt
=b0pp
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] Self-compiled httpd and OpenSSL: Trying to start
httpd without using LD_LIBRARY_PATH
Posted by Rainer Jung <ra...@kippdata.de>.
Am 08.04.2016 um 10:41 schrieb Rainer Canavan:
> On Fri, Apr 8, 2016 at 12:31 AM, Yann Ylavic <yl...@gmail.com> wrote:
>> On Thu, Apr 7, 2016 at 5:21 PM, Poggenpohl, Daniel
>> <da...@fernuni-hagen.de> wrote:
>>>
>>> LDFLAGS="-L$OPENSSLDIR/lib -R $OPENSSLDIR/lib"
>>
>> I don't know which compiler you are using, but gcc's -R is not working
>> correctly (on Linux at least), whereas "-Wl,-rpath,$OPENSSLDIR/lib"
>> is...
>
> -R used to work for us on Solaris with gcc to compile/link/run our own
> httpd / php / curl / openssl stack. However, I'm not sure which linker we
> used to use. If ldd claims it's picking up the correct libraries, I'd assume
> it should work at runtime as well. In case there's any doubt, lsof may show
> which libraries are actually used.
... and you can check the result of the "-R" or "-Wl,-rpath" compilation
using "elfdump":
elfdump -d /path/to/modules/mod_ssl.so
will show you exactly, what NEEDED library names the linker has put into
mod_ssl.so and also the RPATH and RUNPATH setting it has written to that
shared object.
You can use that command on any shared object or binary (PHP libs etc.).
I typically use it on Solaris Sparc, but I expect it to work as-is on
Solaris x86. On Linux the info is available via "objdump -p".
Regards,
Rainer
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] Self-compiled httpd and OpenSSL: Trying to start
httpd without using LD_LIBRARY_PATH
Posted by Yann Ylavic <yl...@gmail.com>.
On Fri, Apr 8, 2016 at 3:01 PM, Poggenpohl, Daniel
<da...@fernuni-hagen.de> wrote:
>
> Then I use my new shiny command to remove the global_symbol_pipe bug in the libtool script:
> LIBTOOL=/moodle/installers/httpd-2.4.18/srclib/apr/libtool; sed '/export_symbols_cmds.*global_symbol_pipe/s/ | \\\$global_symbol_pipe//' <$LIBTOOL >libtool.tmp; mv libtool.tmp $LIBTOOL
This command probably removes the +x on $LIBTOOL...
> /bin/sh[1]: /basedir/installers/httpd-2.4.18/srclib/apr/libtool: cannot execute [Permission denied]
... hence this error IMHO.
Regards,
Yann.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
AW: [users@httpd] Self-compiled httpd and OpenSSL: Trying to start
httpd without using LD_LIBRARY_PATH [wd-vc]
Posted by "Bremser, Kurt (AMOS Austria GmbH)" <Ku...@allianz.at>.
>------------------
/bin/sh[1]: /basedir/installers/httpd-2.4.18/srclib/apr/libtool: cannot execute [Permission denied]
gmake[3]: *** [unixd.lo] Error 126
gmake[3]: Leaving directory `/basedir/installers/httpd-2.4.18/os/unix'
gmake[2]: *** [all-recursive] Error 1
gmake[2]: Leaving directory `/basedir/installers/httpd-2.4.18/os/unix'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `/basedir/installers/httpd-2.4.18/os'
gmake: *** [all-recursive] Error 1
I don't know why, but this line doesn't use /bin/sh . I'm doing all this as root, so I don't know why "Permission denied" is thrown.
Any thoughts?
Hi!
/basedir/installers/httpd-2.4.18/srclib/apr/libtool most likely does not have the execute bit set.
Kurt
AMOS Austria GmbH
1130 Wien, Hietzinger Kai 101-105
FN 365014k, Handelsgericht Wien
UID: ATU 66614737
http://www.allianz.at
********************************************************
Dieses E-Mail und allfaellig daran angeschlossene Anhaenge
enthalten Informationen, die vertraulich und
ausschliesslich fuer den (die) bezeichneten Adressaten
bestimmt sind.
Wenn Sie nicht der genannte Adressat sind, darf dieses
E-Mail samt allfaelliger Anhaenge von Ihnen weder anderen
Personen zugaenglich gemacht noch in anderer Weise
verwertet werden.
Wenn Sie nicht der beabsichtigte Empfaenger sind, bitten
wir Sie, dieses E-Mail und saemtliche angeschlossene
Anhaenge zu loeschen.
Please note: This email and any files transmitted with it is
intended only for the named recipients and may contain
confidential and/or privileged information. If you are not the
intended recipient, please do not read, copy, use or disclose
the contents of this communication to others and notify the
sender immediately. Then please delete the email and any
copies of it. Thank you.
********************************************************
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
AW: [users@httpd] Self-compiled httpd and OpenSSL: Trying to start
httpd without using LD_LIBRARY_PATH
Posted by "Poggenpohl, Daniel" <da...@fernuni-hagen.de>.
So hello,
stepping back a bit, I decided to look which gcc I'm using. It seems it's one in /usr/sfw/bin (Sun Freeware), and it is gcc 3.4.3 (relatively old, it seems). So I looked what gcc packages are installed on the system (pkg list | grep gcc) and somehow the wrapper package gcc-48 is installed, but the binaries aren't (packages gcc-c-48 and gcc-common-48). So I install the newer gcc (pkg install gcc-c-48) and voila, now I have a gcc 4.8.2 waiting for me, which I hope is better and will recognize the -R command...
I recompile OpenSSL 1.0.2g via the same commands.
I then reextract my httpd archive and reconfigure using the same commands:
APACHEDIR=/moodle/apache2/2.4.18 \
OPENSSLDIR=/moodle/openssl/1.0.2g \
PKG_CONFIG_PATH=$OPENSSLDIR/lib/pkgconfig:$PKG_CONFIG_PATH \
; \
./configure --prefix=$APACHEDIR \
--enable-rewrite --enable-so --enable-dav --enable-deflate \
--enable-authnz-ldap --enable-ldap --with-ldap \
--enable-ssl --with-ssl=$OPENSSLDIR \
--disable-version \
--with-pcre --with-mpm=prefork --enable-nonportable-atomics=yes --with-included-apr --with-crypto \
CPPFLAGS="-I$OPENSSLDIR/include" \
LDFLAGS="-L$OPENSSLDIR/lib -R $OPENSSLDIR/lib" \
>apache-2418-configure.out 2>&1
Then I use my new shiny command to remove the global_symbol_pipe bug in the libtool script:
LIBTOOL=/moodle/installers/httpd-2.4.18/srclib/apr/libtool; sed '/export_symbols_cmds.*global_symbol_pipe/s/ | \\\$global_symbol_pipe//' <$LIBTOOL >libtool.tmp; mv libtool.tmp $LIBTOOL
and try to build httpd (gmake).
It builds until here:
Making all in unix
gmake[2]: Entering directory `/basedir/installers/httpd-2.4.18/os/unix'
gmake[3]: Entering directory `/basedir/installers/httpd-2.4.18/os/unix'
/basedir/installers/httpd-2.4.18/srclib/apr/libtool --silent --mode=compile gcc -std=gnu99 -g -O2 -DSOLARIS2=11 -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT -D_LARGEFILE64_SOURCE -I/basedir/openssl/1.0.2g/include -I. -I/basedir/installers/httpd-2.4.18/os/unix -I/basedir/installers/httpd-2.4.18/include -I/basedir/installers/httpd-2.4.18/srclib/apr/include -I/basedir/installers/httpd-2.4.18/srclib/apr-util/include -I/usr/include/pcre -I/basedir/installers/httpd-2.4.18/modules/aaa -I/basedir/installers/httpd-2.4.18/modules/cache -I/basedir/installers/httpd-2.4.18/modules/core -I/basedir/installers/httpd-2.4.18/modules/database -I/basedir/installers/httpd-2.4.18/modules/filters -I/basedir/installers/httpd-2.4.18/modules/ldap -I/basedir/installers/httpd-2.4.18/modules/loggers -I/basedir/installers/httpd-2.4.18/modules/lua -I/basedir/installers/httpd-2.4.18/modules/proxy -I/basedir/installers/httpd-2.4.18/modules/session -I/basedir/installers/httpd-2.4.18/modules/ssl -I/basedir/installers/httpd-2.4.18/modules/test -I/basedir/installers/httpd-2.4.18/server -I/basedir/installers/httpd-2.4.18/modules/arch/unix -I/basedir/installers/httpd-2.4.18/modules/dav/main -I/basedir/installers/httpd-2.4.18/modules/generators -I/basedir/installers/httpd-2.4.18/modules/mappers -prefer-non-pic -static -c unixd.c && touch unixd.lo
/bin/sh[1]: /basedir/installers/httpd-2.4.18/srclib/apr/libtool: cannot execute [Permission denied]
gmake[3]: *** [unixd.lo] Error 126
gmake[3]: Leaving directory `/basedir/installers/httpd-2.4.18/os/unix'
gmake[2]: *** [all-recursive] Error 1
gmake[2]: Leaving directory `/basedir/installers/httpd-2.4.18/os/unix'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `/basedir/installers/httpd-2.4.18/os'
gmake: *** [all-recursive] Error 1
I don't know why, but this line doesn't use /bin/sh . I'm doing all this as root, so I don't know why "Permission denied" is thrown.
Any thoughts?
@dferradal: I used -R for gcc so that the httpd and the modules know where to look for the OpenSSL library. It seems no one else knows about this option or else somehow misses it when I write it. Or do you mean I shouldn't do both (-R and tell the openssl folder to configure)?
Regards,
Daniel P.
-----Ursprüngliche Nachricht-----
Von: Daniel [mailto:dferradal@gmail.com]
Gesendet: Freitag, 8. April 2016 13:18
An: users@httpd.apache.org
Betreff: Re: [users@httpd] Self-compiled httpd and OpenSSL: Trying to start httpd without using LD_LIBRARY_PATH
They key in the OP is here:
"I've compiled Apache HTTPD 2.4.18 with the following options:
cd /basedir/installers/httpd-2.4.18
OPENSSLDIR=/basedir/openssl/1.0.2g \" <-----
You compiled httpd against openssl 1.0.2g , so it is normal you have to add LD_LIBRARY_PATH to use it and if you don't apache will look for the ssl libs in needs in the paths it has (your system's)
El vie., 8 abr. 2016 a las 10:41, Rainer Canavan (<ra...@sevenval.com>) escribió:
On Fri, Apr 8, 2016 at 12:31 AM, Yann Ylavic <yl...@gmail.com> wrote:
> On Thu, Apr 7, 2016 at 5:21 PM, Poggenpohl, Daniel
> <da...@fernuni-hagen.de> wrote:
>>
>> LDFLAGS="-L$OPENSSLDIR/lib -R $OPENSSLDIR/lib"
>
> I don't know which compiler you are using, but gcc's -R is not working
> correctly (on Linux at least), whereas "-Wl,-rpath,$OPENSSLDIR/lib"
> is...
-R used to work for us on Solaris with gcc to compile/link/run our own
httpd / php / curl / openssl stack. However, I'm not sure which linker we
used to use. If ldd claims it's picking up the correct libraries, I'd assume
it should work at runtime as well. In case there's any doubt, lsof may show
which libraries are actually used.
rainer
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] Self-compiled httpd and OpenSSL: Trying to start
httpd without using LD_LIBRARY_PATH
Posted by Daniel <df...@gmail.com>.
They key in the OP is here:
"I've compiled Apache HTTPD 2.4.18 with the following options:
cd /basedir/installers/httpd-2.4.18
OPENSSLDIR=/basedir/openssl/1.0.2g \" <-----
You compiled httpd against openssl 1.0.2g , so it is normal you have to add
LD_LIBRARY_PATH to use it and if you don't apache will look for the ssl
libs in needs in the paths it has (your system's)
El vie., 8 abr. 2016 a las 10:41, Rainer Canavan (<
rainer.canavan@sevenval.com>) escribió:
> On Fri, Apr 8, 2016 at 12:31 AM, Yann Ylavic <yl...@gmail.com> wrote:
> > On Thu, Apr 7, 2016 at 5:21 PM, Poggenpohl, Daniel
> > <da...@fernuni-hagen.de> wrote:
> >>
> >> LDFLAGS="-L$OPENSSLDIR/lib -R $OPENSSLDIR/lib"
> >
> > I don't know which compiler you are using, but gcc's -R is not working
> > correctly (on Linux at least), whereas "-Wl,-rpath,$OPENSSLDIR/lib"
> > is...
>
> -R used to work for us on Solaris with gcc to compile/link/run our own
> httpd / php / curl / openssl stack. However, I'm not sure which linker we
> used to use. If ldd claims it's picking up the correct libraries, I'd
> assume
> it should work at runtime as well. In case there's any doubt, lsof may
> show
> which libraries are actually used.
>
>
> rainer
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>
Re: [users@httpd] Self-compiled httpd and OpenSSL: Trying to start
httpd without using LD_LIBRARY_PATH
Posted by Rainer Canavan <ra...@sevenval.com>.
On Fri, Apr 8, 2016 at 12:31 AM, Yann Ylavic <yl...@gmail.com> wrote:
> On Thu, Apr 7, 2016 at 5:21 PM, Poggenpohl, Daniel
> <da...@fernuni-hagen.de> wrote:
>>
>> LDFLAGS="-L$OPENSSLDIR/lib -R $OPENSSLDIR/lib"
>
> I don't know which compiler you are using, but gcc's -R is not working
> correctly (on Linux at least), whereas "-Wl,-rpath,$OPENSSLDIR/lib"
> is...
-R used to work for us on Solaris with gcc to compile/link/run our own
httpd / php / curl / openssl stack. However, I'm not sure which linker we
used to use. If ldd claims it's picking up the correct libraries, I'd assume
it should work at runtime as well. In case there's any doubt, lsof may show
which libraries are actually used.
rainer
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] Self-compiled httpd and OpenSSL: Trying to start
httpd without using LD_LIBRARY_PATH
Posted by Yann Ylavic <yl...@gmail.com>.
On Thu, Apr 7, 2016 at 5:21 PM, Poggenpohl, Daniel
<da...@fernuni-hagen.de> wrote:
>
> LDFLAGS="-L$OPENSSLDIR/lib -R $OPENSSLDIR/lib"
I don't know which compiler you are using, but gcc's -R is not working
correctly (on Linux at least), whereas "-Wl,-rpath,$OPENSSLDIR/lib"
is...
Regards,
Yann.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: AW: [users@httpd] Self-compiled httpd and OpenSSL: Trying to start
httpd without using LD_LIBRARY_PATH
Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Daniel,
On 4/7/16 2:52 PM, Poggenpohl, Daniel wrote:
> my setup is: I have a Moodle installation I need to run. So I need
> Apache, PHP, OpenSSL, iconv, mbstring, curl, zip, etc. . The plan
> is to have a relatively new PHP (5.6.20) and stay "new" with Apache
> and OpenSSL.
>
> [snip]
>
> This all didn't happen when I compiled OpenSSL 1.0.2g with SSLv2
> support, by the way (we deactivated SSLv2 in our Apache anyway,
> and SSLLabs says we're in the clear regarding to Drown). With SSLv2
> support, PHP's configure finished without a real warning. And I
> could build it as well. So I frowned and accepted SSLv2 support for
> the moment.
Okay, so:
1. Things just don't seem to work if you compile without SSLv2
2. You don't actually need it, so it's disabled everywhere
That's fine. It would be good to find out *why* SSLv2 support is
required for everything to build/run properly, but it's not an
anormous concern just to have it in the binary.
> By the way, you didn't quote my CPPFLAGS and LDFLAGS that I set.
> Using LDFLAGS, or rather -R I understand that I can set the
> runtime search path when linking the library. When I "ldd -s
> httpd", no SSL library is necessary there. And "ldd -s
> modules/mod_ssl.so" tells me it finds the locally installed 1.0.2g
> version. So I still don't understand why I need to set
> LD_LIBRARY_PATH when the linker finds what I want.
Hmm. I'm not familiar enough with the httpd build process to know what
the exact implications of using -R are.
> Yes, I want to avoid using LD_LIBRARY_PATH, because I read about
> methods (like using -R) that could tell libraries where they
> should look first and LD_LIBRARY_PATH seems to be a kind of last
> resort.
If -R is supposed to work, then by all means use -R. Just be aware
that if you need to upgrade OpenSSL, you either need to use a
version-independent installation path (e.g. /usr/local/openssl/current
- -- I'd recommend a symlink for this purpose), or you'll need to
recompile httpd (mod_ssl, really).
Someone else will have to comment on why -R might not be having the
intended effect.
> Notes: - Yes, OpenSSL is compiled as a shared library. - Ideally, I
> would use /latest links combined with -R to avoid recompiling.
:)
> - Do I understand the following right? -I tells the compiler where
> to look for headers during compile time. -L tells the compiler
> where to find libraries to use in linking during the build. -R
> tells the Linker where to search for libraries during runtime.
Precisely.
- -chris
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iEYEARECAAYFAlcGwEcACgkQ9CaO5/Lv0PBSVwCgwaYwPlK5IjWi9l+5Qo5hk4XE
1w8AoI2JmTc9VdnK/kkwoaU/cVVRtkrA
=phx0
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] Self-compiled httpd and OpenSSL: Trying to start
httpd without using LD_LIBRARY_PATH
Posted by Rainer Jung <ra...@kippdata.de>.
Hi,
Am 07.04.2016 um 20:52 schrieb Poggenpohl, Daniel:
> Hi,
>
> my setup is: I have a Moodle installation I need to run. So I need Apache, PHP, OpenSSL, iconv, mbstring, curl, zip, etc. . The plan is to have a relatively new PHP (5.6.20) and stay "new" with Apache and OpenSSL.
> Solaris 11.3 seems to come with Apache 2.4.16, PHP 5.3.29, OpenSSL 1.0.1q, curl 7.35.0, OpenLDAP 2.4.30, and others using the official package repository, so I don't really want to use the official packages for Apache, PHP and OpenSSL.
> I tried using another package repository (OpenCSW), which seems to provide Apache 2.4.18, PHP 5.6.20, curl 7.48.0, OpenSSL 1.0.1s runtime libraries, OpenLDAP 2.4.40, etc. .The problem there is that officially, the packages have these release numbers, but when I install PHP via pkgutil, I get 5.3.XX ínstead.
> So I decided to compile from source.
>
> I compiled OpenSSL 1.0.2g from source without SSLv2 support (without enable-ssl2), because I don't really want to have SSLv2 support if I don't need it.
> Compiling Apache with the setup below posed no problem other than httpd not finding 1.0.2g without LD_LIBRARY_PATH.
> But the problems began when I compiled PHP 5.6.20 from source (I will send my configure call when I'm back at work tomorrow).
> Basically, the configure checks curl, uses the system curl which tries to use one of the functions in OpenSSL 1.0.2g which are gone. So I had to compile curl 7.48.0.
> The next problem was the jpeg extension which I solved by setting some -I and -L options and the PKG_CONFIG_PATH (pointing to the openssl and curl dirs) . It seems to have used the system curl as well.
> Then I had to compile iconv because of unrelated reasons.
> Then the zip extension wouldn't work so I had to compile libzip.
> And so on and so on.
>
> This all didn't happen when I compiled OpenSSL 1.0.2g with SSLv2 support, by the way (we deactivated SSLv2 in our Apache anyway, and SSLLabs says we're in the clear regarding to Drown). With SSLv2 support, PHP's configure finished without a real warning. And I could build it as well. So I frowned and accepted SSLv2 support for the moment.
The removal of symbols when SSLv2 support was removed from OpenSSL
1.0.2g happened by accident and was not intended.
Under
https://github.com/openssl/openssl/commit/133138569f37d149ed1d7641fe8c75a93fded445
you can find a simple patch that was already applied to OpenSSL 1.0.2
and will be part of the next version 1.0.2h. You might want to add this
patch to 1.0.2g before compiling. Such an API break is not normal and as
I said happened this time by accident.
> By the way, you didn't quote my CPPFLAGS and LDFLAGS that I set. Using LDFLAGS, or rather -R I understand that I can set the runtime search path when linking the library. When I "ldd -s httpd", no SSL library is necessary there. And "ldd -s modules/mod_ssl.so" tells me it finds the locally installed 1.0.2g version. So I still don't understand why I need to set LD_LIBRARY_PATH when the linker finds what I want.
Since LDFLAGS are used for all linking actions, you might better use
MOD_SSL_LDADD="-R/path/to/openssl/lib"
or as Yann said the more compatible
MOD_SSL_LDADD="-Wl,-rpath -Wl,/path/to/openssl/lib"
For the "ab" support binary if you want to compile it with ssl support,
I think there's also a similar "ab_LDADD" variable and for the crypto
support in the bundled APR 1.5 there's LDADD_crypto_openssl.
> Yes, I want to avoid using LD_LIBRARY_PATH, because I read about methods (like using -R) that could tell libraries where they should look first and LD_LIBRARY_PATH seems to be a kind of last resort.
>
> Notes:
> - Yes, OpenSSL is compiled as a shared library.
> - Ideally, I would use /latest links combined with -R to avoid recompiling.
> - Do I understand the following right? -I tells the compiler where to look for headers during compile time. -L tells the compiler where to find libraries to use in linking during the build. -R tells the Linker where to search for libraries during runtime.
You did understand it right. See my other post about elfdump/objdump.
Regards,
Rainer
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
AW: [users@httpd] Self-compiled httpd and OpenSSL: Trying to start
httpd without using LD_LIBRARY_PATH
Posted by "Poggenpohl, Daniel" <da...@fernuni-hagen.de>.
Hi,
my setup is: I have a Moodle installation I need to run. So I need Apache, PHP, OpenSSL, iconv, mbstring, curl, zip, etc. . The plan is to have a relatively new PHP (5.6.20) and stay "new" with Apache and OpenSSL.
Solaris 11.3 seems to come with Apache 2.4.16, PHP 5.3.29, OpenSSL 1.0.1q, curl 7.35.0, OpenLDAP 2.4.30, and others using the official package repository, so I don't really want to use the official packages for Apache, PHP and OpenSSL.
I tried using another package repository (OpenCSW), which seems to provide Apache 2.4.18, PHP 5.6.20, curl 7.48.0, OpenSSL 1.0.1s runtime libraries, OpenLDAP 2.4.40, etc. .The problem there is that officially, the packages have these release numbers, but when I install PHP via pkgutil, I get 5.3.XX ínstead.
So I decided to compile from source.
I compiled OpenSSL 1.0.2g from source without SSLv2 support (without enable-ssl2), because I don't really want to have SSLv2 support if I don't need it.
Compiling Apache with the setup below posed no problem other than httpd not finding 1.0.2g without LD_LIBRARY_PATH.
But the problems began when I compiled PHP 5.6.20 from source (I will send my configure call when I'm back at work tomorrow).
Basically, the configure checks curl, uses the system curl which tries to use one of the functions in OpenSSL 1.0.2g which are gone. So I had to compile curl 7.48.0.
The next problem was the jpeg extension which I solved by setting some -I and -L options and the PKG_CONFIG_PATH (pointing to the openssl and curl dirs) . It seems to have used the system curl as well.
Then I had to compile iconv because of unrelated reasons.
Then the zip extension wouldn't work so I had to compile libzip.
And so on and so on.
This all didn't happen when I compiled OpenSSL 1.0.2g with SSLv2 support, by the way (we deactivated SSLv2 in our Apache anyway, and SSLLabs says we're in the clear regarding to Drown). With SSLv2 support, PHP's configure finished without a real warning. And I could build it as well. So I frowned and accepted SSLv2 support for the moment.
By the way, you didn't quote my CPPFLAGS and LDFLAGS that I set. Using LDFLAGS, or rather -R I understand that I can set the runtime search path when linking the library. When I "ldd -s httpd", no SSL library is necessary there. And "ldd -s modules/mod_ssl.so" tells me it finds the locally installed 1.0.2g version. So I still don't understand why I need to set LD_LIBRARY_PATH when the linker finds what I want.
Yes, I want to avoid using LD_LIBRARY_PATH, because I read about methods (like using -R) that could tell libraries where they should look first and LD_LIBRARY_PATH seems to be a kind of last resort.
Notes:
- Yes, OpenSSL is compiled as a shared library.
- Ideally, I would use /latest links combined with -R to avoid recompiling.
- Do I understand the following right? -I tells the compiler where to look for headers during compile time. -L tells the compiler where to find libraries to use in linking during the build. -R tells the Linker where to search for libraries during runtime.
Regards,
Daniel Poggenpohl
________________________________________
Von: Christopher Schultz [chris@christopherschultz.net]
Gesendet: Donnerstag, 7. April 2016 20:03
An: users@httpd.apache.org
Betreff: Re: [users@httpd] Self-compiled httpd and OpenSSL: Trying to start httpd without using LD_LIBRARY_PATH
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Daniel,
On 4/7/16 11:21 AM, Poggenpohl, Daniel wrote:
> I'm working with Solaris 11.3 32Bit.
>
> I've compiled and installed OpenSSL 1.0.2g with SSLv2 support
> (yeah, I know, but I can't get my setup to work without it) using:
You need to fix that ... right now. When you say "my setup won't work
without it", what do you mean?
Please tell me you accidentally typed "SSLv2" instead of "SSLv3", and
meant "SSLv3".
> My system has OpenSSL 1.0.1q pre-installed.
Okay.
> I've compiled Apache HTTPD 2.4.18 with the following options: cd
> /basedir/installers/httpd-2.4.18 OPENSSLDIR=/basedir/openssl/1.0.2g
> \ PKG_CONFIG_PATH=$OPENSSLDIR/lib/pkgconfig:$PKG_CONFIG_PATH \ ; \
> ./configure --prefix=/basedir/apache2/2.4.18 \ --enable-rewrite
> --enable-so --enable-dav --enable-deflate \ --enable-authnz-ldap
> --enable-ldap --with-ldap \ --enable-ssl --with-ssl=$OPENSSLDIR \
Okay.
> When I export LD_LIBRARY_PATH in envvars using the OPENSSLDIR/lib,
> apache via PHPInfo finds 1.0.2g. When I don't use LD_LIBRARY_PATH,
> the system 1.0.1q is used.
>
> Can I do something about this? Or is this effect because of PHP?
That's totally expected. When you compiled httpd, the
- --with-ssl=$OPENSSLDIR really only chose the library header files to
use for the compilation. Since OpenSSL is (likely) compiled as a
shared-library, the linking is actually done at runtime instead of
compile-time.
LD_LIBRARY_PATH is how dynamic linking actually locates the libraries
that will be used at runtime. Your httpd build information is not
retained, and you need to set up the environment to get what you want.
Is there a particular problem with setting LD_LIBRARY_PATH, or did you
just want to know if you could avoid it?
- -chris
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iEYEARECAAYFAlcGoN0ACgkQ9CaO5/Lv0PBWUACcCTt4QOC9+nuxGqRUi1m5vI76
AC4An1vY4posMmjV5ODqG58xYNZi4DYL
=s0+x
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] Self-compiled httpd and OpenSSL: Trying to start
httpd without using LD_LIBRARY_PATH
Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Daniel,
On 4/7/16 11:21 AM, Poggenpohl, Daniel wrote:
> I'm working with Solaris 11.3 32Bit.
>
> I've compiled and installed OpenSSL 1.0.2g with SSLv2 support
> (yeah, I know, but I can't get my setup to work without it) using:
You need to fix that ... right now. When you say "my setup won't work
without it", what do you mean?
Please tell me you accidentally typed "SSLv2" instead of "SSLv3", and
meant "SSLv3".
> My system has OpenSSL 1.0.1q pre-installed.
Okay.
> I've compiled Apache HTTPD 2.4.18 with the following options: cd
> /basedir/installers/httpd-2.4.18 OPENSSLDIR=/basedir/openssl/1.0.2g
> \ PKG_CONFIG_PATH=$OPENSSLDIR/lib/pkgconfig:$PKG_CONFIG_PATH \ ; \
> ./configure --prefix=/basedir/apache2/2.4.18 \ --enable-rewrite
> --enable-so --enable-dav --enable-deflate \ --enable-authnz-ldap
> --enable-ldap --with-ldap \ --enable-ssl --with-ssl=$OPENSSLDIR \
Okay.
> When I export LD_LIBRARY_PATH in envvars using the OPENSSLDIR/lib,
> apache via PHPInfo finds 1.0.2g. When I don't use LD_LIBRARY_PATH,
> the system 1.0.1q is used.
>
> Can I do something about this? Or is this effect because of PHP?
That's totally expected. When you compiled httpd, the
- --with-ssl=$OPENSSLDIR really only chose the library header files to
use for the compilation. Since OpenSSL is (likely) compiled as a
shared-library, the linking is actually done at runtime instead of
compile-time.
LD_LIBRARY_PATH is how dynamic linking actually locates the libraries
that will be used at runtime. Your httpd build information is not
retained, and you need to set up the environment to get what you want.
Is there a particular problem with setting LD_LIBRARY_PATH, or did you
just want to know if you could avoid it?
- -chris
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iEYEARECAAYFAlcGoN0ACgkQ9CaO5/Lv0PBWUACcCTt4QOC9+nuxGqRUi1m5vI76
AC4An1vY4posMmjV5ODqG58xYNZi4DYL
=s0+x
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org