What is the public URL of my EC2 instance?

匿名 (未验证) 提交于 2019-12-03 00:52:01

问题:

Some sources suggest that it's https://ec2-xxx-xxx-xxx-xxx.compute-1.amazonaws.com/ (where xxx-xxx-xxx-xxx is the public IP address of the machine). But when I navigate there Chrome says This site can’t be reached.

回答1:

Just use host command and specify your public IP - it will show you the right URL, e.g.

$ host 52.204.122.132 132.122.204.52.in-addr.arpa domain name pointer ec2-52-204-122-132.compute-1.amazonaws.com. 

where ec2-52-204-122-132.compute-1.amazonaws.com is your domain.

So you can add https:// in front of it to access the instance via HTTPS.



回答2:

When you access an URL from any browser, you need to make sure there is a server running on port 80, that is the default port. If you just launched a Linux ec2 instance, it's only accessible through ssh. To access these instances you need de access certificate, generated during the launch process and a ssh client, like ssh for Linux or putty for Windows. Also, if you do have a service running on port 80 or any other, you should make sure these ports are opened in the security policy of your instance.



回答3:

The Public DNS and IP address both can be used directly in the browser. You just have to open the ports 80 (http) and 443 (https, not necessary, still...).

You have to upload the file to /var/www/html to host your website.



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!