在 Debian 系统中,Apache 通常使用 apache2 这个服务名(而不是 httpd)。以下是常见的启动和管理方法:
sudo systemctl start apache2
sudo systemctl enable apache2
sudo systemctl stop apache2
sudo systemctl restart apache2
sudo systemctl status apache2
sudo service apache2 start
sudo service apache2 stop
sudo service apache2 restart
which apache2
# 或
dpkg -l | grep apache2
如果未安装:
sudo apt update
sudo apt install apache2
浏览器访问:
http://localhost
或服务器 IP,看到 Apache2 Debian Default Page 即成功。
如果你是在 容器 / 最小系统 / 特定版本 Debian 中操作,可以告诉我环境,我可以给更具体的命令。