温馨提示×

ubuntu apache2怎么停用

小樊
63
2026-09-08 04:31:13
栏目: 智能运维

在 Ubuntu 上停用(停止并禁止开机启动)Apache2,可以用以下命令:

1. 停止 Apache2 服务

sudo systemctl stop apache2

2. 禁止开机自动启动

sudo systemctl disable apache2

3.(可选)彻底关闭并确认状态

sudo systemctl status apache2

如果看到 inactive (dead) 且 disabled,说明已停用成功。


补充:如果你想“临时停用但开机仍启动”

只执行:

sudo systemctl stop apache2

如果你想“完全卸载 Apache2”

sudo apt remove apache2
sudo apt purge apache2
sudo apt autoremove

如果你是在 桌面版 Ubuntu 或用 XAMPP / Docker 跑的 Apache,也可以告诉我,我给你对应方法。

0 踩