在 Ubuntu 上停用(停止并禁止开机启动)Apache2,可以用以下命令:
sudo systemctl stop apache2
sudo systemctl disable apache2
sudo systemctl status apache2
如果看到 inactive (dead) 且 disabled,说明已停用成功。
只执行:
sudo systemctl stop apache2
sudo apt remove apache2
sudo apt purge apache2
sudo apt autoremove
如果你是在 桌面版 Ubuntu 或用 XAMPP / Docker 跑的 Apache,也可以告诉我,我给你对应方法。