Nginx和PHP-FPM的啟動(dòng)/重啟腳本
服務(wù)器上的Nginx和PHP都是源碼編譯安裝的,不支持類似以前的nginx (start|restart|stop|reload)了。自己動(dòng)手豐衣足食。以下腳本應(yīng)該在RHEL, Fedora, CentOS下都適用。
一、Nginx啟動(dòng)腳本/etc/init.d/nginx
#!/bin/bash
#
# Startup script for Nginx - this script starts and stops the nginx daemon
#
# chkconfig:
# description:
# processname: nginx
# config:
# pidfile:
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
# Check that networking is up.
[ "$NETWORKING" = "no" ] && exit 0
nginx="/usr/local/nginx/sbin/nginx"
prog=$(basename $nginx)
NGINX_CONF_FILE="/usr/local/nginx/conf/nginx.conf"
[ -f /etc/sysconfig/nginx ] && . /etc/sysconfig/nginx
lockfile=/var/lock/subsys/nginx
start() {
}
stop() {
}
restart() {
}
reload() {
}
force_reload() {
}
configtest() {
}
rh_status() {
}
rh_status_q() {
}
case "$1" in
esac
#==============================================================
編輯好后保存,執(zhí)行以下命令
sudo chmod +x /etc/init.d/nginx
關(guān)鍵詞:Nginx,PHP-FPM
閱讀本文后您有什么感想? 已有
0
人給出評(píng)價(jià)!
- 0
- 0
- 0
- 0
- 0
- 0