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.

Cron to restart httpd

Discussion in 'General Discussion' started by casey, Mar 30, 2003.

Thread Status:
Not open for further replies.
  1. casey

    casey Well-Known Member

    Joined:
    Jan 17, 2003
    Messages:
    2,303
    Likes Received:
    0
    Trophy Points:
    36
    Location:
    If there is trouble, it will find me
    I'm not familiar with cron jobs, so would anybody be so kind as to tell me how to make a cron job to restart httpd every 10 minutes? WHM never notices when it dies, so it just stays dead until I restart it manually. I went away this weekend and the bugger stopped for two days. It would be a disaster if this happened after I open the server to clients--even though I don't plan on leaving it unmonitored that long once I do.

    How does everyone else handle this problem?
     
  2. hostcp3

    hostcp3 Well-Known Member

    Joined:
    Jun 18, 2002
    Messages:
    156
    Likes Received:
    0
    Trophy Points:
    16
    Sent you a PM

    but basically something like this works

    Command

    lynx -cookies -dump -auth=root:your_root_password_here http://your_main_server_ip_here:2086/scripts/reshttpd


    all the above on one line in your Control panel cron manager.



    Minute Hour Day Month Weekday

    */10 * * * *


    If you are having load problems let me know, I did a small change to httpd.conf which reduced my server load by 500% at peak times.
     
  3. Networkologist

    Networkologist Well-Known Member

    Joined:
    Feb 5, 2003
    Messages:
    209
    Likes Received:
    0
    Trophy Points:
    16
    Lurking...

    Wouldn't know if 10 minutes or 10 hours is the best setting, but I'd appreciate a copy
     
  4. celliott

    celliott Well-Known Member

    Joined:
    Jan 2, 2006
    Messages:
    460
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    United Kingdom
    */10 * * * * - So this will run the cron every 10 minutes?
     
  5. mohit

    mohit Well-Known Member

    Joined:
    Jul 12, 2005
    Messages:
    553
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Sticky On Internet
    Re:

    casey,
    i don't think you should be doing this to your box, if your apache crashes it would be best to solve the problem just restarting it using a cron would not solve the problem and it could happen more frequently when you have traffic to serve.

    If you have hired it with some service provider he might be able to solve the issue, if you raise the ticket with them.

    you can also look for errors in error logs and find out the exact cause or you can ask a system admin to do it for you.

    After all even 10Mins of downtime would not be liked by any clients if you are serious in hosting biz.

    see ta,
    mohit
     
  6. casey

    casey Well-Known Member

    Joined:
    Jan 17, 2003
    Messages:
    2,303
    Likes Received:
    0
    Trophy Points:
    36
    Location:
    If there is trouble, it will find me
    This is a 3 year old thread. I don't do that anymore. ;)
     
Loading...
Thread Status:
Not open for further replies.

Share This Page