apache
启动
systemctl start httpd
停止
systemctl stop httpd
重启
systemctl restart httpd
或者
service httpd stop
service httpd start
service httpd restart
-------------------------------------------------------
mysql
启动
systemctl start mysqld
停止
systemctl stop mysqld
重启
systemctl restart mysqld
或者
service mysqld stop
service mysqld start
service mysqld restart
-----------------------------------------------------
php-fpm
启动
systemctl start php-fpm
停止
systemctl stop php-fpm
重启
systemctl restart php-fpm
或者可以服务的方式启动、停止和重启:
service php-fpm start
service php-fpm stop
service php-fpm reload
---------------------------------------------------------
nginx
启动
systemctl start nginx
停止
systemctl stop nginx
重启
systemctl restart nginx
或者
service nginx stop
service nginx start
service nginx restart
传统方法
一、启动
cd usr/local/nginx/sbin
./nginx
二、重启
更改配置重启nginx
kill -HUP 主进程号或进程号文件路径
或者使用
cd /usr/local/nginx/sbin
./nginx -s reload
判断配置文件是否正确
nginx -t -c /usr/local/nginx/conf/nginx.conf
或者
cd /usr/local/nginx/sbin
./nginx -t
三、关闭
查询nginx主进程号
ps -ef | grep nginx
从容停止 kill -QUIT 主进程号
快速停止 kill -TERM 主进程号
强制停止 kill -9 nginx
若nginx.conf配置了pid文件路径,如果没有,则在logs目录下
kill -信号类型 '/usr/local/nginx/logs/nginx.pid'
------------------------------------------------------------
开机自启
chkconfig httpd on
chkconfig mysqld on
-----------------------------------------------------------
一、MySQL启动方式
1、使用 service 启动:service mysqld start
2、使用 mysqld 脚本启动:/etc/init.d/mysqld start
3、使用 safe_mysqld 启动:safe_mysqld&
二、MySQL停止
1、使用 service 启动: service mysqld stop
2、使用 mysqld 脚本启动:/etc/init.d/mysqld stop
3、mysqladmin shutdown
三、MySQL重启
1、使用 service 启动:service mysqld restart
2、使用 mysqld 脚本启动:/etc/init.d/mysqld restart
四、强制关闭
以上方法都无效的时候,可以通过强行命令:“killall mysql”来关闭MySQL,但是不建议用这样的方式,因为这种野蛮的方法会强行终止MySQL数据库服务,有可能导致表损坏……所以自己掂量着用。
Windows下重启MySQL服务,对于没装mysql图形管理端的用户来说启动和停止mysql服务:
…\…\bin>net stop mysql
…\…\bin>net start mysql
来源:oschina
链接:https://my.oschina.net/u/3194172/blog/3031189