Keep apache running help?

Discussion in 'Apache' started by Karabaja, Aug 23, 2007.

  1. #1
    This started happening last night(European time). Apache stopped 3 times since then. First 2 times it happened, last two entries in error_log where the same:

    [Thu Aug 23 00:15:34 2007] [error] [client 127.0.0.1] File does not exist: /usr/local/apache/htdocs/server-status
    [Thu Aug 23 00:15:34 2007] [error] [client 127.0.0.1] File does not exist: /usr/local/apache/htdocs/404.shtml
    Code (markup):
    3rd time it stopped last entry was that php ran out of memory. I've increased the limit now in php.ini.

    It is Apache 1.3.37, running on centos 4.5 with whm/cpanel. I've recently moved to this hosting-SolarVPS. Their support wasn't of much help on this issue. So I was hoping to get some help here.
    Is there anyway to pin point the cause of apache stopping?
    And since they don't provide server monitoring, what could I use to set it up myself. I was reading about "monit" is that a good choice?

    And another thing I could use some help on, I keep getting errors logged about people trying to access some files that are not available on my server like:

    [Thu Aug 23 13:49:13 2007] [error] [client xxxxxxx] File does not exist: /usr/local/apache/htdocs/DigiChat/DigiClasses/Client.cab
    [Thu Aug 23 13:49:13 2007] [error] [client xxxxxxx] File does not exist: /usr/local/apache/htdocs/404.shtml
    [Thu Aug 23 13:49:13 2007] [error] [client xxxxxxx] File does not exist: /usr/local/apache/htdocs/DigiChat/DigiClasses/com/diginet/digichat/client/DigiChatApplet.class
    [Thu Aug 23 13:49:13 2007] [error] [client xxxxxxx] File does not exist: /usr/local/apache/htdocs/404.shtml
    Code (markup):
    I guess some previous owner of this VPS had some chat application running and people are still trying to access it. Is there anything I should/could do about this?

    Any help would be much appreciated.
     
    Karabaja, Aug 23, 2007 IP
  2. cyanide

    cyanide Peon

    Messages:
    483
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Not much you can really do about people trying to access files that don't exist, expect to maybe have a custom 404 page.

    YOu can install the system integrity monitor which will restart any downed services like apache
     
    cyanide, Aug 24, 2007 IP
  3. Karabaja

    Karabaja Member

    Messages:
    66
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #3
    Thx cyanide, I'll give SIM a try. This apache stopping seems to have been some security related issue though.
    I've installed this:

    http://www.configserver.com/cp/csf.html

    Turned on iptables and installed mod_security. And it is working fine now. But still I'll need something to make sure it is restarted if it stops for some reason.
     
    Karabaja, Aug 27, 2007 IP
  4. Bryce

    Bryce Peon

    Messages:
    1,235
    Likes Received:
    93
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Hi Karabaja,
    I had a similar problem on one of my dedicated servers when a site was under a DDOS attack. I know there's probably a more elegant way to handle this, but I just wrote a perl script to check if httpd was running and if it wasn't to restart the apache server. I put the script in the Crontab and had it set to run every 5 minutes. This is what I did...

    #! /usr/bin/perl

    $e = `ps ax | grep httpd | grep -v grep | wc -l`;
    $e =~ int(chomp($e));
    if (! $e){
    `/etc/rc.d/init.d/httpd restart`;
    }
     
    Bryce, Sep 1, 2007 IP