Help to build nginx withe specific OpenSSL shared library

Fabio Ancona fabio.ancona at gmail.com
Wed Jul 12 12:00:21 UTC 2017


Hi.
Thanks for your suggestion.
But I just found an easier way (using the "configure") to build nginx with
OpenSSL shared library not using the system OpenSSL library but using the
shared library in a specific path (OpenSSL already built in "/opt/ssldevel"
in my case).
I set the "--with-ld-opt=" in this way:

--with-ld-opt="-L /opt/ssldevel/lib -ldl -Wl,-rpath,/opt/ssldevel/lib"

So the configure will be:

configure --with-cc-opt="-I /opt/ssldevel/include" --with-ld-opt="-L
/opt/ssldevel/lib -ldl -Wl,-rpath,/opt/ssldevel/lib" --with-http_ssl_module
--with-openssl-opt=enable-tls1_3

In this way nginx will use the shared OpenSSL library to the specific path
"/opt/ssldevel", see here:

root at server:~# ldd /usr/local/nginx/sbin/nginx
        linux-vdso.so.1 =>  (0x7ef4f000)
        /usr/lib/arm-linux-gnueabihf/libcofi_rpi.so (0x76fd8000)
        libdl.so.2 => /lib/arm-linux-gnueabihf/libdl.so.2 (0x76fbb000)
        libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0
(0x76f9c000)
        libcrypt.so.1 => /lib/arm-linux-gnueabihf/libcrypt.so.1 (0x76f65000)
        libssl.so.1.1 => /opt/ssldevel/lib/libssl.so.1.1 (0x76efe000)
        libcrypto.so.1.1 => /opt/ssldevel/lib/libcrypto.so.1.1 (0x76d17000)
        libz.so.1 => /usr/local/lib/libz.so.1 (0x76cf6000)
        libperl.so.5.14 => /usr/lib/libperl.so.5.14 (0x76ba5000)
        libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0x76b34000)
        libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0x76a00000)
        /lib/ld-linux-armhf.so.3 (0x54aee000)
        libgcc_s.so.1 => /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0x769d8000)


I hope that it's OK also in your point of view (without introducing other
issues).
Thanks.


Fabio




>
> I use to patch the file "auto/lib/openssl/conf"
> I picked up a section/platform I never will build for and modifiy
> "ngx_feature", "ngx_feature_path" and "ngx_feature_libs"
>
>
>
> Description: find my openssl libraries with nodefault names
> Author: A. Schulze
> ---
> This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
> Index: nginx-1.13.3/auto/lib/openssl/conf
> ===================================================================
> --- nginx-1.13.3.orig/auto/lib/openssl/conf
> +++ nginx-1.13.3/auto/lib/openssl/conf
> @@ -97,15 +97,15 @@ else
>
>          if [ $ngx_found = no ]; then
>
> -            # MacPorts
> +            # my-openssl
>
> -            ngx_feature="OpenSSL library in /opt/local/"
> -            ngx_feature_path="/opt/local/include"
> +            ngx_feature="my-openssl library in /usr/lib/"
> +            ngx_feature_path="/usr/include"
>
>              if [ $NGX_RPATH = YES ]; then
> -                ngx_feature_libs="-R/opt/local/lib -L/opt/local/lib
> -lssl -lcrypto $NGX_LIBDL"
> +                ngx_feature_libs="-R/usr/lib -L/usr/lib -lssl-my
> -lcrypto-my $NGX_LIBDL"
>              else
> -                ngx_feature_libs="-L/opt/local/lib -lssl -lcrypto
> $NGX_LIBDL"
> +                ngx_feature_libs="-L/usr/lib -lssl-my -lcrypto-my
> $NGX_LIBDL"
>              fi
>
>              . auto/feature
>
>
> Andreas
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20170712/35dc6372/attachment.html>


More information about the nginx mailing list