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
Learning CSS3 is more about getting familiar with...
Previously, my boss asked me to make a program th...
<br />What is web2.0? Web2.0 includes those ...
background Since I converted all my tasks to Dock...
Table of contents 1. Constructors and prototypes ...
Use examples to familiarize yourself with the mean...
I had been working on the project before the New ...
Compared with vue2, vue3 has an additional concep...
The solution to the problem that the PHP7.3 versi...
During the front-end development process, a situat...
How to write join If you use left join, is the ta...
Project scenario: When running the Vue project, t...
Table of contents Overview Single file components...
Table of contents 1. Scope 1. Global scope 2. Loc...
This article shares the specific code of canvas t...