在nginx编译安装完成后,nginx需要用www用户运行,且设置开启自启动,切换root用户,添加脚本如下:

#!/bin/sh

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

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 $PIDFILE` || echo -n "nginx not running"
 }

do_reload() {
 kill -HUP `cat $PIDFILE` || echo -n "nginx can't reload"
 }

case "$1" in
 start)
 echo -n "Starting $DESC: $NAME"
 do_start
 echo "."
 ;;
 stop)
 echo -n "Stopping $DESC: $NAME"
 do_stop
 echo "."
 ;;
 reload|graceful)
 echo -n "Reloading $DESC configuration..."
 do_reload
 echo "."
 ;;
 restart)
 echo -n "Restarting $DESC: $NAME"
 do_stop
 do_start
 echo "."
 ;;
 *)
 echo "Usage: $SCRIPTNAME {start|stop|reload|restart}" >&2
 exit 3
 ;;
 esac

exit 0

5 条评论

wagiplus · 2026-08-24 02:44

Wagiplus, right? I’ve been seeing this name pop up a lot lately. Might be worth a look. Who’s with me? Find out more at wagiplus.

850betvip · 2026-08-24 02:44

850betvip – Ok, so 850betvip, huh? I saw my friend playing and thought I could try as well. The VIP scheme seemed like a good deal, so I tried it out myself! I’m really into it now. You can find it here 850betvip

bwenas · 2026-08-24 02:45

Bwenas! Short and sweet. Let’s hope the winnings are just as quick and easy. I’m feelin’ lucky tonight. Give it a spin with Bwenas: bwenas

lovejili · 2026-08-30 16:27

[4050]lovejili Official Login | Best Online Slots with GCash Bonus,lovejili offers an easy app download for the best slots in the PH. Get your GCash casino bonus and learn how to play baccarat today. Join the action now! visit: lovejili

bilivideos.cc · 2026-09-16 00:17

Hi therfe it’s me, I aam als visiting tis webb sie onn a regular basis, thks webb siite iis reallly good annd the pdople
arre really sharting fastisious thoughts. xnxx

发表回复

Avatar placeholder

您的邮箱地址不会被公开。 必填项已用 * 标注