大网数据广告活动
服务器运维问答

How to `Graceful Restart Apache` in centos 7?

· 52CE 我爱测

My system is centos 7.4, with apache 2.4 Based on apache manual , apachectl -k graceful should be the way to graceful restart apache, but I got notice as below: [root@localhost root]# apachectl -k graceful Passing arguments to ht…

问题原文

原帖链接 · kittygirl · CC BY-SA 4.0

My system is centos 7.4, with apache 2.4
Based on apache manual,apachectl -k graceful should be the way to graceful restart apache, but I got notice as below:

[root@localhost root]# apachectl -k graceful
Passing arguments to httpd using apachectl is no longer supported.
You can only start/stop/restart httpd using this script.
If you want to pass extra arguments to httpd, edit the
/etc/sysconfig/httpd config file.

What's the problem?
How to Graceful Restart Apache in centos 7?

已采纳解答

原帖链接 · Jay Schauer · CC BY-SA 4.0

Please see this page on apachectl, which appears to be a new version: https://httpd.apache.org/docs/2.4/programs/apachectl.html

There is no need to pass the '-k' argument. apachectl graceful (without the -k) works just fine for a graceful reload/restart on my Centos7 box and Centos6 box.

Apparently nobody updated the manual page OP cited in her question, which still exists, and where the commands are shown with the '-k' argument throughout (apachectl -k graceful, apachectl -k restart, etc.) There's no explanation on that page about what the -k argument is actually doing, however.

But on the newer page there is this note on about apachectl graceful:

This is equivalent to apachectl -k graceful.

On my Centos6 box, I had been using the command service httpd graceful. That no longer worked on Centos7. It's necessary to use apachectl graceful to do the equivalent on Centos 7. Also apachectl graceful works just fine on Centos 6.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2019-02-28)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。