First Download Nginx: execute wget http://soft.vpser.net/web/nginx/nginx-0.7.65.tar.gz
Run again./configure -- user = www -- group = www -- prefix =/usr/local/nginx -- with-http_stub_status_module -- with-http_ssl_module -- with-http_gzip_static_module.
Then make, but do not make install
After compilation, there is an nginx execution file under the objs directory.
Back up old nginx files
Mv/usr/local/nginx/sbin/nginx. old
Run cp objs/nginx/usr/local/nginx/sbin/nginx after converting nginx cp under the new objs to sbin.
Run the/usr/local/nginx/sbin/nginx-t test to check whether there is any problem.
Run make upgrade again.
Run:/usr/local/nginx/sbin/nginx-V to display the nginx version and compiled parameters.
The above is a copy of others' upgrade methods. I will share my operation process with you.
The procedure is as follows:
1. Check the current version and download the latest stable nginx version:
The code is as follows: |
Copy code |
[Root @ localhost ~] # Nginx-v Nginx: nginx version: nginx/1.0.11 |
2. Decompress and compile after the download is completed:
Compiling Environment:
The code is as follows: |
Copy code |
Yum install gcc openssl-devel pcre-devel zlib-devel |
Back up the original nginx website:
The code is as follows: |
Copy code |
Cp/usr/share/nginx/www/bakcup/nginx-r |
That is, you can specify the backup directory.
The code is as follows: |
Copy code |
Tar zxvf nginx-1.0.12.tar.gz Cd nginx-1.0.12 . /Configure -- prefix =/usr/share -- sbin-path =/usr/sbin/nginx -- conf-path =/etc/nginx. conf -- error-log-path =/var/log/nginx/error. log -- pid-path =/var/run/nginx. pid -- lock-path =/var/lock/nginx. lock -- user = nginx -- group = nginx -- with-http_ssl_module -- with-http_flv_module -- with-http_gzip_static_module -- with-http_stub_status_module Make |
Never make install
3. After compilation, we start to upgrade.
The code is as follows: |
Copy code |
Mv/usr/sbin/nginx/usr/sbin/nginx0214 & amp; cp./objs/nginx/usr/sbin/nginx [Root @ localhost ~] # Nginx-V Nginx: nginx version: nginx/1.0.12 |
Reload nginx
The code is as follows: |
Copy code |
/Usr/sbin/nginx-s reload |
SUCCESS !!!