Post Reply  Post Thread 
mod_bandwidth Installation
Author Message
Nilesh
Super Moderator
******


Posts: 42
Group: Super Moderators
Joined: Jul 2007
Status: Offline
Reputation: 0
Thank 0
0 was given thank in 0 posts
Post: #1
mod_bandwidth Installation

Following are the step to install mod_bandwidth for apache.

1. Login to your server via SSH as root.

2. Type: mkdir /root/mod_bw

3. Type: cd /root/mod_bw

4. Type: wget ftp://ftp.cohprog.com/pub/apache/module/...andwidth.c

5. Type:

Quote:
/usr/local/apache/bin/apxs -c /root/mod_bw/mod_bandwidth.c -o /usr/local/apache/libexec/mod_bandwidth.so

6. Type: mkdir /usr/local/apache/bw_limit

7. Type: mkdir /usr/local/apache/bw_limit/link

8. Type: mkdir /usr/local/apache/bw_limit/master

9. Type: pico -w /etc/httpd/conf/httpd.conf

10. Locate the following Line:

Quote:
LoadModule rewrite_module libexec/mod_rewrite.so


11. Before the above line add this:

Quote:
LoadModule bandwidth_module libexec/mod_bandwidth.so


12. Now locate this line: AddModule mod_env.c

13. Before the above line add this:

Quote:
AddModule mod_bandwidth.c


14. Now locate this line: # Document types.

15. Before the above line add this:

Quote:
BandWidthDataDir "/usr/local/apache/bw_limit"
BandWidthModule On

16. To enable mod_bandwidth on a virtual host locate the virtual host entry for the specified domain/acount you wish to limit. Just before the line add the following:

Quote:
BandWidthModule On
BandWidth all 512


The 512 can be replaced with whatever rate you wish to limit the acount too.

17. Save the file and exit.
CTRL-X then Y then enter.

18. Type: service httpd restart

19. Type: cd /usr/sbin

20. Type: wget ftp://ftp.cohprog.com/pub/apache/module/cleanlink.pl

--------------------------------------------------------------------------------

What is cleanlink?
Cleanlink is a deamon that is used to clean links created by mod_bandwidth when they aren't removed properly by the server. (When a httpd process doesn't terminate the usual way.)

--------------------------------------------------------------------------------

21. Type: chmod 755 cleanlink.pl

22. Type: pico -w cleanlink.pl

23. Change $LINKDIR to the following:
$LINKDIR="/usr/local/apache/bw_limit/link";

24. Save the file and exit.
CTRL-X then Y then enter.

25. Type: perl cleanlink.pl

26. Type: pico -w /etc/rc.d/rc.local

27. Scroll down to the very end of the file and add the following:
# The following line Launches CleanLink for Mod_Bandwidth
perl /usr/sbin/cleanlink.pl

28. Save the file and exit.
CTRL-X then Y then enter.

mod_bandwidth has many options. If you wish to modify mod_bandwidth and enable more options please visit the documentation available by the programmer here: http://www.cohprog.com/v3/bandwidth/doc-en.html


~~~ Cool Buddy ~~~

ADD TO DEL.ICIO.US  ADD TO DIGG  ADD TO FURL  ADD TO NEWSVINE  ADD TO NETSCAPE 
ADD TO TECHNORATI FAVORITES  Technorati ADD TO SQUIDOO  ADD TO WINDOWS LIVE  ADD TO YAHOO MYWEB  ADD TO ASK 
ADD TO REDDIT  ADD TO STUMBLEUPON  ADD TO GOOGLE   

07-15-2007 10:30 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply  Post Thread 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Mod_Security installation Nilesh 0 365 07-15-2007 10:41 AM
Last Post: Nilesh
  Mod_python Installation Nilesh 0 281 07-15-2007 10:38 AM
Last Post: Nilesh
  Mod_evasive Installation Nilesh 0 280 07-15-2007 10:32 AM
Last Post: Nilesh
  Mod_auth_mysql Installation Nilesh 0 229 07-15-2007 10:27 AM
Last Post: Nilesh

View a Printable Version
Send this Thread to a Friend
Subscribe to this Thread | Add Thread to Favorites

Forum Jump: