【发布时间】:2017-01-23 01:41:09
【问题描述】:
我是使用 Google Cloud Platform 的新手,我正在尝试托管一个非常简单的静态网站。我完全关注了 Google 的 tutorial for running a basic apache webserver,但是,当我点击我网站的外部 IP 时,我被带到一个页面,上面写着“无法访问此网站。<my site's IP address> 意外关闭了连接ERR_CONNECTION_CLOSED。
自从创建虚拟机后,我运行了以下命令:
sudo apt-get update && sudo apt-get install apache2 -yecho '<!doctype html><html><body><h1>Hello World!</h1></body></html>' | sudo tee /var/www/html/index.html
我还跑了ping <site IP address> 并看到了表格的行
PING <IP address> 56(84) bytes of data.
64 bytes from <IP address>: icmp_seq=1 ttl=76 time=0.746 ms
我已确保我的 VM 上的防火墙设置已设置为允许 HTTP 和 HTTPS 流量。
为什么我看不到应该在我的站点上托管的简单 Hello World 页面?我需要手动启动apache吗?我试过了,但没有成功。
(我的虚拟机使用 Debian 8 作为启动映像)
更新
应以下用户的要求,我运行了sudo service apache2 status,但得到了以下响应:
apache2.service - LSB: Apache2 web server
Loaded: loaded (/etc/init.d/apache2)
Drop-In: /lib/systemd/system/apache2.service.d
└─forking.conf
Active: active (running) since Mon 2017-01-23 01:27:44 UTC; 11h ago
CGroup: /system.slice/apache2.service
├─2570 /usr/sbin/apache2 -k start
├─2573 /usr/sbin/apache2 -k start
└─2574 /usr/sbin/apache2 -k start
运行sudo service apache2 start 似乎没有做任何事情。
【问题讨论】:
标签: linux debian apache2 google-cloud-platform google-compute-engine