1
votes

The instance is running fine. I am using linux os and apache-tomcat-8.0.33 server. I can access from private ip using putty But when i am trying to access the same through the public ip, it is not accessible. I have seen the security configurations all ports are enabled.

Can anyone help me how to reslove this issue

inbound image

4
Welcome to StackOverflow! What do you mean by "I can access from private ip using putty"? From where are you connecting? Can you show us your Security Group inbound settings? Please provide as much information as possible so that we can assist you. - John Rotenstein
i had accessed the instance before by using public ip through browser but it suddenly stops the access from browser.but i can access through port 22 - sachin DK
If you ssh into the EC2 instance, then you can test the web server by using curl localhost. This will access the web server on the local machine. If that is working, then the problem is probably with your Security Group. If it is not working, then the problem is with your web server. - John Rotenstein

4 Answers

8
votes

I faced the same issue recently; I was not able to access the website which I hosted on Ec2 server Via public IP.

Check 1:- the First step would check your AWS security group and make sure all the inbound traffic rules are fine.

Check 2:- Windows firewall can also play a role in disallowing the access via public IP. Create a new Rule for allowing access for HTTP and HTTPS ports (80,443).

Steps

a. Go to control panel -->Windows Firewall ---> Advanced Settings. b. Select the Inbound rules from the left Menu. c. Select New Rule from the Right panel. d. Allow access to ports 80 and 443.

In my case, everything worked fine once I created a new rule in windows firewall under Inbound Rules.

0
votes

You opened your amazon web console

You go to Amazon EC2 Security Groups

You should have a default group for inbound rules (see below)

enter image description here

You click on Modify inbound rules (modifier les règles entrantes in French here)

Once done, you add your public ip with the subnet you want

enter image description here

I've added my IP public address and you should be good.

0
votes

As you mentioned and others answers, you can find the problem by following this steps:

1- Try telnet to your server by public IP address on port 80, if it opens go to the next step, if not open you have two possible issues:

  • security group (Check your inbound rules)

  • web server settings (Check your web server settings and find why not listening on port 80)

2- If telnet was working, so you have not the connectivity issue, now track your web server access log by tail command and try open a page by the browser. If you see your request in the access log, but it does not return the correct value you expected, so you should check your web application.if you can't see your request, check your web server settings.

-1
votes

Regardless of the number of ports open in your security group, if you must access your ec2 instance using it's public IP, over the internet, you must assign an internet gateway (IGW) to the subnet your ec2 instance belongs toenter image description here

http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Internet_Gateway.html