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.

hotlink protection (mod_rewrite) cause apache overload

Discussion in 'EasyApache' started by MMarko, May 25, 2005.

  1. MMarko

    MMarko Well-Known Member

    Joined:
    Apr 18, 2005
    Messages:
    316
    Likes Received:
    0
    Trophy Points:
    16
    This is the htaccess that kill whole apache (server load goes over 120!)

    This htaccess is made by cPanel hotlink protection script.

    Please help. I need hotlink protection on my server. Thx.

    htaccess code:

    RewriteEngine on
    RewriteCond %{HTTP_REFERER} !^http://example.com/.*$ [NC]
    RewriteCond %{HTTP_REFERER} !^http://example.com$ [NC]

    /* here is same RewriteCond as above for 62 domains */

    RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ - [F,NC]
     
  2. bijo

    bijo Well-Known Member

    Joined:
    Aug 21, 2004
    Messages:
    475
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    India
    Hello,

    I think, this .htaccess file has no problem. Is it working on your server?.
    Did you check the apache access and error log?.
    You can find out the exact solution from top and netstat command.
    Please check the apache and mysql usage status from WHM.
    Also check the apache configuration.
    May be it will help you to solve this issue.

    let me know the status.
     
  3. MMarko

    MMarko Well-Known Member

    Joined:
    Apr 18, 2005
    Messages:
    316
    Likes Received:
    0
    Trophy Points:
    16

    This htaccess is not working obviously. It overloads apache. Netstat is showing normal amount of connections and top is showing that couple httpd process are gone wild.

    Mysql is normal.

    Apache configuration is ok.

    Only (and only on one account!) this htaccess with 62 domain rules overloads it.
     
  4. MMarko

    MMarko Well-Known Member

    Joined:
    Apr 18, 2005
    Messages:
    316
    Likes Received:
    0
    Trophy Points:
    16
    Configuration is setup as above.

    I've noticed something else. When this htaccess file is in /public_html it kills server (ie load goes over 100). When I delete it load is normal about 0.4-0.8.

    The problem is definitely mod_rewrite. I've also posted a problem on mod_rewrite forum. Maybe it's not meant to have 60+ domain rules in one htaccess file.
     
Loading...

Share This Page