在 Ubuntu 上,Apache 服务通常叫 apache2,可以使用 systemctl 来管理。
sudo systemctl restart apache2
sudo systemctl reload apache2
sudo systemctl stop apache2
sudo systemctl start apache2
sudo systemctl status apache2
sudo service apache2 restart
如果你是用 宝塔 / LNMP / Docker 安装的 Apache,重启方式会不一样,可以告诉我你的环境。