在 Ubuntu 上启动 Apache2 通常有以下方式(假设你已安装 apache2):
sudo systemctl start apache2
设置开机自启:
sudo systemctl enable apache2
查看状态:
sudo systemctl status apache2
sudo service apache2 start
sudo apachectl start
sudo apt update
sudo apt install apache2
sudo lsof -i:80
sudo ufw allow 'Apache'
启动后,浏览器访问:
http://localhost
看到 Apache 默认页即成功。
如果你遇到具体报错,可以把错误信息发出来。