温馨提示×

apache ubuntu如何重启

小樊
39
2026-09-08 04:26:12
栏目: 智能运维

在 Ubuntu 上重启 Apache 通常使用 systemd 管理,命令如下:

1. 重启 Apache(最常用)

sudo systemctl restart apache2

2. 仅重新加载配置(不中断连接,推荐改配置后用)

sudo systemctl reload apache2

3. 停止 / 启动

sudo systemctl stop apache2
sudo systemctl start apache2

4. 查看运行状态

sudo systemctl status apache2

旧版本(SysVinit,极少用)

sudo service apache2 restart

如果你的 Apache 是 Docker / 源码编译 / 其他发行版,可以告诉我具体环境,我给你对应方式。

0 踩