Nginx怎么重新编译添加模块
时间:2023-05-24 13:20
1、找到安装nginx的源码根目录(即安装包存放目录),如果没有的话下载新的源码并解压 2、查看nginx版本极其编译参数 3、进入nginx源码目录 4、重新编译的代码和模块 5、执行 make (注意:千万别 make install ,否则就覆盖安装了), make完之后在/software/nginx-1.10.2/objs目录下就多了个nginx,这个就是新版本的程序了。 6、备份旧的nginx程序 7、把新的nginx程序复制到/usr/local/nginx/sbin/下 8、测试新的nginx程序是否正确 9、平滑启动服务 查看模块是否已安装 重启nginx nginx重新加载模块完成! 以上就是Nginx怎么重新编译添加模块的详细内容,更多请关注Gxl网其它相关文章!cd softwarelsnginx-1.10.2 nginx-1.10.2.tar.gz
/usr/local/nginx/sbin/nginx -v
cd nginx-1.10.2
./configure --prefix=/usr/local/nginx --with-http_ssl_module
cd /usr/local/nginx/sbin/mv nginx nginx_bak
cp /software/nginx-1.10.2/objs/nginx /usr/local/nginx/sbin/
/usr/local/nginx/sbin/nginx -tnginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is oknginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
/usr/local/nginx/sbin/nginx -s reload
/usr/local/nginx/sbin/nginx -vnginx version: nginx/1.10.2built by gcc 4.8.5 20150623 (red hat 4.8.5-4) (gcc)built with openssl 1.0.1e-fips 11 feb 2013tls sni support enabledconfigure arguments: --prefix=/usr/local/nginx --with-http_ssl_module
./nginx -s quit./nginx