linux lamp 关闭apache,LAMP系列之Apache优雅重启、优雅关闭

1、优雅停止

信号:WINCH[root@localhost~]# /appl/apache/bin/apachectl -kgraceful-stop #

[root@localhost ~]# elinks -dump http://192.168.137.3 #使用elinks访问测试

ELinks: 拒绝连接

516fa76fb6d8a6f38bc775a119902fb2.png

2、优雅重启信号:USR1

[root@localhost ~]# /appl/apache/bin/apachectl -k graceful

httpd not running, trying to start

[root@localhost ~]# ps aux |grep httpd

root 5595 0.0 0.3 33420 3260 ? Ss 16:34 0:00 /appl/apache2.2.22/bin/httpd -k graceful

daemon 5596 0.0 0.1 31976 1296 ? S 16:34 0:00 /appl/apache2.2.22/bin/httpd -k graceful

daemon 5597 0.0 0.1 33152 1144 ? S 16:34 0:00 /appl/apache2.2.22/bin/httpd -k graceful

daemon 5598 0.0 0.3 377680 3900 ? Sl 16:34 0:00 /appl/apache2.2.22/bin/httpd -k graceful

daemon 5599 0.0 0.3 377680 3904 ? Sl 16:34 0:00 /appl/apache2.2.22/bin/httpd -k graceful

daemon 5600 0.0 0.3 377680 3908 ? Sl 16:34 0:00 /appl/apache2.2.22/bin/httpd -k graceful

root 5683 0.0 0.0 103248 836 pts/1 S+ 16:34 0:00 grep httpd

测试:

[root@localhost ~]# elinks -dump http://192.168.137.3

It works!

670dce537011522e9a91cb7d0de684ca.png

3、Apache正常启动、关闭、重启[root@localhost ~]# /appl/apache/bin/apachectl -k stop

httpd (no pid file) not running

[root@localhost ~]# elinks -dump http://192.168.137.3

ELinks: 拒绝连接

[root@localhost ~]#

[root@localhost ~]# /appl/apache/bin/apachectl -k start

[root@localhost ~]# elinks -dump http://192.168.137.3

It works!

[root@localhost ~]# /appl/apache/bin/apachectl -k restart

[root@localhost ~]# elinks -dump http://192.168.137.3

It works!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值