在 Debian 系统上启用 Apache2(安装并启动、设置开机自启)通常步骤如下:
sudo apt update
sudo apt install apache2
sudo systemctl start apache2
sudo systemctl enable apache2
sudo systemctl status apache2
看到 active (running) 表示已成功启用。
sudo ufw allow 80
sudo ufw allow 443
浏览器访问:
http://服务器IP
看到 Apache2 Debian Default Page 即正常。
sudo systemctl stop apache2 # 停止
sudo systemctl restart apache2 # 重启
sudo systemctl reload apache2 # 重新加载配置
如果你是说启用某个站点 / 模块 / 重写规则,也可以告诉我具体需求。