版本說明:
NGINX 版本1.12.0
pcre-8.40
zlib-1.2.11
openssl-1.1.0i
安裝過程
#
./configure --prefix=/usr/ngnix --with-http_stub_status_module --with-pcre=/opt/ngnix/pcre-8.40 --with-zlib=/opt/ngnix/zlib-1.2.11 --with-stream
make && make install
注:1、增加--with-openssl=/opt/ngnix/openssl-1.1.1
報錯:(未解決)
objs/ngx_modules.o \
-ldl -lpthread -lcrypt /opt/ngnix/pcre-8.40/.libs/libpcre.a /opt/ngnix/openssl-1.1.1/.openssl/lib/libssl.a /opt/ngnix/openssl-1.1.1/.openssl/lib/libcrypto.a -ldl /opt/ngnix/zlib-1.2.11/libz.a \
-Wl,-E
/opt/ngnix/openssl-1.1.1/.openssl/lib/libcrypto.a(threads_pthread.o): In function `fork_once_func':
threads_pthread.c:(.text+0x16): undefined reference to `pthread_atfork'
collect2: error: ld returned 1 exit status
make[1]: *** [objs/nginx] Error 1
make[1]: Leaving directory `/opt/ngnix/nginx-1.12.0'
make: *** [build] Error 2
解決:由於openssl 版本問題,換用openssl-1.1.0i 正常。
./configure --prefix=/usr/ngnix --with-http_stub_status_module --with-pcre=/opt/ngnix/pcre-8.40 --with-zlib=/opt/ngnix/zlib-1.2.11 --with-stream --with-http_ssl_module --with-openssl=/opt/ngnix/openssl-1.1.0i