In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)05/31 Report--
Most people do not understand the knowledge points of this article "nginx smooth restart and upgrade", so the editor summarizes the following contents, detailed content, clear steps, and has a certain reference value. I hope you can get something after reading this article. Let's take a look at this "nginx smooth restart and upgrade how to achieve" article.
If you change the nginx configuration file (nginx.conf) and want to restart nginx, you can also do so by sending a system signal to the nginx main process. However, before restarting, make sure that the syntax of the nginx configuration file (nginx.conf) is correct, otherwise nginx will not load the new configuration file. You can determine whether the nginx configuration file is correct by using the following command:
/ usr/local/webserver/nginx/sbin/nginx-t-c
/ usr/local/webserver/nginx/conf/nginx.conf
If the configuration file is incorrect, the screen will prompt for an error on which line of the configuration file:
[emerg]: unknowndirective "abc" inlusrllocauwebserverlnginxjconflnginx.conf:55
Configurationfile/usr/local/webserver/nginx/conf/ nginx conf test failed
If the configuration file is correct, the screen prompts you with the following two lines of information:
The configuration file/usr/loca/webserver/nginx/conf/nginx.conf syntax is ok
Configuration file/usr/local/webserver/nginx/conf/nginx.conf test is successful
At this point, you can restart nginx smoothly.
The copy code is as follows:
/ usr/local/www/nginx/sbin/nginx-xs reloadx
Or:
The copy code is as follows:
Killx-hup `cat / usr/local/www/nginx/logs/ nginx.pidx`
Here are some additions:
Smoothly restart kill-hup `cat / usr/local/www/nginx/logs/ nginx.pid`
Smooth upgrade nginx
Cd / yujialin
Wget http://nginx.org/download/nginx-1.0.6.tar.gz
Tar zxvf nginx-1.0.6.tar.gz
Cd nginx-1.0.6
/ usr/local/www/nginx/sbin/nginx-v
Nginx: nginx version: nginx/1.0.4
Nginx: built by gcc 4.1.2 20080704 (red hat 4.1.2-50)
Nginx: configure arguments:-prefix=/usr/local/www/nginx-- with-pcre=/yujialin/pcre-8.12-- with-http_stub_status_module-- with-http_gzip_static_module
This step is to get the compilation parameters
. / configure-prefix=/usr/local/www/nginx-with-pcre=/yujialin/pcre-8.12-with-http_stub_status_module-with-http_gzip_static_module
Compile with the above paragraph
Then make, please don't make install.
After make, there is an extra nginx in the objs directory. This is the new version of the program.
Mv / usr/local/www/nginx/sbin/nginx / usr/local/www/nginx/sbin/nginx-20110906
Cp objs/nginx / usr/local/www/nginx/sbin/nginx
/ usr/local/www/nginx/sbin/nginx-t
Nginx: the configuration file / usr/local/nginx/conf/nginx.conf syntax is ok
Nginx: configuration file / usr/local/nginx/conf/nginx.conf test is successfu
Make upgrade performs upgrad
After execution / usr/local/nginx/sbin/nginx-v
Nginx: nginx version: nginx/1.0.6
Nginx: built by gcc 4.1.2 20080704 (red hat 4.1.2-50)
Nginx: configure arguments:-prefix=/usr/local/www/nginx-- with-pcre=/yujialin/pcre-8.12-- with-http_stub_status_module-- with-http_gzip_static_module
The above is about the content of this article on "how to achieve smooth restart and upgrade of nginx". I believe we all have a certain understanding. I hope the content shared by the editor will be helpful to you. If you want to know more about the relevant knowledge, please follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.