首页 > 其他 > 详细

nginx开机启动

时间:2017-08-24 12:11:00      阅读:239      评论:0      收藏:0      [点我收藏+]
#! /bin/bash
# chkconfig: - 85 15

DAEMON=/usr/local/nginx/sbin/nginx
CONFIGFILE=/usr/local/nginx/conf/nginx.conf
PIDFILE=/usr/local/nginx/nginx.pid


do_start() {
$DAEMON -c $CONFIGFILE || echo -n "nginx already running"
}
do_stop() {
$DAEMON -s stop || echo -n "nginx not running"
}
do_reload() {
$DAEMON -s reload || echo -n "nginx can‘t reload"
}
case "$1" in
start)
echo -n "Starting  nginx"
do_start
echo "."
;;
stop)
echo -n "Stopping  nginx "
do_stop
echo "."
;;
reload)
echo -n "Reloading nginx"
do_reload
echo "."
;;
restart)
echo -n "Restarting nginx"
do_stop
do_start
echo "."
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|reload|restart}" >&2
exit 3
;;
esac
exit 0
chmod 755 /etc/init.d/nginx

chkconfig --add /etc/init.d/nginx

chkconfig nginx on

 

nginx开机启动

原文:http://www.cnblogs.com/feiyun126/p/7422134.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!