View current nginx version
You can view the current version by running the nginx-V command.
[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 nginx 1.44 version. Decompress the package and enter the directory.
Use the same configure as above for configuration
#./Configure -- prefix =/nginx_instal
# Make
2. Back up the old nginx file. You only need to back up the nginx file here.
[Root @ localhost sbin] # mv./nginx./nginx. old
3. Copy the new nginx file to the nginx Directory. You only need to replace the nginx file under the sbin directory.
[Root @ localhost nginx-1.4.4] # cp nginx/nginx_instal/sbin
4. Perform upgrade
Directly call the nginx command make upgrade for upgrade. The upgrade code 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 no error message is displayed, the upgrade is complete.
Run the/nginx-V command again to view the 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