且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

通过浏览器连接到亚马逊(AWS)的EC2实例

更新时间:2021-11-30 09:43:40

在默认情况下,你的情况下,将只在默认安全组。如果它是一个EC2实例的实例正在运行时,你不能改变安全组,你必须事先指定。如果它是一个VPC例如,你可以在运行时更改安全组。

By default, your instances will only be in the default security group. If it's an EC2 instance you cannot change security groups while the instance is running, you'll have to specify them in advance. If it's a VPC instance you can change security groups at runtime.

但是,您可以添加规则以允许使用80端口到默认安全组;只是不成立其不能与正在运行的实例相关联的新的安全组

You can however add the rule to allow port 80 to that default security group; just don't create a new security group as it can not be associated with the running instance.

此外,请确保您的网络服务器是启动和运行。从您的实例(使用SSH shell访问),检查是否正确的流程正在侦听端口80,使用命令 netstat的-lnp 。然后,您应该看到一排 TCP 本地地址结尾:80。列出的IP地址应该是0.0.0.0(意为任何IP),或收听网络接口的一个特定的IP。

Also, make sure that your web server is up and running. From your instance (using SSH shell access), check if the right process is listening on port 80, using the command netstat -lnp. You should then see a row with proto tcp and a Local Address ending in :80. The IP Address listed should be either 0.0.0.0 (meaning 'any IP') or a specific IP of a listening network interface.

如果您需要一个Web服务器,看看Apache或Nginx的。它们都支持PHP。

If you are in need of a web server, take a look at Apache or Nginx. They both support PHP.

希望这有助于。