标签:vim load() 服务启动 files googl || lis reload) var
一、 Apache服务配置7、#service httpd start/stop/restart
二、 Mysql服务配置
1、 首先复制安装好的support-files/mysql.server文件到/etc/init.d/mysqld目录下
2、 #chmod a+x /etc/init.d/mysqld
3、 #chkconfig –add mysqld
4、 #chkconfig –level 345 mysqld
5、 #chkconfig mysqld on
6、 #service mysqld start/stop/restart
三、 Php服务配置
1、 首到php-fpm.conf文件去掉pid = /run/php-fpm.pid注释
2、 创建服务启动脚本,代码如下:
#vim /etc/init.d/php-fpm
#! /bin/sh
#chkconfig: 2345 15 95
#Comments to support chkconfig on CentOS
set -e
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DESC="php-fpm nobody"
NAME=php-fpm
DAEMON=/usr/local/php/sbin/$NAME
CONFIGFILE=/usr/local/php/etc/php-fpm.conf
PIDFILE=/usr/local/php/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME
test -x $DAEMON || exit 0
s_start() {
$DAEMON -y $CONFIGFILE || echo -n " already running"
}
s_stop() {
kill -QUIT cat $PIDFILE
|| echo -n " not running"
}
s_reload() {
kill -HUP cat $PIDFILE
|| echo -n " can‘t reload"
}
case "$1" in
start)
echo -n "Starting is success"
s_start
echo "."
;;
stop)
echo -n "Stopping is success"
s_stop
echo "."
;;
reload)
echo -n "Reloading configuration..."
s_reload
echo "reloaded."
;;
restart)
echo -n "Restarting is success"
s_stop
sleep 1
s_start
echo "."
;;
*)
echo "Usage: {start|stop|restart|force-reload}" >&2
exit 3
;;
Esac
3、 #chmod a+x /etc/init.d/php-fpm
4、 #chkconfig –add php-fpm
5、 #chkconfig –level 345 php-fpm
6、 #chkconfig php-fpm on
7、 查看开机启动服务情况
#chkconfig --list
8、 服务操作
#启动服务
#service php-fpm start
#停止服务
#service php-fpm stop
#重启服务
#service php-fpm restart
备注:如果出现未写出的错误,可以网上google解决;
标签:vim load() 服务启动 files googl || lis reload) var
原文地址:https://blog.51cto.com/1243047/2429547