码迷,mamicode.com
首页 > 其他好文 > 详细

升级nginx,查看已经安装的模块,并隐藏或者修改版本号

时间:2014-12-26 06:22:11      阅读:244      评论:0      收藏:0      [点我收藏+]

标签:nginx 模块 编译 重新安装 修改server头 修改版本

升级前,查看已经安装的版本以及模块


[root@mail ~]# /opt/nginx/sbin/nginx -Vnginx version: nginx/0.5.34
built by gcc 3.4.6 20060404 (Red Hat 3.4.6-3)configure arguments: --prefix=/opt/nginx --sbin-path=/opt/nginx/sbin/nginx --conf-path=/opt/nginx/conf/nginx.conf --pid-path=/var/run/nginx/nginx.pid 
--error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --http-proxy-temp-path=/opt/nginx/temp/proxy 
--http-fastcgi-temp-path=/opt/nginx/temp/fcgi --lock-path=/var/run/nginx/nginx.lock --with-http_ssl_module --with-http_sub_module 
--with-http_stub_status_module --with-debug


修改版本号:

[root@ns ~/nginx-1.7.8]#vim src/core/nginx.h
#define nginx_version      1007008
#define NGINX_VERSION      "1.7.8"
#define NGINX_VER          "nginx/" NGINX_VERSION

修改为
#define nginx_version      1007008
#define NGINX_VERSION      "1.7.8"
#define NGINX_VER          "Power_nginx"

然后重新编译:

./configure --prefix=/opt/nginx \--sbin-path=/opt/nginx/sbin/nginx \--conf-path=/opt/nginx/conf/nginx.conf \--pid-path=/var/run/nginx/nginx.pid \--error-log-path=/var/log/nginx/error.log \--http-log-path=/var/log/nginx/access.log \--http-proxy-temp-path=/opt/nginx/temp/proxy \--http-fastcgi-temp-path=/opt/nginx/temp/fcgi \--lock-path=/var/run/nginx/nginx.lock --with-http_ssl_module --with-http_sub_module --with-http_gzip_static_module --with-http_stub_status_module --with-http_flv_module \--with-debug
make  &&  make install


然后重新启动nginx

service nginx restart

再查看版本及模块信息

技术分享


完成了。






本文出自 “Professor哥” 博客,请务必保留此出处http://professor.blog.51cto.com/996189/1596058

升级nginx,查看已经安装的模块,并隐藏或者修改版本号

标签:nginx 模块 编译 重新安装 修改server头 修改版本

原文地址:http://professor.blog.51cto.com/996189/1596058

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!