Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 1 of 1
  1. #1
    Member
    Join Date
    Mar 2002
    Posts
    135

    Default Apache is hung and don't work anymore

    Thanks to a vise sysadmin who postet a informativ message I have done as follow on all servers (almost yet)

    Simply told apache on cpanel boxes need to be shut down and startet again, to avoid it will crash. Somehow it grows and grows at time beeing , and a apachectl graceful will not reset apache. It is relatet to a bug in Zend but can effect any server. It is supose to be relatet to the fact that apache is being done a graceful restart evry 10 min on WHM boxes, but this is not why but a simple how to fix.

    Make a script:

    cd /usr/bin
    touch apacherestart
    chmod 700 apacherestart
    vi apacherestart
    press i to enter edit mode in vi

    add this

    #!/bin/bash
    /usr/local/apache/bin/apachectl stop
    sleep 3
    rm -f /usr/local/apache/logs/httpd.pid
    /usr/local/apache/bin/apachectl start

    press escape and :wq to exit edit mode, save and exit vi.

    cd /etc
    vi crontab (this crontab cpanel never touches and it will work)

    Go to end of file,

    press i to enter vi edit mode

    add this line:

    30 4 * * * root /usr/bin/apacherestart

    press escape and :wq to exit vi edit mode and write exit vi.

    You could from /etc say

    cat crontab

    Check you have written the path correct.

    Now you have installed a root cron job wich will shut down apache, remove the pid file and start apace again, eavh night at 0430.

    You shuld now be able to expect apche on cpanel boxes don't get hung because of file desriptors. As far as I can understand, this shuld be done on all cpanel boxes, as it is working now.

    Anyone disgree please enlighten me. But 5 seks at 0430 is better then 30 min at lunch time!

    Hopes this will help someone!

    Last edited by bjarne; 05-26-2003 at 06:39 PM.

Similar Threads & Tags
Similar threads

  1. Hung apache processes
    By SecondSight in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 03-26-2007, 12:54 PM
  2. My Old Addon Scripts don't work anymore
    By bidware in forum cPanel Developers
    Replies: 6
    Last Post: 05-13-2006, 01:23 PM
  3. I don't want to logs to be kept anymore. How can I turn them off?
    By Vatoloco in forum cPanel and WHM Discussions
    Replies: 5
    Last Post: 01-31-2005, 04:44 AM
  4. Frontpage don't work after latest security Apache compiling
    By speckados in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 06-08-2004, 05:42 PM
  5. Additional FTP accounts don't work anymore
    By cyon in forum cPanel and WHM Discussions
    Replies: 7
    Last Post: 05-11-2004, 09:32 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube