| 注册
请输入搜索内容

热门搜索

Java Linux MySQL PHP JavaScript Hibernate jQuery Nginx
cme7
10年前发布

Nginx 启动、停止、重启的脚本

#!/bin/sh  # chkconfig: 345 86 14  # description: 启动,重启,停止nginx的shell脚本  NGINX_DIR=/opt/ngx  export NGINX_DIR    case $1 in  'start' )  echo "Starting nginx..."  $NGINX_DIR/sbin/nginx  ;;  'reload' )  echo "Reload nginx configuration..."  kill -HUP `cat $NGINX_DIR/logs/nginx.pid`  ;;  'stop' )  echo "Stopping nginx..."  kill -15 `cat $NGINX_DIR/logs/nginx.pid`  ;;  'list' )  ps aux | egrep '(PID|nginx)'  ;;  'testconfig' )  $NGINX_DIR/sbin/nginx -t  ;;  *)  echo "usage: `basename $0` {start|reload|stop|list|testconfig}"  esac