AWS EC2 is running but website is showing connection time out - amazon-web-services

I am running Bitnami WordPress on AWS server website working since two days but suddenly it stop showing anything and connection timeout is showing. The instance EC2 is running perfectly fine, and I have also seen IP logs, and nothing suspicious has come up.

Based on the above comments I guess the issue is with the internal web server
Make sure that the web server is running perfectly fine. And I do not mean just checking the EC2 instance state, because it is possible that the EC2 instance is running but the web server is down, causing the issue

Related

aws ec2 instance suddenly not reachable

I have an ec2 linux server with a spring boot application and nginx reverse proxy. It has been running for months.
Today I tried accessing the server and it was not reachable, nor via ssh, nor via http.
I went to cloudWatch and saw these metrics :
I don't know how to interpret this : EBSReadBytes raised to 8 GB for an hour.
To gain access to the server I had to restart the instance. After that I went to nginx access logs :
Last java logs :
I don't see anything unusual in nginx logs. (The censored lines are from legit users)
For the java app, I usually have these kind of logs on my development computer when I let it go to sleep and comeback, but never had these on my linux server.
Do you have an idea why this happened ?
I am now pretty sure it was a resource leak due to not closing a file input stream.

HTTP server on EC2 instance unreachable after a few minutes

I have a running instance on the Linux 2 AMI.
I have a default VPC and network interface.
Security groups taken care of, even opened all traffic and still got nothing.
There is an Internet Gateway
Routes are open on the VPC
The server is running
nginx is running
Once the instance is initiated and installed, all of this is ready
I can reach the http website the first 2-3 minutes, then it is unreacheable.
No idea why, everything else still running, can still ssh into the server, but http port 80 not running.
I opened everything from iptables, still nothing.
If I reboot the server, I get a minute where I can reach the server via http, but then a minute later its the same again.
I can reach http if I use $ wget http://localhost
So I think it is probably something from the EC2 control panel, not the instance itself.
I tried on new instances too.
Anyone has an idea?
The reason behind this weird behavior was that AWS abuse team had blocked some of my ports, had to upgrade to the developer plan to be able to know this, contacting them at the moment

Can't connect to EC2 Instance via Browser. Via terminal works fine

I launched an EC2 instance on Amazon Web Services and want to deploy Confluence on a Ubuntu 18.04 Server. Almost everything is set up now.
I just need the last step:
I need to call http://{ec2-public-ip}:8090 from my browser to do the last steps of configuration of Confluence via the frontend, as described in the instructions of Confluence (https://confluence.atlassian.com/doc/installing-confluence-on-linux-143556824.html).
I don't have any issues with connecting to the EC2 instance via ssh in terminal (macOS) as ubuntu and also as root by using privateKey.pem. This works fine. Installation of Confluence and setting up a MySql DB were also successful. EC2 instance is running. Getting a connection via AWS Session Manager also works, but opens a terminal in my browser and if I ping the EC2 instance via the AWS Session Manager, there is a 100% packet loss. Via local terminal on my mac there is 0% packet loss.
Also calling http://{ec2-public-ip}:8090 via browser causes ERR_CONNECTION_REFUSED in Safari, Chrome, IE and Firefox.
What I already tried:
Security Groups (All Traffic, MyIP); also tried to allow Any Traffic
Firewall completely off; Proxy completely off
Opened all necessary Ports in my Network (8090, 8000, 22, 23)
Emptied Browser Cache
Flushed DNS; new IP; rebooted router; rebooted EC2 instance
Does anybody have an idea how to solve this problem? I know that there have been a few discussion about this topic, but none of those comments or solutions worked.
I chose a different Port as selected by Confluence. This worked immediately.
The packet loss was caused by the already assigned HTTP Port 80, although Confluence uses 8090 by default. When I pinged the server, all of my packets have been delivered, while all incoming packets went to a different device in my Network. As result my Terminal told me, that no packet was delivered to my Mac. Which was obviously true.
Now everything is up and running just fine.
I saw that a lot of people in the Internet had the same problem. Just try it again but choose different Ports while installing Confluence on your Server.

Wordpress running on EC2 t3.small becomes unavailable (ELB Error 504) after X amount of time, needs rebooting

I have a problem with my Amazon EC2 instance (that did not happened when I was using DigitalOcean).
I've several EC2 instances that are managed by me. My personal EC2 has about 5 Wordpress sites running on a t2.micro instance and the traffic is not high so it is working well in load speed.
Also I have another 2 instances for one of my clients, one t2.micro (running only one Wordpress site) and a t3a.micro (running 4 Wordpress sites). The issue is with all 3 instances (mine and all the 2 of my client).
I have a CloudWatch alarm to notify me by email when Error 504 happen. Since I get the alarm, the website becomes unavailable (Cloudflare shows me Error 504), but I can get into SSH or Webmin. I do service nginx status and all seems to be fine, same to service php7.2-fpm. I do pkill nginx && pkill php* and then service nginx start && service php7.2-fpm start correctly but when I try to enter to the site, the Error 504 is still there.
To test, I decided to install and configure Apache with and without PHP-FPM enabled, same problem. Instance going well and websites running fast but after X amount of hours, it becomes unaccessible via web and the only solution is rebooting...
What's the only thing that solve the issue? Well, rebooting the instance.... After it boots, the websites are available again. Please note that I moved from DigitalOcean to AWS because it is more useful but I can't understand why the problem is happening here and not there since I've a similar instance configured very similar...
In all of the instances I've a setup with:
OS: Ubuntu 18.04
Types: Two t2.micro and one t3a.micro
ELB: Enabled
Security Groups: only allow ports 80, 443 from all the sources.
Database: In a RDS, not on the same instance.
I can provide the logs of everything that you probably can ask but I review all the Nginx and PHP-fpm logs and I can't see any anomalies. Also with syslog and kern.log, but I can provide if it can helps.
Hope you can give me a hand. Thanks for your advice!
EDIT:
I already found the origin of the issue. The problem wasn't in the EC2, all my headache was because I have the RDS set with only one Security Group attached to allow access from my IP to remote management of the databases and the public IPs of the EC2 that runs Wordpress, but I figured that I also need to whitelist the private IPs of those EC2s... Really noob mistake but that was the solution.

Amazon EC2 small instance not responding

My Amazon EC2 small instance stopped responding, I looked at the AWS console and CPU use had gone through the roof. I tried rebooting instance but it didn't respond. So I stopped it and started it again (twice).
Now says the CPU usage is fine (was triggering an alarm when breaching 90%) but still can't login via SSH and Apache is not working (my sites are down).
Anyone give me any idea how I can sort this out? I'm out of my depth a bit as unfamiliar with the ins and outs of EC2.
EDIT: console log http://pastebin.com/JWFeG7NU shows Apache, SSH, etc starting up fine but I can't access via SSH and no response to pinging website hosted on server.
If you have stop/started your instance and you were not using an elastic IP address, your instance IP has changed.
If you were using an elastic IP address, it would have become disassociated.
If you do have applications that are causing you to exceed the allocated CPU, other applications such as ssh, may become slow to respond or not respond at all within the timeout.