What kind of maintenance tasks should I be thinking about on a LAMP server?

  • Posted August 20, 2013

Hi everyone,

I recently set up a new LAMP server for two moderately trafficked blogs in my content network. The performance so far has been great and my 1 gig server still has plenty of RAM and processing speed available.

This is the first time I’ve hosted a server on my own. The first 48 hours were smoother than I expected but I did have a MySQL database lockup that brought my sites down until I cycled the process.

So my question is - what kind of maintenance tasks should I be doing on the server? Should I set up a cron to restart my database and apache services or reboot the droplet on some regular basis? Any other maintenance tasks I should be doing beyond offsite backups to ensure reliability?


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Take a snapshot of your droplet on occasion, especially b/f any major programming modifications and/or updates. That way, if you end up f’-ing something up, you can simply spin up a new droplet from your (hopefully recent) snapshot and subsequently destroy the tarnished droplet – and pick up right where you left off. (Talking from personal experience here. I was not smart enough to do that and eventually crashed my droplet w/5 WordPress installations and, believe me, salvaging what I can and rebuilding the rest from scratch has been a B!t@H!)

On my 512Mb when doing some load testing, my MYSQL processes quit due to not having enough RAM. I’ve since set up a swap partition and have had no issues, so I would suggest that! :)

Make sure you keep your server updated so that you’re up to date on all of the security patches. Also backup your files and databases. <br> <br>> Should I set up a cron to restart my database and apache services or reboot the droplet on some regular basis? <br> <br>No. If you have to do that, you’re doing it wrong. It should run flawlessly without having to restart any services.

The servers should take care of themselves if configured correctly. I would set up logwatch as it emails you every day details about whats happening on the server. <br> <br>Also consider something like OSSEC and/or ConfigServer CFS/LFD as they monitor connections and attempts to access the server. Also recommend doing security tweaks. <br> <br>Oh, and update using yum frequently.