PDA

View Full Version : mod_cband


Titam
2nd July 2006, 03:38
Hi !

I have FC4, and Apache 2. I just install mod_cband, and it doesn't work at all :\ I did as you said in the tuto

There is a part of my vhost :

<VirtualHost MY.ADRE.SS.IP>
ServerName sub.domain.com/msrlz
DocumentRoot /home/msrlz
CBandSpeed 10kb/s 1 1
CBandRemoteSpeed 1kb/s 1 1
<Directory "/home/msrlz/">
#allow from all
Options -Indexes
</Directory>
</VirtualHost>

And that didn't work :'( I don't know what to do (this value was just to test, i tested others and same things)

Ty for your help

falko
3rd July 2006, 10:46
Any error messages, also in the Apache error log?

BTW,

ServerName sub.domain.com/msrlz

is wrong. Should be

ServerName sub.domain.com

Titam
3rd July 2006, 13:29
Hi !

I have no error message, just

[Sun Jul 02 01:20:42 2006] [notice] mod_bw : Memory Allocated 28 bytes (each conf takes 28 bytes)
[Sun Jul 02 01:20:42 2006] [notice] mod_bw : Version 0.7 - Initialized [1 Confs]


For the sub.domain.com/msrlz, it's because i want only the cband on this sub.domain.com/msrlz and not on the all sub.domain.com
But maybe if i put just sub.domain.com in the good vhost it will work ?

Titam
3rd July 2006, 13:44
I just tested and if i put just sub.domain.com in my vhost, this limit is apply at all the directories, sub.domain.com/dir1, sub.domain.com/dir2, etc. And I just want an limitation in 1 directory, sub.domain.com/dir1 and not on dir2

I tried too to put an other limit in other vhost, and the highest limit is apply.
If you want to look my vhost :


<VirtualHost MY.ADD.RESS.IP> <----- The VH where i want the limitation
DocumentRoot "/home/gardiensfl"
ServerName sub.domain.com/gardiensfl

CBandSpeed 300kb/s 1 1
CBandRemoteSpeed 300kb/s 1 1


<Directory "/home/gardiensfl">
allow from all
Options -Indexes
</Directory>
</VirtualHost>

<VirtualHost MY.ADD.RESS.IP> <-------- i want no limit
ServerName sub.domain.com/msrlz
DocumentRoot "/home/msrlz"

<Directory "/home/msrlz/">
#allow from all
Options -Indexes
</Directory>
</VirtualHost>

<VirtualHost MY.ADD.RESS.IP> <-------- i want no limit
DocumentRoot "/home/balkan"
ServerName sub.domain.com/balkan
<Directory "/home/balkan">
allow from all
Options -Indexes
</Directory>
</VirtualHost>

falko
4th July 2006, 00:17
If you want the limits just for a specific directory, you must use the <Directory> directive in your vhosts and put the limits there. Have a look here: http://httpd.apache.org/docs/2.0/mod/core.html#directory

But ServerName sub.domain.com/msrlz is definitely wrong!

Titam
4th July 2006, 07:10
Hello,

I can't limit download's speed with apache directive ... anyway i found a solution :) As I don't want to modify URL (sub.domain.com/dir 1, etc.) of my users, and as that did'n work with mod_cband, i put in DNS a newsub.domain.com, and in my httpd.conf
...

Redirect permanent /gardiensfl http://newsub.domain.com

...

<VirtualHost MY.ADD.RESS.IP> <----- The VH where i want the limitation
DocumentRoot "/home/gardiensfl"
ServerName newsub.domain.com
CBandSpeed 300kb/s 1 1
CBandRemoteSpeed 300kb/s 1 1
<Directory "/home/gardiensfl">
allow from all
Options -Indexes
</Directory>
</VirtualHost>

....

And now it's working :)

thecgmguy
23rd October 2008, 07:46
Really sorry to dig up an old thread but I'm having pretty much the same issue.

I have a fileshare portion of my site: https://www.example.com/fileshare/

I want to impose a download limit for ONLY that directory.

But I get an error whenever I put the cbandspeed parameter in the <Directory "/home/fileshare"> section.

I'd prefer not to setup a subdomain. Any ideas?

Thanks!

thecgmguy
23rd October 2008, 08:00
In retrospect, I'd be happy if it worked on that directory at all...

After doing more testing, it seems like cband only picks up on traffic attempts that are pulling data from the root directory or one of the corresponding sub-directories.

Due to funky partitions on my server, I need to move the fileshare repository to a completely seperate location... it's like cband isn't seeing it at all.

thecgmguy
23rd October 2008, 21:21
*bump* Sorry to bug. Any thoughts? :)

falko
24th October 2008, 21:08
Are there any errors in Apache's error log?
Can you post your vhost configuration?