1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

I wan to restart apache every hour

Discussion in 'Apache' started by energetic, Sep 24, 2007.

Thread Status:
Not open for further replies.
  1. #1
    I found that the apache service in my server is alway hang.
    I wan to restart apache every hour, do you know how to do it ?
    in cronjobs setting ?
     
    energetic, Sep 24, 2007 IP
  2. guruhowto

    guruhowto Guest

    Messages:
    75
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Restarting your server every hour is not the best solution. You would also not want it even....

    You can check your error logs to see what happened and fix it from there.
     
    guruhowto, Sep 24, 2007 IP
  3. energetic

    energetic Well-Known Member

    Messages:
    2,844
    Likes Received:
    55
    Best Answers:
    0
    Trophy Points:
    165
    #3
    Thanks .which log file I should investigate ?


     
    energetic, Sep 24, 2007 IP
  4. guruhowto

    guruhowto Guest

    Messages:
    75
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    guruhowto, Sep 24, 2007 IP
    energetic likes this.
  5. energetic

    energetic Well-Known Member

    Messages:
    2,844
    Likes Received:
    55
    Best Answers:
    0
    Trophy Points:
    165
    #5
    I still have no idea :(
     
    energetic, Sep 24, 2007 IP
  6. login

    login Notable Member

    Messages:
    8,849
    Likes Received:
    349
    Best Answers:
    0
    Trophy Points:
    280
    #6
    Do you run proxies on the server? If you use cgi proxy it can hang, try to change to zelune or phproxy.
     
    login, Sep 24, 2007 IP
    energetic likes this.
  7. it career

    it career Notable Member

    Messages:
    3,562
    Likes Received:
    155
    Best Answers:
    0
    Trophy Points:
    270
    #7
    
    http://www.adminschoice.com/docs/crontab.htm#Example
    
    Code (markup):
    could help you.
     
    it career, Sep 24, 2007 IP
    energetic likes this.
  8. energetic

    energetic Well-Known Member

    Messages:
    2,844
    Likes Received:
    55
    Best Answers:
    0
    Trophy Points:
    165
    #8
    I have already use php proxy script

     
    energetic, Sep 24, 2007 IP
  9. energetic

    energetic Well-Known Member

    Messages:
    2,844
    Likes Received:
    55
    Best Answers:
    0
    Trophy Points:
    165
    #9
    Thanks to all. I have given REP to all.
     
    energetic, Sep 24, 2007 IP
  10. login

    login Notable Member

    Messages:
    8,849
    Likes Received:
    349
    Best Answers:
    0
    Trophy Points:
    280
    #10
    Then block file sharing sites in .htaccess. Also block big file downloads. And redirect all direct requests to other pages than the home page back to the home page.
     
    login, Sep 24, 2007 IP
  11. energetic

    energetic Well-Known Member

    Messages:
    2,844
    Likes Received:
    55
    Best Answers:
    0
    Trophy Points:
    165
    #11
    can you tell me how ?
    any reference ?

     
    energetic, Sep 25, 2007 IP
  12. login

    login Notable Member

    Messages:
    8,849
    Likes Received:
    349
    Best Answers:
    0
    Trophy Points:
    280
    #12
    Put this in .htaccess, add any sites that leech from you:

    RewriteEngine on
    # Options +FollowSymlinks
    RewriteCond %{HTTP_REFERER} megarotic\.com [NC]
    RewriteCond %{HTTP_REFERER} megaupload\.com
    RewriteCond %{HTTP_REFERER} depositfiles\.com
    RewriteCond %{HTTP_REFERER} fury-tech\.com
    RewriteCond %{HTTP_REFERER} rapidcat\.us
    RewriteRule .* - [F]

    ErrorDocument 404 http://www.yourproxysite.com
     
    login, Sep 25, 2007 IP
  13. Scriptona

    Scriptona Notable Member

    Messages:
    4,957
    Likes Received:
    265
    Best Answers:
    0
    Trophy Points:
    280
    #13
    Better than restarting apache every hour, try to know what's wrong with it

    check the server CPU/RAM usage and see if your server i highly loaded then this might be the cause to crash apache

    Also try to tweak apache config file httpd.conf - consult your server provider or serach google for apache optimization ;)
     
    Scriptona, Sep 30, 2007 IP
  14. ThreeGuineaWatch

    ThreeGuineaWatch Well-Known Member

    Messages:
    1,489
    Likes Received:
    69
    Best Answers:
    0
    Trophy Points:
    140
    #14
    And if you do resort to an hourly restart, make sure you send a SIGUSR1 by using the "graceful" switch. This will then honour current connections and be transparent for users.
     
    ThreeGuineaWatch, Oct 5, 2007 IP
Thread Status:
Not open for further replies.