在 Debian 系统中,Apache2 通常使用 systemd 来管理,推荐用下面的命令:
sudo systemctl restart apache2
sudo systemctl reload apache2
或
sudo apache2ctl graceful
sudo systemctl stop apache2
sudo systemctl start apache2
sudo systemctl status apache2
sudo service apache2 restart
如果你是在 修改了虚拟主机或 httpd.conf 后重启,用 reload 一般就够了;如果改了模块或编译相关配置,再使用 restart。