Nginx 开机启动
本文摘自: http://www.01happy.com/centos-nginx-shell-chkconfig/ 在安装完nginx后,重新启动需要“kill -HUP nginx进程编号”来进行重新加载,显然十分不方便。如果能像apache一样,直接通过脚本进行管理就方便多了。 nginx官方早就想好了,也提供了这个脚本,地址:http://wiki.nginx.org/RedHatNginxInitScript。这里将管理脚本收录在这里: 启动脚本有坑,nginx reload 和stop的时候是直接用killproc 干掉进程的,应该用nginx -s reload 和nginx -s stop 完整脚本如下 #!/bin/sh # # nginx - this script starts and stops the nginx daemin # # chkconfig: - 85 15 # description: Nginx is an HTTP(S) server, HTTP(S) reverse \ # proxy and IMAP/POP3 proxy server # processname: nginx # config: /www/wdlinux/nginx/conf/nginx.conf # pidfile: /www/wdlinux/nginx