Check the current version of nginx
You can check the current version through the nginx -V command, and some nginx commands when installing the current version
[root@localhost sbin]# ./nginx -V
nginx version: nginx/1.2.9
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC)
configure arguments: --prefix=/nginx_instal
1. Download the new version of nginx 1.44, unzip it, enter the directory
Use Configure with the same configure
#./configure --prefix=/nginx_instal
#make
2. Back up the old nginx file. Here you only need to back up the nginx file
[root@localhost sbin]# mv ./nginx ./nginx.old
3. Copy the new nginx to the nginx directory, just replace the nginx file in the sbin directory
[root@localhost nginx-1.4.4]# cp nginx /nginx_instal/sbin
4. Perform the upgrade
Directly call the nginx command make upgrade to upgrade. The specific code for the upgrade is as follows:
[root@localhost nginx-1.4.4]# make upgrade
/nginx_instal/sbin/nginx -t
nginx: the configuration file /nginx_instal/conf/nginx.conf syntax is ok
nginx: configuration file /nginx_instal/conf/nginx.conf test is successful
kill -USR2 `cat /nginx_instal/logs/nginx.pid`
sleep 1
test - f /nginx_instal/logs/nginx.pid.oldbin
kill -QUIT `cat /nginx_instal/logs/nginx.pid.oldbin`
5, if there is no error message, the upgrade is complete
Use the /nginx -V command to view it again Current version
[root@localhost sbin]# ./nginx -V
nginx version: nginx/1.4.4
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC)
configure arguments: - -prefix=/nginx_instal
Original address: http://www.itmmd.com/201410/71.html
This article is compiled and published by android development. Reprints must indicate the source.
The above introduces the nginx upgrade guide, the most detailed nginx upgrade steps, including all aspects. I hope it will be helpful to friends who are interested in PHP tutorials.