domus
03-10-2001, 02:06 PM
ok i have a porn site and it's behind a age verification system and now i have problems with guys who download like 5-15 movies in same time and then the consume a lot of bandwith so server get's slow in some times
is there any way to limit the number of connections to a server from 1 ip address
i wwwas thinking to limit it to 2 per ip
thnx in advance
Well.. I've never done it but I may have to for my site and this is one way to do it...
Throw all your big files in a certain directory (which can have subdirs, etc).. say if your files are in /home/web you have a dir called /home/web/moviedownload
Set up a perl/php script to redirect to the file -- only allow redirection if the user isn't downloading like you say, 2 files at once already...
One way I can think of doing this is to have lynx do an ascii dump of http://www.yourhostname/server-status and then grep that according to the user's ip & the string moviedownload -- if the line count is equal to 2 then you know they've reached their limit already and you can deny them from getting another file
namehog
03-12-2001, 02:14 PM
Hi,
I just saw above the server-status after the domain name, i have found it in the conf files before but dont know what it does?
I go to it afer the domain name and it says file not found.
Do you have to enable it somewhere? What does it do, can anyone show me an example of it?
Thanks,
spock
03-13-2001, 06:49 PM
I haven't experimented with this, but I think a more reliable way to limit the number of connections/host would be through an Apache module. I did a quick search and came up with two:
mod_conn
http://programmer.lib.sjtu.edu.cn/apache/modules.html
mod_limitipconn
http://dominia.org/djao/limitipconn.html
Originally posted by spock
mod_limitipconn
http://dominia.org/djao/limitipconn.html
Use this one -- the module version (the mod_perl version didn't work for me...)
This thing works nicely - you can limit by directory, MIME type, etc.. very nice.
Even gives you a log entry:
[Tue Mar 13 21:48:17 2001] [error] access to /music/3.mp3 failed for 127.0.0.1 , reason: Client exceeded connection limit.
:)
Thanks.
domus
03-14-2001, 08:38 AM
can someone tell me how to install modules on my raq4 ?
thnx
http://programmer.lib.sjtu.edu.cn/apache/modules.html
this one i would like to install