在 ec2 amazon 实例上的 ubuntu 服务器上安装了 lamp,仍然无法通过带有 apache 运行 的浏览器访问服务器。为什么?

Installed lamp on ubuntu server on an ec2 amazon instance, still can't access server through browser with apache running. Why?

我在 amazon ec2 上启动了一个实例,ami 是 ubuntu 14.04。我按照 https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/putty.html exactly up until "Transferring Files to Your Linux Instance Using the PuTTY Secure Copy Client" Since I don't need to put files on there just yet. Then I followed the following: https://help.ubuntu.com/community/ApacheMySQLPHP 上的步骤操作。

"在 Ubuntu 10.04 及更高版本中安装默认 LAMP 堆栈 首先刷新您的包索引...

$ sudo apt-get update

... 然后安装 LAMP 堆栈:

$ sudo apt-get install lamp-server^

注意末尾的插入符号 (^)。 “

之后我尝试了

sudo /etc/init.d/apache2 restart

之后 ubuntu 说:httpd (pid 5549) already running

然而,当我尝试使用 chrome 浏览亚马逊控制台中显示的 public ip 时,我得到

This webpage is not available

ERR_CONNECTION_TIMED_OUT

在我的浏览器中。我做错了什么?

检查您的安全组设置。入境规则是什么? 您需要在入站规则中添加打开 Web 浏览器的 IP。另外,请检查您是否在浏览器上使用私有 IP 或 public IP。您需要使用public IP。