在 Ubuntu 上重启 Apache 通常使用 systemd 管理,命令如下:
sudo systemctl restart apache2
sudo systemctl reload apache2
sudo systemctl stop apache2
sudo systemctl start apache2
sudo systemctl status apache2
sudo service apache2 restart
如果你的 Apache 是 Docker / 源码编译 / 其他发行版,可以告诉我具体环境,我给你对应方式。