简体   繁体   English

Amazon EC2 403禁止错误消息

[英]Amazon EC2 403 Forbidden error message

I have assigned the Elastic IP to my EC2 instance and after that when I went to access the instance it gives me the 403 Forbidden error message and the IP has also been changed. 我已将弹性IP分配给我的EC2实例,此后,当我访问该实例时,它会给我403禁止错误消息,并且IP也已更改。 Also I am not able to acess it using Putty. 我也不能使用腻子来处理它。

Any help would be appreciated. 任何帮助,将不胜感激。

On AWS-EC2, whenever you associate an Elastic IP with an instance, both the Public IP and AWS Public DNS are updated to reflect the Elastic IP. 在AWS-EC2上,每当您将Elastic IP与实例关联时,都会更新Public IP和AWS Public DNS以反映Elastic IP。 From my experience, this usually happens in less than a minute, but that can vary. 根据我的经验,这通常在不到一分钟的时间内发生,但是可能会有所不同。

As for why you can't connect to the instance from either a browser or from a SSH (Putty) connection. 至于为什么不能通过浏览器或SSH(Putty)连接连接到实例。 If you could answer these questions I can probably help you sort out why you can't connect to your instance. 如果您可以回答这些问题,那么我可能可以帮助您弄清为什么无法连接到实例。

For the 403 Error- 对于403错误-

  1. Are you using Apache? 您在使用Apache吗? If yes, have you updated the vhost entries in the http.conf, ssl.conf and any other relevant apache configuration files? 如果是,您是否更新了http.conf,ssl.conf和任何其他相关的Apache配置文件中的虚拟主机条目? You need to update any vhost blocks that refer to the old AWS Public IP or AWS Public DNS to reflect the change to the new Elastic IP. 您需要更新所有引用旧的AWS Public IP或AWS Public DNS的虚拟主机块,以反映对新的Elastic IP的更改。 You can set the vhost ServerName to any of the following- Elastic IP, AWS Public DNS or FQDN (Fully Qualified Domain Name). 您可以将vhost ServerName设置为以下任意一种-弹性IP,AWS公共DNS或FQDN(完全合格的域名)。 After you update the conf files don't forget to Restart Apache. 更新conf文件后,不要忘记重新启动Apache。
  2. Is the instance associated with a Security Group that has Ports 80 & 443 (Default HTTP & HTTPS) open? 实例是否与打开了端口80和443(默认HTTP和HTTPS)的安全组关联? Obviously, if you changed the ports you are serving your site on, those port numbers would need to be open in the Security Group instead of 80 & 443. 显然,如果您更改了为站点提供服务的端口,则这些端口号需要在安全组中打开,而不是80和443。

For Putty Connection- 对于腻子连接-

  1. Can you post the ssh command you are using from Putty? 您可以从Putty中发布正在使用的ssh命令吗?
  2. Is the instance associated with a Security Group that has Port 22 (Default SSH Port) open? 实例是否与打开了端口22(默认SSH端口)的安全组关联?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM