centos7重启命令详解 centos重启nginx命令

1、apache

启动 systemctl start httpd
停止
systemctl stop httpd
重启
systemctl restart httpd
或者
service httpd stop
service httpd start
service httpd restart
——————————————————-
2、mysql
启动
systemctl start mysqld
停止
systemctl stop mysqld
重启
systemctl restart mysqld
或者
service mysqld stop
service mysqld start
service mysqld restart
—————————————————–
3、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
———————————————————
4、nginx
启动
systemctl start nginx
停止
systemctl stop nginx
重启
systemctl restart nginx
或者
service nginx stop
service nginx start
service nginx restart
5、防火墙关闭重启
查看防火状态
systemctl status firewalld
service iptables status
暂时关闭防火墙
systemctl stop firewalld
service iptables stop
永久关闭防火墙
systemctl disable firewalld
chkconfig iptables off
重启防火墙
systemctl enable firewalld
service iptables 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
【centos7重启命令详解 centos重启nginx命令】…\…\bin>net start mysql


    以上关于本文的内容,仅作参考!温馨提示:如遇健康、疾病相关的问题,请您及时就医或请专业人士给予相关指导!

    「四川龙网」www.sichuanlong.com小编还为您精选了以下内容,希望对您有所帮助: