I have a problem with my apache, I am running Ubuntu server 12.04 on a VPS. I have a basic LAMP stack, my problem is this, every few days apache will just stop and I will just notice this if I checked my blog. I don't have any problems like this before, I was using apache 2.2 before and currently I have apache 2.4.

I already reinstalled apache and I thought everything was okay, but right now it just happened again and my website was down, I don't know how long it was til I noticed that apache had stopped.

Any suggestion that could help me sort this thing out? Thank you very much

LAMP Information: Apache 2.4.9 PHP 5.5.14 MySQL 5.5

  • Could you post any relevant parts of error_log? – kraxor Jul 13 '14 at 11:46
  • Hello, are you referring to the apache error log? Here it is, do you thinkg it has something to do with line number 4 on this pastebin? pastebin.com/nSMZk6Fj I am just new in maintaining a VPS, thank you. – bagwis Jul 13 '14 at 12:23
  • take a look at this link – Lety Jul 13 '14 at 15:07
  • Thanks for the link Letizia, but I don't use APC on my VPS, I am currently using Zend Opcache. Thanks – bagwis Jul 14 '14 at 14:13

Quick and dirty solution could be a string in /etc/crontab to restart apache each hour, for example.

*/5 * * * * /usr/sbin/service apache2 restart

This will restart apache each 5 minutes.

But of course, we would like to know the reason it stops, right? There could be a lot of different reasons, as long as you have VPS.

Your provider could just use some kind of limiting system, which kills processes, which use too much of CPU or memory. Are you sure about apache quiting? Could you show the result of sudo netstat -tanp command, when apache stops?

  • Hi, yes, I am pretty sure that it is the apache which is quitting, because I need to start it once it occurred, however I could not provide the result of netstat yet because I have to wait for it to happen again or will the result be the same if I run it right now? Thanks – bagwis Jul 16 '14 at 14:31
  • Well, right now netstat will not be very useful. Just wait for apache to quit and try do a netstat then. – maniaque Jul 17 '14 at 18:20
  • Thanks for that then, is it okay to leave this topic open til I get back here? – bagwis Jul 18 '14 at 14:45
  • Of course you can leave it still open :) – maniaque Jul 19 '14 at 15:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.