Can't connect to EC2 instance via web browser - amazon-web-services

I'm a total newbie when it comes to servers and EC2 but I have an EC2 instance running which was stopped and restarted. Since that I haven't been able to connect via a web-browser to the site but can connect via SSH. Are there any ideas why this could be the case?

Here is the debug checklist:
Check your server, make sure it is up and running in AWS management console.
Check port security setting, from your local machine. If it is close open it in security group.
telnet your_ip 80 # Check http port
telnet your_ip 22 # Check SSH port
Check your web server, Apache, Nginx, etc. If you cannot find your process, start it.
ps -ef | grep -e nginx -e httpd -e apache
Check your virtual host config, make sure you web server is listening to port 80 (http) or 443 (https).
Run chkconfig and make sure your web server will start as a service.

Check the security group in your instance property, it is probably allowing only SSH (default), you may want to add a inbound rule allowing HTTP traffic.

Related

How to access jenkins dashboard on webbrowser in AWS?

I am very new to AWS and Devops part, I read some official documentation and I installed Jenkins server in my ec2-instance it's successfully installed and it's running also ,when i try to open by using http://my-public-ip:8080 it's not opening. How to open my Jenkins dashboard in my web browser?
This is my EC2 instance inbound rules:
When I am trying to search in my browser it's showing some thing like this:
This site can't be reached13.235.67.157 took too long to respond.
Try:
Checking the connection
Checking the proxy and the firewall
Running Windows Network Diagnostics
ERR_CONNECTION_TIMED_OUT
I would suggest go to your security group of this instance which is launch-wizard-5 Edit it and You have to choose "Custom TCP rule"
Then you will be able to add the port to 8080
Wait for second
and open http://my-public-ip:8080 in your favorite browser
You'll able to access your Jenkins GUI
Jenkins uses a specific port: 8080
To verify this, inside of your jenkins shell try this:
try with netstat -plnt.
and
curl localhost:8080 -v
If you have a valid response showing you that 8080 port is online, your jenkin is ready to use. Just configure the 8080 port in your AWS inbound rules. Finally you will be able to access with:
http://my-public-ip:8080
If you achieve that, your next goal must be to hide the 8080 port. For that you could use the ELB to assign a custom domain if you have someone.
Add security groups
ALLTraffic
0.0.0.0/0
Then refresh the page

Unable to connect to webserver on AWS EC2 instance

I'm unable to connect to my EC2 instance where I have an apache web server running (also running an Express.js server on a different port). I have updated the security group to allow incoming requests to http and https ports but I continue to get this response in the browser:
This site can’t provide a secure connection
*********** sent an invalid response.
ERR_SSL_PROTOCOL_ERROR
I am able to ssh into my EC2 instance.
Other than ensuring that the correct ports are open and that a service is listening on those ports, is there any configuration needed to setup simple web server on EC2?
Current security group settings:
Currently open ports (sudo lsof -i -P -n | grep LISTEN):
There are some similar questions posted but they are either vague or have been left for dead
You need to install mod_ssl to tell apache to serve httpS connections.
You can use the default (or self signed certificate) to check the connectivity on port 443. If you need a valid ssl certificate, you can get one for free from Let's Encrypt: https://letsencrypt.org/
You can use CertBOT to auto renew certificates: https://letsencrypt.org/getting-started/

My AWS ec2 instance is running on ec2-xx-1xx-xxx-24.compute-1.amazonaws.com:8000. how do i make it run on ec2-xx-1xx-xxx-24.compute-1.amazonaws.com

My AWS ec2 instance is running on ec2-xx-1xx-xxx-24.compute-1.amazonaws.com:8000. how do i make it run on ec2-xx-1xx-xxx-24.compute-1.amazonaws.com
I am using Gunicorn server server and it is a Django application on Ubuntu server
You can configure the same via virtual host in httdp.conf with redirection rule or you can do the same with ELB in which you can mention the request comes on 80 and ELB will forward the same on 8000 port.
This is a two step problem:
You have to configure Django to listen on the right port, and you also have to modify the security group attached to your instance to allow connection on port 80.
You can either allow access from anywhere or from a specific IP/Range of IPs.
An other solution is to create an ELB and configure it to listen on port 80 and send the traffic on port 8080.

Unable to access JBOSS server deployed on Amazon EC2

I have deployed jboss-4.2.3 on an EC2 instance. I have added appropriate rule to open port 8080 for inbound traffic. When I ssh into this instance and do curl localhost:8080, the expected response can be seen
But when I try to access it in a browser on my laptop, am unable to connect. Few other things I have tried to eliminate other possibilities
In order to eliminate possibility of firewall issues on my laptop, have tried to connect from another instance on amazon. Doesnt work
Also tried to configure jboss to listen to port 80. Still it can't be accessed. Apache running on port 80 however responds
Any guidance is highly appreciated
Bind your jboss to all IP addresses as below:
./run.sh -b 0.0.0.0
I was struggling with the same issue.
You need to open up port 8080 in the Security Groups as Wildfly is using it. Then you should be able to access the page.

Front-Ending an app server on AWS EC2

I have 2 instances set up in EC2. One is running nginx and has an association with the elastic IP address, so its publicly accessible.
The other doesn't have a web server but has a RESTful server running on port 8080.
Both belong to a security group with these rules:
Ports Protocol Source MongoDB-2-2-2-AutogenByAWSMP-
22 tcp 0.0.0.0/0
80 tcp 0.0.0.0/0
8080 tcp 0.0.0.0/0
If I understand that right then port 8080 should be open.
If I ssh onto my web box (with nginx running) I'm trying to test access to my RESTful server on the other instance:8080, so I tried:
curl http://10.151.87.76:8080/1/tlc/ping
curl http://ip-10-151-87-76:8080/1/tlc/ping
curl http://ip-10-151-87-76.ec2.internal:8080/1/tlc/ping
All of these gave me "couldn't connect to host" errors.
If I log onto the RESTful box directly and do the following, it works.
curl localhost:8080/1/tlc/ping
So I know my service is up and healthy.
Any ideas why I can't see port 8080 from the other instance are appreciated.
Make sure instances are in the same availability zone. If not, you may need to access the instance by public DNS name (something like ec2-XXX-XX-XXX-XXX.YYY.amazonaws.com).
Make sure 10.151.87.76 is the correct IP. Note that this will probably change after the instance is stopped and started again.
Make sure your headless service is publicly available -- it may listen on localhost:8080 only but should listen on 0.0.0.0:8080. Try nmap 10.151.87.76 -p 8080 from other instance, it should list 8080 as open port.
Make sure your headless service is publicly available << so this is the reason. What web server are you using for REST API? If it is Apache, make sure config says Listen 8080, not Listen 1.2.3.4:8080. If it is standalone app, make sure it can listen on all interfaces -- some clients will listen on localhost by default. – hudolejev 54 mins ago
This! Buried deep (deep) within my code was a piece of the server wired to "localhost". Changed that to key off hostname and all was well! Happy.