Mailing List Archive

Help: Building httpd from source with specific (different then system default) OpenSSL
Hello,
I'm trying to install httpd from the source code. I have also install
OpenSSL 1.1.1c from source code and I want httpd to use this OpenSSL
library. However, while installing httpd, even mentioning httpd to
configuring with my newly installed OpenSSL seems not working. Seeking
advice from experts.

I use the following configuration to install *OpenSSL-1.1.1c*

- ./config --prefix=/opt/openssl -DOPENSSL_LOAD_CONF
--openssldir=/opt/openssl/ssl

And following configuration to install *httpd-2.4.46*

- CFLAGS='-DSSL_EXPERIMENTAL_ENGINE -DSSL_ENGINE -DOPENSSL_LOAD_CONF'
./configure --prefix=/etc/apache2 --enable-ssl --with-ssl=/opt/openssl/ssl
--with-pcre=/usr/local/pcre --enable-so

After installation, I check *httpd *binary. But I'm not seeing any *OpenSSL
*library link,


*root@xxxx:/etc/apache2/bin# ldd httpd *
linux-vdso.so.1 => (0x00007fffe4df9000)
libpcre.so.1 => /usr/local/pcre/lib/libpcre.so.1 (0x00007ff2ad391000)
libaprutil-1.so.0 => /usr/local/apr/lib/libaprutil-1.so.0
(0x00007ff2ad16b000)
libapr-1.so.0 => /usr/local/apr/lib/libapr-1.so.0 (0x00007ff2acf38000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0
(0x00007ff2acd1b000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ff2ac951000)
libexpat.so.0 => /usr/local/apr/lib/libexpat.so.0 (0x00007ff2ac729000)
libcrypt.so.1 => /lib/x86_64-linux-gnu/libcrypt.so.1 (0x00007ff2ac4f1000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007ff2ac2ed000)
/lib64/ld-linux-x86-64.so.2 (0x00007ff2ad5ae000)

Any comment on what I'm doing wrong? And How can I fix it?

Regards,
Shariful Alam
Re: Help: Building httpd from source with specific (different then system default) OpenSSL [ In reply to ]
Hello,

On Wed, Apr 7, 2021 at 10:30 AM Shariful Alam <dipto181@gmail.com> wrote:
>
> root@xxxx:/etc/apache2/bin# ldd httpd
> linux-vdso.so.1 => (0x00007fffe4df9000)
> libpcre.so.1 => /usr/local/pcre/lib/libpcre.so.1 (0x00007ff2ad391000)
> libaprutil-1.so.0 => /usr/local/apr/lib/libaprutil-1.so.0 (0x00007ff2ad16b000)
> libapr-1.so.0 => /usr/local/apr/lib/libapr-1.so.0 (0x00007ff2acf38000)
> libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007ff2acd1b000)
> libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ff2ac951000)
> libexpat.so.0 => /usr/local/apr/lib/libexpat.so.0 (0x00007ff2ac729000)
> libcrypt.so.1 => /lib/x86_64-linux-gnu/libcrypt.so.1 (0x00007ff2ac4f1000)
> libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007ff2ac2ed000)
> /lib64/ld-linux-x86-64.so.2 (0x00007ff2ad5ae000)
>
> Any comment on what I'm doing wrong? And How can I fix it?

httpd itself needs no link to openssl, mod_ssl does though.
So you should have a look at:
# ldd /etc/apache2/modules/mod_ssl.so


Regards;
Yann.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: Help: Building httpd from source with specific (different then system default) OpenSSL [ In reply to ]
Hello Yann,
Thanks for the reply.

Following is the output of *ldd mod_ssl.so, * still the same. No sign of
OpenSSL library.

root@xxx:/etc/apache2/modules# ldd mod_ssl.so
linux-vdso.so.1 => (0x00007fffce1c5000)
libssl.so.1.0.0 => /lib/x86_64-linux-gnu/libssl.so.1.0.0
(0x00007fec51b11000)
libcrypto.so.1.0.0 => /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
(0x00007fec516cc000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0
(0x00007fec514af000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fec510e5000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fec50ee1000)
/lib64/ld-linux-x86-64.so.2 (0x00007fec51fb7000)

Regards,
Shariful

On Wed, Apr 7, 2021 at 5:29 AM Yann Ylavic <ylavic.dev@gmail.com> wrote:

> Hello,
>
> On Wed, Apr 7, 2021 at 10:30 AM Shariful Alam <dipto181@gmail.com> wrote:
> >
> > root@xxxx:/etc/apache2/bin# ldd httpd
> > linux-vdso.so.1 => (0x00007fffe4df9000)
> > libpcre.so.1 => /usr/local/pcre/lib/libpcre.so.1 (0x00007ff2ad391000)
> > libaprutil-1.so.0 => /usr/local/apr/lib/libaprutil-1.so.0
> (0x00007ff2ad16b000)
> > libapr-1.so.0 => /usr/local/apr/lib/libapr-1.so.0 (0x00007ff2acf38000)
> > libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0
> (0x00007ff2acd1b000)
> > libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ff2ac951000)
> > libexpat.so.0 => /usr/local/apr/lib/libexpat.so.0 (0x00007ff2ac729000)
> > libcrypt.so.1 => /lib/x86_64-linux-gnu/libcrypt.so.1 (0x00007ff2ac4f1000)
> > libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007ff2ac2ed000)
> > /lib64/ld-linux-x86-64.so.2 (0x00007ff2ad5ae000)
> >
> > Any comment on what I'm doing wrong? And How can I fix it?
>
> httpd itself needs no link to openssl, mod_ssl does though.
> So you should have a look at:
> # ldd /etc/apache2/modules/mod_ssl.so
>
>
> Regards;
> Yann.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>
Re: Help: Building httpd from source with specific (different then system default) OpenSSL [ In reply to ]
Le 07/04/2021 à 18:56, Shariful Alam a écrit :
> Hello Yann,
> Thanks for the reply.
>
> Following is the output of *ldd mod_ssl.so, * still the same. No sign of
> OpenSSL library.
>
> root@xxx:/etc/apache2/modules# ldd mod_ssl.so
> linux-vdso.so.1 =>  (0x00007fffce1c5000)
> libssl.so.1.0.0 => /lib/x86_64-linux-gnu/libssl.so.1.0.0

