After nginx is compiled and installed and used for a period of time, if you find that the current version has vulnerabilities or needs new functions, you need to upgrade the current nginx version, but it should not affect normal use. Therefore, you need to smoothly upgrade nginx and update it to the latest version. This article demonstrates the process of upgrading nginx-1.13.6 to nginx-1.13.12, which is also applicable to other versions. 1. Download the new version of nginx Download page: http://nginx.org/en/download.html wget -c http://nginx.org/download/nginx-1.13.12.tar.gz 2. Get the configuration of the old version of nginx Check the current version: View the current configuration: [root@zixuephp nginx-1.13.6]# /usr/local/nginx/sbin/nginx -v nginx version: nginx/1.13.6 [root@zixuephp nginx-1.13.6]# /usr/local/nginx/sbin/nginx -V nginx version: nginx/1.13.6 built by gcc 4.8.5 20150623 (Red Hat 4.8.5-16) (GCC) built with OpenSSL 1.0.2k-fips 26 Jan 2017 TLS SNI support enabled configure arguments: --prefix=/usr/local/nginx --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_v2_module --with-http_gzip_static_module --with-http_sub_module --with-pcre --with-http_ssl_module 3. Unzip the new version of nginx source package tar -xzvf nginx-1.13.12.tar.gz cd nginx-1.13.12 4. Configuration before recompiling the new version The configuration here is the same as the old version: /usr/local/nginx/sbin/nginx -V Copy the code as follows: ./configure --prefix=/usr/local/nginx --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_v2_module --with-http_gzip_static_module --with-http_sub_module --with-pcre --with-http_ssl_module 5. Compile and generate the objs directory, enter the directory, and replace nginx make After compiling, you can see that there is an objs directory through ls [root@zixuephp nginx-1.13.12]# ls auto CHANGES CHANGES.ru conf configure contrib html LICENSE Makefile man objs README src [root@zixuephp nginx-1.13.12]# Enter the objs directory and replace the old version of the nginx main program (be sure to back up before operating here to avoid mistakes) [root@zixuephp objs]#mv nginx /usr/local/nginx/sbin/nginx 6. Smooth upgrade make upgrade 7. Upgrade successfully, check the version [root@zixuephp nginx-1.13.12]# /usr/local/nginx/sbin/nginx -v nginx version: nginx/1.13.12 [root@zixuephp nginx-1.13.12]# /usr/local/nginx/sbin/nginx -V nginx version: nginx/1.13.12 built by gcc 4.8.5 20150623 (Red Hat 4.8.5-16) (GCC) built with OpenSSL 1.0.2k-fips 26 Jan 2017 TLS SNI support enabled configure arguments: --prefix=/usr/local/nginx --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_v2_module --with-http_gzip_static_module --with-http_sub_module --with-pcre --with-http_ssl_module Before upgrading, be sure to back up the nginx program, website and other files in advance to avoid errors. The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: Solution to the problem "Table mysql.plugin doesn't exist" when deploying MySQL
>>: How to elegantly implement the mobile login and registration module in vue3
This article example shares the specific code of ...
By default, the width and height of the table are...
How to use if in Linux to determine whether a dir...
1. First install the pagoda Installation requirem...
introduction: Slider drag verification is now use...
Install mysql5.7.18 on CentOS6.7 1. Unzip to the ...
Table of contents Preface Why does limit deep pag...
Solution 1 Completely uninstall and delete all da...
background A new server was added in the company,...
This article example shares the specific code of ...
Definition and Usage The <input> tag is use...
1. golang:latest base image mkdir gotest touch ma...
Every time you log in to the test server, you alw...
1. Demand We have three tables. We need to classi...
In order to handle a large number of concurrent v...