Upgrade Nginx, view the installed modules, and hide or modify the version number

Source: Internet
Author: User

Review the installed versions and modules before upgrading


[[email protected] ~]# /opt/nginx/sbin/nginx -vnginx version: nginx/0.5.34built  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 


To modify the version number:

[[email protected] ~/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 modified to #d Efine nginx_version 1007008#define nginx_version "1.7.8" #define Nginx_ver "Power_nginx"

And then recompile:

./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


Then restart the Nginx

Service Nginx Restart

View version and module information again

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/57/81/wKiom1Sb9Gyxn78HAAGpcMsdVa0164.jpg "title=" 1.png " alt= "Wkiom1sb9gyxn78haagpcmsdva0164.jpg"/>


It's done.






This article is from the "Professor" blog, please be sure to keep this source http://professor.blog.51cto.com/996189/1596058

Upgrade Nginx, view the installed modules, and hide or modify the version number

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.