I have an Amazon Linux instance with only WordPress running on it (installed using Amazon guide). After some amount of time (I don't know exactly how long, at least some hours), the instance is neither reachable through HTTP (tries to open website forever) nor SSH (message: ssh_exchange_identification: read: Connection reset by peer).
When I log into the console I see that the light is green and everything seems to be ok. Even rebooting the instance won't help the problem. The only solution is stopping the instance and starting again, then the whole cycle starts again: works for some hours and then suddenly doesn't.
Maybe it's important to mention that I have purchased a reserved Linux instance matching my EC2 instance. So I'm using that. Any ideas that could help me fix this problem?
Update:
I made a snapshot of my instance and put it on a new volume, but that didn't solve the problem either.
Current security group (inbound):
- HTTP and HTTPS from everywhere
- SSH only from my IP
I checked access_log in httpd folder and it contains very few lines, of which a couple are weird Russian websites (sometimes). Which is weird because my website is not officially online and there is no link to it anywhere.
Best Answer
In my opinion your server or the disk has become corrupt and needs to be fully replaced. Here's what I'd do
First up, you have a choice on approach
Another choice is using RDS or MySQL on the instance. I use MySQL on the instance because it's cheaper and works just fine.
Next
If this ends up being unreliable it maybe be something weird in your database. Export your posts and content via XML, then import it. I would be surprised if this was necessary.
Misc
To answer your question above, only open SSH to your own IP.