nginx启动脚本

nginx的启动脚本,nginx,nginx.conf, nginx.pid 请根据自己的路径进行修改,只需要修改这三个路径即可,放到/etc/init.d/目录下,增加执行权限chmod a+x /etc/init.d/nginx  开机自启动chkconfig –add nginx, chkconfig nginx on

#!/bin/bash
# chkconfig: – 30 21
# description: http service.
# Source Function Library
. /etc/init.d/functions
# Nginx Settings
NGINX_SBIN=”/usr/local/nginx/sbin/nginx”
NGINX_CONF=”/usr/local/nginx/conf/nginx.conf”
NGINX_PID=”/var/run/nginx/nginx.pid” 继续阅读“nginx启动脚本”