国产xxxx99真实实拍_久久不雅视频_高清韩国a级特黄毛片_嗯老师别我我受不了了小说

資訊專欄INFORMATION COLUMN

Failed to Stop or Restart Nginx Server Through Ser

不知名網友 / 2060人閱讀

Many people are accustomed to start a Nginx web server through init scripts and then they can control the state of the server through service command, such as sudo service nginx restart. But sometimes unobvious config error makes the scripts failed to work. Here I will show an error related to pid directive in the config file of nginx, which defaultly located at /opt/nginx/conf/nginx.conf.

As ignored by many people, some init scripts assump there is a pid file of nginx located at /var/run/nginx.pid, but in the fact, the default pid file for nginx is /opt/nginx/logs/nginx.pid. Because the scripts can"t get the correct pid or even get nothing, they failed to stop the nginx process, some tasks dependent on it will be failed too, for example, you are not able to restart the server.

To resolve this problem, you need to:

Force terminating your server through:

$ sudo service nginx destroy

Open your nginx config file to edit:

$ sudo vim /opt/nginx/conf/nginx.conf

Specify the path of your pid file:

# /opt/nginx/conf/nginx.conf
pid /var/run/nginx.pid

After saving your change, start your server now:

$ sudo service nginx start

To confirm that your pid config has taken effect, you can cat your pid file and/or try to restart your server through service command:

$ cat /var/run/nginx.pid
$ sudo service nginx restart

As expected, you will see the screen out "OK" for your operations.

文章版權歸作者所有,未經允許請勿轉載,若此文章存在違規行為,您可以聯系管理員刪除。

轉載請注明本文地址:http://specialneedsforspecialkids.com/yun/39084.html

相關文章

  • "/alidata/server/nginx/logs/nginx.pid" f

    摘要:基于阿里云,版本是先廢話下進程分為進程和進程,開始運行后我們可以通過查看他的的在之后會把它的進程寫到文件中。之后就會把此掉,隨之這個文件也會被刪除。此時你文件得到的一串數字和上述中的數據是一致的。 基于阿里云,版本是 CentOS release 5.8 (Final) 先廢話下,Nginx進程分為master進程和worker進程,nginx開始運行后我們可以通過 ps aux|ge...

    QiuyueZhong 評論0 收藏0
  • nginx 負載均衡搭建

    摘要:客戶請求頭緩沖大小默認會用這個來讀取值,如果設定通過上傳文件的大小磁盤和之間互相拷貝數據或任意兩個文件描述符。 環境說明 192.168.1.208 Nginx負載服務器 192.168.1.210 webA服務器 PHP memcache xcache mysql 192.168.1.211 webB服務器 PHP memcache xcache webA/webB...

    endiat 評論0 收藏0
  • nginx 負載均衡搭建

    摘要:客戶請求頭緩沖大小默認會用這個來讀取值,如果設定通過上傳文件的大小磁盤和之間互相拷貝數據或任意兩個文件描述符。 環境說明 192.168.1.208 Nginx負載服務器 192.168.1.210 webA服務器 PHP memcache xcache mysql 192.168.1.211 webB服務器 PHP memcache xcache webA/webB...

    leo108 評論0 收藏0

發表評論

0條評論

不知名網友

|高級講師

TA的文章

閱讀更多
最新活動
閱讀需要支付1元查看
<