在 Ubuntu 上启动 Apache2 一般有几种常见方式,下面按最常用的情况说明:
sudo systemctl start apache2
sudo systemctl enable apache2
sudo systemctl status apache2
sudo systemctl stop apache2
sudo systemctl restart apache2
sudo systemctl reload apache2
sudo service apache2 start
sudo service apache2 status
如果提示 Unit apache2.service not found:
sudo apt update
sudo apt install apache2
浏览器访问:
http://localhost
或服务器 IP,看到 Apache2 Ubuntu Default Page 即成功。
80sudo netstat -tulnp | grep :80
如果你是想 配置虚拟主机 / 开启 HTTPS / 解决启动报错,可以把具体报错贴出来,我帮你一步步看。