Isn't libssl what you are looking for? ([1])

CJ

[1]: https://wiki.openssl.org/index.php/Libssl_API

> (0x00007fec51b11000)
> libcrypto.so.1.0.0 => /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
> (0x00007fec516cc000)
> libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0
> (0x00007fec514af000)
> libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fec510e5000)
> libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fec50ee1000)
> /lib64/ld-linux-x86-64.so.2 (0x00007fec51fb7000)
>
> Regards,
> Shariful
>
> On Wed, Apr 7, 2021 at 5:29 AM Yann Ylavic <ylavic.dev@gmail.com
> <mailto:ylavic.dev@gmail.com>> wrote:
>
> Hello,
>
> On Wed, Apr 7, 2021 at 10:30 AM Shariful Alam <dipto181@gmail.com
> <mailto:dipto181@gmail.com>> wrote:
> >
> > root@xxxx:/etc/apache2/bin# ldd httpd
> > linux-vdso.so.1 =>  (0x00007fffe4df9000)
> > libpcre.so.1 => /usr/local/pcre/lib/libpcre.so.1 (0x00007ff2ad391000)
> > libaprutil-1.so.0 => /usr/local/apr/lib/libaprutil-1.so.0
> (0x00007ff2ad16b000)
> > libapr-1.so.0 => /usr/local/apr/lib/libapr-1.so.0
> (0x00007ff2acf38000)
> > libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0
> (0x00007ff2acd1b000)
> > libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ff2ac951000)
> > libexpat.so.0 => /usr/local/apr/lib/libexpat.so.0
> (0x00007ff2ac729000)
> > libcrypt.so.1 => /lib/x86_64-linux-gnu/libcrypt.so.1
> (0x00007ff2ac4f1000)
> > libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007ff2ac2ed000)
> > /lib64/ld-linux-x86-64.so.2 (0x00007ff2ad5ae000)
> >
> > Any comment on what I'm doing wrong?  And How can I fix it?
>
> httpd itself needs no link to openssl, mod_ssl does though.
> So you should have a look at:
> # ldd /etc/apache2/modules/mod_ssl.so
>
>
> Regards;
> Yann.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> <mailto:users-unsubscribe@httpd.apache.org>
> For additional commands, e-mail: users-help@httpd.apache.org
> <mailto: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: Re: Help: Building httpd from source with specific (different then system default) OpenSSL [ In reply to ]
Hi Christophe,

Yes, I'm looking for *libssl. *But not the default one. Here, you can see
that my *mod_ssl.so *is still linked with the default libssl. However,
during httpd installation, I use the following configuration,


- CFLAGS='-DSSL_EXPERIMENTAL_ENGINE -DSSL_ENGINE -DOPENSSL_LOAD_CONF'
./configure --prefix=/etc/apache2* --enable-ssl
--with-ssl=/opt/openssl/ssl *--with-pcre=/usr/local/pcre --enable-so

so, my understanding is, with the above configuration, after a successful
build, my mod_ssl should be linked with the *libssl.so (/opt/openssl/ssl) *not
with the default (/lib/x86_64-linux-gnu/)

Regards,
Shariful Alam

On Wed, Apr 7, 2021 at 2:32 PM Christophe JAILLET <
christophe.jaillet@wanadoo.fr> wrote:

