HOWTO : Mod_Bandwidth for DA

The pulse is the latence that use the module in order to limit the bandwidth ... from what I understand :P

For my problem I have found a way that prevent this error. Simply move those directory to a new spot ... like /apachebw
Just make sure to make the changes in your httpd.conf :P
 
Can't get it to work

I have:

httpd.conf:
<IfDefine HAVE_BANDWIDTH>
LoadModule bandwidth_module modules/mod_bandwidth.so
</IfDefine>

<IfDefine HAVE_BANDWIDTH>
AddModule mod_bandwidth.c
</IfDefine>

<IfModule mod_bandwidth.c>
BandWidthDataDir /tmp/apachebw
BandWidthModule On
BandWidthPulse 500000
</IfModule>

/usr/local/directadmin/data/user/{username}/httpd.conf
<VirtualHost 12.34.56.78:80>

BandWidthModule On
ServerName www.xyz.com
ServerAlias www.xyz.com xyz.com
ServerAdmin [email protected]
DocumentRoot /home/xyz/domains/xyz.com/public_html
ScriptAlias /cgi-bin/ /home/xyz/domains/xyz.com/public_html/cgi-bin/

User xyz
Group xyz
CustomLog /var/log/httpd/domains/xyz.com.bytes bytes
CustomLog /var/log/httpd/domains/xyz.com.log combined
ErrorLog /var/log/httpd/domains/xyz.com.error.log

<Directory /home/xyz/domains/xyz.com/public_html>
BandWidth all 25600
Options +Includes -Indexes
php_admin_flag engine ON
php_admin_flag safe_mode OFF
</Directory>



#php_admin_value open_basedir /home/xyz/:/tmp/:/var/www/:/usr/local/lib/php/:/etc/virtual/

</VirtualHost>

after service httpd restart i get:
Syntax error on line 13 of /usr/local/directadmin/data/users/xyz/httpd.conf:
Invalid command 'BandWidthModule', perhaps mis-spelled or defined by a module not included in the server configuration
[FAILED]

I've checked the directory:
ll /etc/httpd/modules/mod_bandwidth.so
ls: /etc/httpd/modules/mod_bandwidth.so: No such file or directory

So is it not default installed??? If so, how do I get it installed?
 
done that

done that allready, and it's working. I got confused by the remarks that DA included this mod by default. :D

Thx anyhow
 
mm

Seting a value with "BandWidthPulse", will change the algorithm so that the server will always wait the same amount of time between sending packets but the size of the packets will change. The value is in microseconds. For example, if you set "BandWidthPulse 1000000" (1 sec) and the bandwidth available is of 512B, the sever will transmit 512B, wait 1 second, transmit 512B and so on.
 
hi guy

i got a question is

is BandWidth all 25600 mean one ip bandwidth or the whole ip bandwidth?
 
I wish someone would write a DA plugin for mod_bandwidth, with options for:

1. install mod_bandwidth
2. uninstall mod_bandwidth
3. modify bandwidth settings for all users
4. modify bandwidth settings per user
5. list all users with their bandwidth settings

In case you're reading this jon, maybe an idea for jtbox? ;)
 
is it possible with this to have it work with a certain process? such as shoutcast, so lets say i have a shoutcast plan set got 64kbps and want to have it at that speed but also maintaining 100mbps on web browsing on the site for 1 certain account??
 
Hi, I`ve got everything on place, mod_bandwidth.so is in modules etc, and it is loaded, but I`m getting this
Syntax error on line 12 of /usr/local/directadmin/data/users/download/httpd.conf:
Invalid command 'BandWidthModule', perhaps mis-spelled or defined by a module not included in the server configuration
master:/etc/httpd# mcedit /usr/local/directadmin/data/users/download/httpd.conf

when I add after
<VirtualHost 80.86.84.29:80>
BandWidthModule On

.... everything is set ok... I have to add <ifmodule mod_bandwidth.c> to havent errors, but then bandwidth does not work :/ have u got any ideas? apache 1.3.
 
I have followed all the instructions on first post and if I place the code below in httpd.conf any where as mentioned by the author of this thread I was not able to get mod_bandwidth to work.

I have got it working on when I placed the code as below above <IfModule mod_userdir.c>

Code:
<IfModule mod_bandwidth.c>
BandWidthDataDir /tmp/apachebw
BandWidthModule On
BandWidth all 25600
</IfModule>

<IfModule mod_userdir.c>
    #UserDir public_html
    UserDir disabled
</IfModule>

I am not sure why, may be some conflict in order or something when placed anywhere. But placing the mod_bandwidth code as shown above worked for me.
 
Last edited:
Back
Top