centos 重启服务

CentOS重启Apache、MySQL、Nginx、php-fpm  Centos上Apache重启,mysql重启, nginx 重启方法   1.重启 apachephp

  service httpd restratmysql

  /etc/init.d/httpd stopnginx

  /etc/init.d/httpd startsql

  2.重启 mysqlapache

  service mysqld restartcentos

  /etc/init.d/mysqld stopssh

  /etc/init.d/mysqld startphp-fpm

  3.重启Nginxcentos7

  service nginx restartrest

  /etc/init.d/nginx stop

  /etc/init.d/nginx start

 4.重启fpm

php 5.3.3 中 php-fpm 的重启、终止操做命令

php 5.3.3 源码中已经内嵌了 php-fpm,不用象之前的php版本同样专门打补丁了,只须要在configure的时候添加编译参数便可。

关于php-fpm的编译参数有 –enable-fpm –with-fpm-user=www –with-fpm-group=www –with-libevent-dir=libevent位置。

可是,php 5.3.3 下的php-fpm 再也不支持 php-fpm 之前具备的 /usr/local/php/sbin/php-fpm (start|stop|reload)等命令,须要使用信号控制:

master进程能够理解如下信号

INT, TERM 马上终止

QUIT 平滑终止

USR1 从新打开日志文件

USR2 平滑重载全部worker进程并从新载入配置和二进制模块

示例:

php-fpm 关闭:

kill -INT cat /usr/local/php/var/run/php-fpm.pid

php-fpm 重启:

kill -USR2 cat /usr/local/php/var/run/php-fpm.pid

查看php-fpm进程数:

ps aux | grep -c php-fpm

以上均是老版本的centos,centos7以后就要 service sshd restart 或者systemctl retart sshd.service