nginx -V 可以查看原来编译时都带了哪些参数
#################################### 安装 nginx-upstream-fair ############################
原来的参数:
--prefix=/mnt/nginx
要添加的参数 [有就不用添加了]
--with-http_stub_status_module --with-http_ssl_module --with-http_realip_module --add-module=/mnt/gnosek-nginx-upstream-fair-a18b409
再编译 [要把之前编译的参数加上]
./configure --prefix=/usr/local/nginx --user=www --group=www --with-http_stub_status_module --with-http_v2_module --with-http_ssl_module --with-http_gzip_static_module --with-http_realip_module --with-http_flv_module --with-http_mp4_module --with-openssl=/root/oneinstack/src/openssl-1.0.2j --with-pcre=/root/oneinstack/src/pcre-8.39 --with-pcre-jit --with-ld-opt=-ljemalloc --add-module=/mnt/gnosek-nginx-upstream-fair-a18b409
编译 [不要make install,否则就是覆盖安装]
make
停掉Nginx
service nginx stop
备份 nginx 文件
cp /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.bak
替换nginx二进制文件
cp /mnt/nginx-1.10.2/objs/nginx /usr/local/nginx/sbin/
如果提示:cp: overwrite ‘/usr/local/nginx/sbin/nginx’? 输入yes 或确认
重新启动 Nginx
service nginx restart
Nginx添加模块(非覆盖安装)
最新推荐文章于 2025-03-17 14:00:03 发布