Nginx和PHP-FPM的启动/重启脚本
服务器上的Nginx和PHP都是源码编译安装的,不支持类似以前的nginx (start|restart|stop|reload)了。自己动手丰衣足食。以下脚本应该在RHEL, Fedora, CentOS下都适用。
一、Nginx启动脚本/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
#==============================================================
编辑好后保存,执行以下命令
sudo chmod +x /etc/init.d/nginx
关键词:Nginx,PHP-FPM
阅读本文后您有什么感想? 已有 人给出评价!
- 0
- 0
- 0
- 0
- 0
- 0