Connect to Amazon (AWS) EC2 instance via browser

后端 未结 5 680
执笔经年
执笔经年 2021-02-01 18:06

I am having trouble connecting to an Amazon Elastic Cloud Computer Instance via a browser. I attempted going to ********.compute-1.amazonaws.c

相关标签:
5条回答
  • 2021-02-01 18:15

    Do not forget to disable firewall if you use windows for your server.

    0 讨论(0)
  • 2021-02-01 18:19

    The EC2 instance firewall is maybe enabled. Check it with this command:

    sudo systemctl status firewalld
    

    if enabled you can disable it with :

    sudo systemctl disable firewalld
    

    or setup rules to allow port 80 trafic

    0 讨论(0)
  • 2021-02-01 18:23

    I faced the same issue while setting up redash AMI image on AWS. Inbound security rules should be changed when instance is not running. Let's say if the instance is running (meaning it's active and started); If you change the inbound rules of that machine you'll still face firewall issue. So Stop the machine on which you want to change the inbound rules on. Change the inbound rules. Start the machine now. Now you can hit the machine url from the ip you just opened the access to the machine to.

    0 讨论(0)
  • 2021-02-01 18:30

    I had also faced similar issue with ec2 micro instance. I was using Red-Hat AMI. Despite of opening ports 8081 in security group, I was not able to a telnet to the host port. Disabling the iptable did the trick for me:

    sudo /etc/init.d/iptables stop
    
    0 讨论(0)
  • 2021-02-01 18:36

    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.

    Add the rule to the default group

    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.

    Is the web server up?

    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 server not up

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

    Hope this helps.

    0 讨论(0)
提交回复
热议问题