The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

httpd not restarting from time to time

Discussion in 'General Discussion' started by Lem0nHead, Jan 13, 2006.

  1. Lem0nHead

    Lem0nHead Well-Known Member

    Joined:
    Sep 2, 2003
    Messages:
    69
    Likes Received:
    0
    Trophy Points:
    6
    hello

    I'd like to know if it already happened to someone else, and how it was fixed (if was)...
    from time to time (once a week or once 2 weeks) my httpd fails on Linux RedHat EL and doesn't restart
    when I try to restart it using
    # service httpd start
    or
    # service httpd restart
    it just says it was started, but isn't
    then I have to do a
    # service httpd stop
    # killall httpd
    # service httpd start

    then it starts
    probably some childs died, or the main process... don't know... but it's needed to make it restart, otherwise the :80 port will be taken and it won't get to bind on it

    my first idea is to check logs, right?
    good, but I don't know if it's cause or consequence, but right after that the /etc/httpd/logs/ are (almost) empty and has creation time =~ the time of the error!

    my guess:
    - /usr/local/bandmin/bandmin (any chances?)
    - log rotate (maybe apache gets "confused" and die if a log rotate happens?) - I don't think it's probably... but I wouldn't see why the log file would be empty

    any suggestions for finding the cause or fixing it?
    or maybe I'll try to "fix" adding a check on (re)start script, making it try to "killall httpd" before starting, but I don't think it would be really a good idea...

    thanks
     
  2. aby

    aby Well-Known Member

    Joined:
    May 31, 2005
    Messages:
    638
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    India
    please do check

    /usr/local/apache/logs/error_log for getting more information. Also make sure that apache is enabled in the chkservd
    so thatit will automatically restarts if found failed.
     
  3. Lem0nHead

    Lem0nHead Well-Known Member

    Joined:
    Sep 2, 2003
    Messages:
    69
    Likes Received:
    0
    Trophy Points:
    6
    I have apache enabled on chkservd, but it doesn't fix it
    (my guess: it tries to use the "restart" command, but it doesn't killall before)

    here's what I found on /usr/local/apache/logs/error_log

    so looks like it really have problems with childs not exiting...
     
  4. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    Indeed. Restart has always been a dubious option with apache because if you have busy child processes it can take some time for apache to exist. It's much kinder, anyway, to restart apache with:

    httpd graceful

    Unless you have a particular need to kill off httpd entirely, and if you do, then use:

    httpd stop

    at least twice to ensure that's it's dead, then start it up again with:

    httpd startssl
     
  5. shacker23

    shacker23 Well-Known Member

    Joined:
    Feb 20, 2005
    Messages:
    263
    Likes Received:
    1
    Trophy Points:
    16
    For the past few months, Apache on my server will not start with "httpd start", not even upon boot. The only way to start Apache is "httpd graceful." "httpd start" does not produce any immediately obvious errors - it acts like it's started correctly, but no httpd processes are launched. This means httpd does not start automatically when the server is rebooted - I always have to start it manually with "graceful."

    If I tail the apache error log when running "httpd start," even if apache is not running and there are no httpd threads, I see this:

    Code:
    [crit] (98)Address already in use: make_sock: could not bind to port 80
    But using graceful from a dead stop, I don't get this error and everything starts up normally.

    Very weird. Any ideas what could be causing this or how to fix? Thanks.
     
Loading...

Share This Page