Pele Oleosa - Myspace Comments - Homeowner Loans - Record Internet Radio with Tags - Loans

PDA

View Full Version : Bandwidth limiting


xxsAm
Aug 7th 2007, 9:14 pm
I run a chain of proxy sites and bandwidth is becoming a major problem. What I'm looking to do is to find a module that allows me to block a user's ip if they exceed a limit of say 50mb for the day, and then forward them to a site stating that they have been blocked for 24 hours. Anyone know of a module or addon that can do this?

powerspike
Aug 7th 2007, 10:13 pm
http://www.cohprog.com/mod_bandwidth.html


that might be what your looking for

also make sure that your not getting relay links at all

that's where a site (usally porn) links all it's images via a proxy site to the images, so that the site itself can't get blocked, and has low bandwidth usage.

xxsAm
Aug 7th 2007, 10:57 pm
http://www.cohprog.com/mod_bandwidth.html


that might be what your looking for

also make sure that your not getting relay links at all

that's where a site (usally porn) links all it's images via a proxy site to the images, so that the site itself can't get blocked, and has low bandwidth usage.


I assume you are referring to hotlinking. I have hotlinking disabled within phproxy.

powerspike
Aug 7th 2007, 11:41 pm
there are ways around it, if you check your referer logs, if there is a high amount of hits from one place you know they are doing it =)

xxsAm
Aug 8th 2007, 3:48 am
there are ways around it, if you check your referer logs, if there is a high amount of hits from one place you know they are doing it =)

How can i prevent the ways around it? Also where is the referrer log located? I googled it but the place where i found it is suppose to reside it is not there(/var/log/apache/referer.log).

powerspike
Aug 9th 2007, 4:22 pm
Logs depend on the setup of the server
you should have some type of stats package enabled (like awstats)

most stats packages have a referer section in them so you could see where traffic is coming from.
The code you posted in the other thread, try moving down the code to after the url is decoded, if that doesn't work
you can find out which referers are sending the hotlinks and and put in some code that kills the script if it comes from that source.

It's been a while since i have played with proxy's so am unsure on where it would be, and i used cgiproxy at the time so that would be even less help =)

xxsAm
Aug 10th 2007, 8:56 am
I used the below code and its worked wonders the past 24 hours. Bandwidth per hour went from around 10-15 to 2-3. Just placed it at the top of index.php

/*
PHProxy bandwidth MOD 1.1 by Rhett Canney (Billy Connite)
This MOD will stop any hotlinking via PHProxy, even if the
clients referer is not set!
Check out proxywebsite.org if you want to try hotlinking.
*/

// allow hotlinking from these sites, seperate by comma (make sure you eneter your site's domains)
$domains="www.yourdomain.com,yourdomain.com";

// convert domains into an array
$domains=explode(",",$domains);

// if there is a request:
if($_GET['q']!="")
{
// get referer
$referer=explode("/",($_SERVER['HTTP_REFERER']));
// if the referer is not allowed:
if(!in_array($referer[2],$domains))
{
// redirect to homepage and finish script
header("Location: http://".$domains[0]."/");

exit();
}
}

/*
END MOD
*/