我尝试重新启动我的 Apache 服务器,我对此很陌生。 我很想知道 apache2重启是做什么的? apachectl restart 是做什么的?
最佳答案
假设您使用的是 Ubuntu 或类似系统,man apache2
会指示以下内容:
In general, apache2 should not be invoked directly, but rather should be invoked via /etc/init.d/apache2 or apache2ctl.
仅供引用:apachectl 现在是 apache2ctl 的别名
作为最佳实践,建议发出 sudo apache2ctl Graceful
正如其含义所示,graceful 参数提供了一种更稳定的方式来重新启动 apache 进程,让其子进程在重新加载配置之前完成正在进行的任务。
cf man apache2ctl
重新启动:
Restarts the Apache daemon by sending it a SIGHUP.
优雅:
Gracefully restarts the Apache daemon by sending it a SIGUSR1. If the daemon is not running, it is started. This differs from a normal restart in that currently open connections are not aborted.
Here is a reference about signalling SIGUSR1 as opposed to SIGHUP.
关于apache - apachectl 和 apache2 之间的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16338313/