How do I troubleshoot web server timeout in a droplet?

May 26, 2019 288 views
Apache Debian


I have an Apache/PHP/MySQL server setup on a droplet, and sometimes the server will “go down” and the sites will time out in a browser.

Restarting Apache resolves the issue for the time being, but I did that last night only to find the site down again this morning (so I rebooted Linux), so I’m concerned.

I found a 3rd party service that lets me know when this happens, but I can’t always be there to restart the system.

The general Apache error log did not show anything out of the ordinary as far as I can tell. I know enough to be dangerous on Linux as long as I can Google things, but this is beyond me.

I spent a lot of time tightening security, and while I have seen dozens of hack attempts a minute within the first hour of the server going up, I’m fairly sure it’s reasonably locked up.

What steps can you recommend I take to track down this issue?

Are there any tools I can use to automatically restart apache when there’s an issue?


1 Answer

For the hack attempts, why not have a look at Cloudflare free plan, it helps protect against cross site scripting and DDoS attempts.

Regarding your timeouts, its probably from exhausted server memory / cpu. Check your memory, cpu and server load with htop (sudo apt-get install htop) and then run command htop.

Have another answer? Share your knowledge.