在 Ubuntu 上重启 Apache2,常用以下几种方式(需要 root 权限):
sudo systemctl restart apache2
sudo service apache2 restart
sudo /etc/init.d/apache2 restart
sudo systemctl start apache2
sudo systemctl stop apache2
sudo systemctl reload apache2
sudo systemctl status apache2
如果你是在 WSL / 容器 / 云服务器 环境,也可以告诉我,我可以给你更具体的建议。