nginx升级
新版本源码目录
./configure
--user=nginx \
--group=nginx \
--prefix=/usr/local/nginx \
--with-http_ssl_module \
--with-openssl=/usr/local/openssl-1.1.1o \
--pid-path=/var/run/nginx.pid
make
mv /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/`date +%F`-nginx.bak
cp nginx-xxx/objs/nginx /usr/local/nginx/sbin/
make upgrade
指定新的openssl路径时,编译时需修改
打开nginx源文件下的 nginx-1.9.9/auto/lib/openssl/conf文件:
找到这么一段代码:
CORE_INCS="$CORE_INCS $OPENSSL/.openssl/include"
CORE_DEPS="$CORE_DEPS $OPENSSL/.openssl/include/openssl/ssl.h"
CORE_LIBS="$CORE_LIBS $OPENSSL/.openssl/lib/libssl.a"
CORE_LIBS="$CORE_LIBS $OPENSSL/.openssl/lib/libcrypto.a"
CORE_LIBS="$CORE_LIBS $NGX_LIBDL"
修改成以下代码:
CORE_INCS="$CORE_INCS $OPENSSL/include"
CORE_DEPS="$CORE_DEPS $OPENSSL/include/openssl/ssl.h"
CORE_LIBS="$CORE_LIBS $OPENSSL/lib/libssl.a"
CORE_LIBS="$CORE_LIBS $OPENSSL/lib/libcrypto.a"
CORE_LIBS="$CORE_LIBS $NGX_LIBDL"
FAQ
启动报错 nginx: [emerg] getpwnam("nginx") failed
原因是,在./configure时指定了 --user=nginx --group=nginx
解决方法 useradd -s /sbin/nologin -M nginx
标签:CORE,--,OPENSSL,openssl,升级,nginx,LIBS
From: https://www.cnblogs.com/lixunblogs/p/18167418