2017-04-09 29 views
1

http2にALPNを使用するようにnginxを設定しようとしています。私はこれを行うためにopensslを更新する必要があります。ソースからNginxとOpenSSLを構築する

現時点では、スタンドアロンのopensslが更新されていますが、何らかの理由でnginxがそれを使用していません。

# /etc/nginx $ nginx -V 

nginx version: nginx/1.10.3 
built with OpenSSL 1.0.1f 6 Jan 2014 
TLS SNI support enabled 
configure arguments: --with-cc-opt='-g -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -fPIC -D_FORTIFY_SOURCE=2' --with-ld-opt='-Wl,-Bsymbolic-functions -fPIE -pie -Wl,-z,relro -Wl,-z,now -fPIC' --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --lock-path=/var/lock/nginx.lock --pid-path=/run/nginx.pid --modules-path=/usr/lib/nginx/modules --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --with-debug --with-pcre-jit --with-ipv6 --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_auth_request_module --with-http_v2_module --with-http_dav_module --with-http_slice_module --with-threads --with-http_addition_module --with-http_geoip_module=dynamic --with-http_gunzip_module --with-http_gzip_static_module --with-http_image_filter_module=dynamic --with-http_sub_module --with-http_xslt_module=dynamic --with-stream=dynamic --with-stream_ssl_module --with-mail=dynamic --with-mail_ssl_module --add-dynamic-module=/build/nginx-wa6Kgn/nginx-1.10.3/debian/modules/nginx-auth-pam --add-dynamic-module=/build/nginx-wa6Kgn/nginx-1.10.3/debian/modules/nginx-dav-ext-module --add-dynamic-module=/build/nginx-wa6Kgn/nginx-1.10.3/debian/modules/nginx-echo --add-dynamic-module=/build/nginx-wa6Kgn/nginx-1.10.3/debian/modules/nginx-upstream-fair --add-dynamic-module=/build/nginx-wa6Kgn/nginx-1.10.3/debian/modules/ngx_http_substitutions_filter_module 

# /etc/nginx $ openssl version -a 

OpenSSL 1.1.1-dev xx XXX xxxx 
built on: reproducible build, date unspecified 
platform: linux-x86_64 
compiler: gcc -DDSO_DLFCN -DHAVE_DLFCN_H -DNDEBUG -DOPENSSL_THREADS -DOPENSSL_NO_STATIC_ENGINE -DOPENSSL_PIC -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DRC4_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DGHASH_ASM -DECP_NISTZ256_ASM -DPADLOCK_ASM -DPOLY1305_ASM -DOPENSSLDIR="\"/usr/local/lib/\"" -DENGINESDIR="\"/usr/local/lib/engines-1.1\"" -Wa,--noexecstack 
OPENSSLDIR: "/usr/local/lib/" 
ENGINESDIR: "/usr/local/lib/engines-1.1" 

自然のアイデア:設定、nginxのを再構築し、エラーなしで実行を行いますが、nginxのはそれをバージョンを変更しないように。

./configure --with-http_ssl_module --with-openssl=~/openssl/ --with-http_v2_module 
make 

https://gist.github.com/SilentImp/be9c088298a94e0dba6cbaf3c51b9ad0

何もうまくいかないかもしれない何

~/nginx-1.11.13 $ nginx -V 
nginx version: nginx/1.10.3 
built with OpenSSL 1.0.1f 6 Jan 2014 
TLS SNI support enabled 
configure arguments: --with-cc-opt='-g -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -fPIC -D_FORTIFY_SOURCE=2' --with-ld-opt='-Wl,-Bsymbolic-functions -fPIE -pie -Wl,-z,relro -Wl,-z,now -fPIC' --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --lock-path=/var/lock/nginx.lock --pid-path=/run/nginx.pid --modules-path=/usr/lib/nginx/modules --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --with-debug --with-pcre-jit --with-ipv6 --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_auth_request_module --with-http_v2_module --with-http_dav_module --with-http_slice_module --with-threads --with-http_addition_module --with-http_geoip_module=dynamic --with-http_gunzip_module --with-http_gzip_static_module --with-http_image_filter_module=dynamic --with-http_sub_module --with-http_xslt_module=dynamic --with-stream=dynamic --with-stream_ssl_module --with-mail=dynamic --with-mail_ssl_module --add-dynamic-module=/build/nginx-wa6Kgn/nginx-1.10.3/debian/modules/nginx-auth-pam --add-dynamic-module=/build/nginx-wa6Kgn/nginx-1.10.3/debian/modules/nginx-dav-ext-module --add-dynamic-module=/build/nginx-wa6Kgn/nginx-1.10.3/debian/modules/nginx-echo --add-dynamic-module=/build/nginx-wa6Kgn/nginx-1.10.3/debian/modules/nginx-upstream-fair --add-dynamic-module=/build/nginx-wa6Kgn/nginx-1.10.3/debian/modules/ngx_http_substitutions_filter_module 

を変更していますか? nginxを再構築せずにnginx opensslのバージョンを変更する方法はありますか?

+0

あなたはOpenSSLのコピーを使用するようNginxに指示しませんでした。 RPATHを追加していないので、LinuxのバージョンのDLL Hellを避けてください。 OpenSSL wikiの[コンパイルとインストール](https://wiki.openssl.org/index.php/Compilation_and_Installation)も参照してください。 – jww

答えて

0

nginx使用バイナリ、ビルドバイナリと、使用opensslソースのあるディレクトリのパスを二重にチェックする必要があり、必ず

をnginxのためにパスをチェック
$ /usr/local/nginx/sbin/nginx -V 
nginx version: nginx/1.11.13 
built by gcc 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.3) 
built with OpenSSL 1.1.1-dev xx XXX xxxx 
TLS SNI support enabled 
configure arguments: --with-http_ssl_module --with-openssl=~/openssl/ --with-http_v2_module 

$ which nginx 
/usr/sbin/nginx 
関連する問題