在 Ubuntu 上开启(启动)Apache2,一般步骤如下:
sudo apt update
sudo apt install apache2
sudo systemctl start apache2
sudo systemctl enable apache2
sudo systemctl status apache2
看到 active (running) 就说明已经成功开启。
在浏览器访问:
http://localhost
或服务器 IP:
http://你的服务器IP
看到 Apache2 Ubuntu Default Page 就说明正常。
sudo systemctl stop apache2
sudo systemctl restart apache2
sudo systemctl reload apache2
如果你是要配置虚拟主机、开启 HTTPS、或防火墙放行 80/443 端口,也可以继续问我。