nginx的啟動指令碼

2021-04-15 05:41:08 字數 1711 閱讀 1117

nginx_path="/usr/local/nginx"

nginx_pid="/usr/local/nginx/var/nginx.pid"

fcgi_pid="/usr/local/nginx/var/fcgi.pid"

spawn_fcgi="/usr/local/php/bin/spawn-fcgi"

php_cgi="/usr/local/php/bin/php-cgi"

fcgi_user="www"

# source function library.

. /etc/rc.d/init.d/functions

# source networking configuration.

. /etc/sysconfig/network

# check that networking is up.

[ $ = "no" ] && exit 0

[ -x $nginx_path/sbin/nginx ] || exit 0

retval=0

prog="nginx"

start()

else

retval=1

fireturn $retval}

# stop daemons.

stop()

[ -f $nginx_pid ] &&

sleep 1

retval=$?

[ $retval = 0 ] && rm -f $nginx_pid /var/lock/subsys/$prog

return $retval

}reset()

retval=$?

return $retval }

case "$1" in

start)

start

retval=$?

if [ $retval = 0 ];then

echo [  ok  ]

else

echo [  failed  ]

fi;;

stop)

stop

retval=$?

if [ $retval = 0 ];then

echo [  ok  ]

else

echo [  failed  ]

fi;;

restart)

stop

retval=$?

if [ $retval = 0 ];then

echo [  ok  ]

else

echo [  failed  ]

fistart

retval=$?

if [ $retval = 0 ];then

echo [  ok  ]

else

echo [  failed  ]

fi;;

reload)

reset

retval=$?

if [ $retval = 0 ];then

echo [  ok  ]

else

echo [  failed  ]

fi;;

status)

status $prog

retval=$?;;

*)echo $"usage: $0 "

exit 1

esac

exit $retval

Nginx啟動指令碼

nginx啟動指令碼 nginx engine x 是乙個高效能的http和反向 伺服器,也是乙個 imap pop3 smtp 伺服器。因穩定性 豐富的功能 低資源消耗而聞名。但nginx本身不自帶啟動指令碼,需要我們手動編寫乙份,現在網上所提供的大多數指令碼都是有針對行的,可移植性很差。大多數這...

Nginx啟動指令碼

nginx啟動指令碼 nginx engine x 是乙個高效能的http和反向 伺服器,也是乙個 imap pop3 smtp 伺服器。因穩定性 豐富的功能 低資源消耗而聞名。但nginx本身不自帶啟動指令碼,需要我們手動編寫乙份,現在網上所提供的大多數指令碼都是有針對行的,可移植性很差。大多數這...

nginx 啟動指令碼

相信好多小夥伴啟動nginx和重啟的時候都需要在命令列輸入命令,本著程式猿封裝思想 咱們可以寫好指令碼這樣就一勞永逸了。echo off cd d d nginx 1.5.1 這是nginx的安裝路徑 start nginx.exe exit echo off d cd d nginx 1.5.1 ...