> Le 07/04/2021 à 18:56, Shariful Alam a écrit :
> > Hello Yann,
> > Thanks for the reply.
> >
> > Following is the output of *ldd mod_ssl.so, * still the same. No sign of
> > OpenSSL library.
> >
> > root@xxx:/etc/apache2/modules# ldd mod_ssl.so
> > linux-vdso.so.1 => (0x00007fffce1c5000)
> > libssl.so.1.0.0 => /lib/x86_64-linux-gnu/libssl.so.1.0.0
>
> Isn't libssl what you are looking for? ([1])
>
> CJ
>
> [1]: https://wiki.openssl.org/index.php/Libssl_API
>
> > (0x00007fec51b11000)
> > libcrypto.so.1.0.0 => /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
> > (0x00007fec516cc000)
> > libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0
> > (0x00007fec514af000)
> > libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fec510e5000)
> > libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fec50ee1000)
> > /lib64/ld-linux-x86-64.so.2 (0x00007fec51fb7000)
> >
> > Regards,
> > Shariful
> >
> > On Wed, Apr 7, 2021 at 5:29 AM Yann Ylavic <ylavic.dev@gmail.com
> > <mailto:ylavic.dev@gmail.com>> wrote:
> >
> > Hello,
> >
> > On Wed, Apr 7, 2021 at 10:30 AM Shariful Alam <dipto181@gmail.com
> > <mailto:dipto181@gmail.com>> wrote:
> > >
> > > root@xxxx:/etc/apache2/bin# ldd httpd
> > > linux-vdso.so.1 => (0x00007fffe4df9000)
> > > libpcre.so.1 => /usr/local/pcre/lib/libpcre.so.1
> (0x00007ff2ad391000)
> > > libaprutil-1.so.0 => /usr/local/apr/lib/libaprutil-1.so.0
> > (0x00007ff2ad16b000)
> > > libapr-1.so.0 => /usr/local/apr/lib/libapr-1.so.0
> > (0x00007ff2acf38000)
> > > libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0
> > (0x00007ff2acd1b000)
> > > libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ff2ac951000)
> > > libexpat.so.0 => /usr/local/apr/lib/libexpat.so.0
> > (0x00007ff2ac729000)
> > > libcrypt.so.1 => /lib/x86_64-linux-gnu/libcrypt.so.1
> > (0x00007ff2ac4f1000)
> > > libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2
> (0x00007ff2ac2ed000)
> > > /lib64/ld-linux-x86-64.so.2 (0x00007ff2ad5ae000)
> > >
> > > Any comment on what I'm doing wrong? And How can I fix it?
> >
> > httpd itself needs no link to openssl, mod_ssl does though.
> > So you should have a look at:
> > # ldd /etc/apache2/modules/mod_ssl.so
> >
> >
> > Regards;
> > Yann.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> > <mailto:users-unsubscribe@httpd.apache.org>
> > For additional commands, e-mail: users-help@httpd.apache.org
> > <mailto: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: Re: Help: Building httpd from source with specific (different then system default) OpenSSL [ In reply to ]
On Wed, Apr 7, 2021 at 10:56 PM Shariful Alam <dipto181@gmail.com> wrote:
>
> Yes, I'm looking for libssl. But not the default one. Here, you can see that my mod_ssl.so is still linked with the default libssl. However, during httpd installation, I use the following configuration,
>
> CFLAGS='-DSSL_EXPERIMENTAL_ENGINE -DSSL_ENGINE -DOPENSSL_LOAD_CONF' ./configure --prefix=/etc/apache2 --enable-ssl --with-ssl=/opt/openssl/ssl --with-pcre=/usr/local/pcre --enable-so
>
> so, my understanding is, with the above configuration, after a successful build, my mod_ssl should be linked with the libssl.so (/opt/openssl/ssl) not with the default (/lib/x86_64-linux-gnu/)

Try adding LDFLAGS='-L/opt/openssl/ssl/lib
-Wl,-rpath,/opt/openssl/ssl/lib' here too in addition to (or even
instead of) the CFLAGS.


Regards;
Yann.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: Re: Help: Building httpd from source with specific (different then system default) OpenSSL [ In reply to ]
Hi Yann,
It works!. Thanks. I'm a noob, I was trying to fix this for the past two
days. At some point, I believe I tried with the LDFLAGS too. But I can see
that I was using LDFLAGS incorrectly. Thanks for the help.

Regards,
Shariful Alam

On Wed, Apr 7, 2021 at 3:02 PM Yann Ylavic <ylavic.dev@gmail.com> wrote:

> On Wed, Apr 7, 2021 at 10:56 PM Shariful Alam <dipto181@gmail.com> wrote:
> >
> > Yes, I'm looking for libssl. But not the default one. Here, you can see
> that my mod_ssl.so is still linked with the default libssl. However,
> during httpd installation, I use the following configuration,
> >
> > CFLAGS='-DSSL_EXPERIMENTAL_ENGINE -DSSL_ENGINE -DOPENSSL_LOAD_CONF'
> ./configure --prefix=/etc/apache2 --enable-ssl --with-ssl=/opt/openssl/ssl
> --with-pcre=/usr/local/pcre --enable-so
> >
> > so, my understanding is, with the above configuration, after a
> successful build, my mod_ssl should be linked with the libssl.so
> (/opt/openssl/ssl) not with the default (/lib/x86_64-linux-gnu/)
>
> Try adding LDFLAGS='-L/opt/openssl/ssl/lib
> -Wl,-rpath,/opt/openssl/ssl/lib' here too in addition to (or even
> instead of) the CFLAGS.
>
>
> Regards;
> Yann.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>