升级nginx,查看已经安装的模块,并隐藏或者修改版本号
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了升级nginx,查看已经安装的模块,并隐藏或者修改版本号,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2507字,纯文字阅读大概需要4分钟。
内容图文
升级,查看已经安装的模块[root@mail ~]# /opt/nginx/sbin/nginx -V nginx 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@mail nginx-0.8.39]# vi src/core/nginx.h #define nginx_version 8039 #define NGINX_VERSION "0.8.39" #define NGINX_VER "nginx/" NGINX_VERSION 改成: #define nginx_version 8039 #define NGINX_VERSION "0.0.0" #define NGINX_VER "netbig/" NGINX_VERSION
然后重新编译:
## 增加http_gzip和http_flv模块 ./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
[root@mail nginx-0.8.39]# nginxctl stop Shutting down nginx: [root@mail vhosts]# nginxctl start Starting nginx: success nginx ## 注:这个nginxctl是自己写的脚本 [root@mail vhosts]# /opt/nginx/sbin/nginx -V nginx version: netbig/0.0.0 built by gcc 3.4.6 20060404 (Red Hat 3.4.6-3) TLS SNI support disabled 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_gzip_static_module --with-http_stub_status_module --with-http_flv_module --with-debug
查看 response header
[root@mail vhosts]# curl -I http://www.tech.zhangben.com HTTP/1.1 200 OK Server: netbig/0.0.0 Date: Tue, 01 Jun 2010 07:09:11 GMT Content-Type: text/html; charset=utf-8 Connection: keep-alive Vary: Cookie
内容总结
以上是互联网集市为您收集整理的升级nginx,查看已经安装的模块,并隐藏或者修改版本号全部内容,希望文章能够帮你解决升级nginx,查看已经安装的模块,并隐藏或者修改版本号所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。