Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Apache is hung and don't work anymore

Discussion in 'EasyApache' started by bjarne, May 26, 2003.

  1. bjarne

    bjarne Well-Known Member

    Mar 23, 2002
    Likes Received:
    Trophy Points:
    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

    /usr/local/apache/bin/apachectl stop
    sleep 3
    rm -f /usr/local/apache/logs/
    /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!
    #1 bjarne, May 26, 2003
    Last edited: May 26, 2003

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice