在 Debian 系统上启动 Apache2(通常叫 apache2 或 httpd)一般使用 systemd 来管理。下面是常见操作:
sudo systemctl start apache2
sudo systemctl enable apache2
sudo systemctl status apache2
看到 active (running) 就说明启动成功了。
sudo systemctl restart apache2 # 重启
sudo systemctl stop apache2 # 停止
浏览器访问:
http://localhost
或服务器 IP,看到 Apache2 Debian Default Page 就正常。
sudo service apache2 start
sudo apt update
sudo apt install apache2
sudo journalctl -xeu apache2
或查看:
sudo apache2ctl configtest
如果你是在 Docker / 云服务器 / 特定版本 Debian 环境,可以告诉我,我给你更具体的步骤。