成人国产在线小视频_日韩寡妇人妻调教在线播放_色成人www永久在线观看_2018国产精品久久_亚洲欧美高清在线30p_亚洲少妇综合一区_黄色在线播放国产_亚洲另类技巧小说校园_国产主播xx日韩_a级毛片在线免费

資訊專欄INFORMATION COLUMN

Failed to Stop or Restart Nginx Server Through Ser

不知名網(wǎng)友 / 2068人閱讀

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.

文章版權(quán)歸作者所有,未經(jīng)允許請(qǐng)勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。

轉(zhuǎn)載請(qǐng)注明本文地址:http://systransis.cn/yun/39084.html

相關(guān)文章

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

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

    QiuyueZhong 評(píng)論0 收藏0
  • nginx 負(fù)載均衡搭建

    摘要:客戶請(qǐng)求頭緩沖大小默認(rèn)會(huì)用這個(gè)來(lái)讀取值,如果設(shè)定通過(guò)上傳文件的大小磁盤(pán)和之間互相拷貝數(shù)據(jù)或任意兩個(gè)文件描述符。 環(huán)境說(shuō)明 192.168.1.208 Nginx負(fù)載服務(wù)器 192.168.1.210 webA服務(wù)器 PHP memcache xcache mysql 192.168.1.211 webB服務(wù)器 PHP memcache xcache webA/webB...

    endiat 評(píng)論0 收藏0
  • nginx 負(fù)載均衡搭建

    摘要:客戶請(qǐng)求頭緩沖大小默認(rèn)會(huì)用這個(gè)來(lái)讀取值,如果設(shè)定通過(guò)上傳文件的大小磁盤(pán)和之間互相拷貝數(shù)據(jù)或任意兩個(gè)文件描述符。 環(huán)境說(shuō)明 192.168.1.208 Nginx負(fù)載服務(wù)器 192.168.1.210 webA服務(wù)器 PHP memcache xcache mysql 192.168.1.211 webB服務(wù)器 PHP memcache xcache webA/webB...

    leo108 評(píng)論0 收藏0

發(fā)表評(píng)論

0條評(píng)論

最新活動(dòng)
閱讀需要支付1元查看
<