设置nginx开机启动
制作nginx开机启动脚本: vi /etc/init.d/nginx -------------------------------以下是脚本内容-------------------------------------- #! /bin/sh # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: starts the nginx web server PATH=$PATH:/usr/local/nginx DESC="nginx daemon" NAME=nginx DAEMON=/usr/local/nginx/sbin/$NAME //根据安装目录自行调整 CONFIGFILE=/usr/local/nginx/conf/$NAME.conf //根据安装目录自行调整 PIDFILE=/usr/local/nginx/logs/$NAME.pid //根据安装目录自行调整 SCRIPTNAME=/etc/init.d/$NAME set -e [ -x "$DAEMON" ] || exit 0 do_start() { $DAEMON -c $CONFIGFILE || echo -n "nginx already running" } do_stop() { kill -INT `cat