spacer.png, 0 kB
spacer.png, 0 kB
Home arrow All Articles arrow Web Hosting Articles arrow How To Install mod_bandwidth

Subscribe to our news and articles by RSS or by email
How To Install mod_bandwidth Print E-mail

What is Mod_Bandwidth? (What is mod bandwidth?)

"Mod_bandwidth" (mod bandwidth) is a module for the Apache webserver that enable the setting of server-wide or per connection bandwidth limits, based on the directory, size of files and remote IP/domain.

For Apache 1.3x. ONLY! This how-to is not compatible with old versions of apache, including but not limited to 1.3beta

How to install mod_bandwidth

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/mod...od_bandwidth.c

5. Type: /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: LoadModule rewrite_module libexec/mod_rewrite.so

11. Before the above line add this: LoadModule bandwidth_module libexec/mod_bandwidth.so

12. Now locate this line: AddModule mod_env.c

13. Before the above line add this: AddModule mod_bandwidth.c

14. Now locate this line: # Document types.

15. Before the above line add this: 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: 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

Original: http://www.ukwebmasterforums.com/t4907-how-to-install-modbandwidth.html

Web Hosting UK (http://www.session9.co.uk/ )

Webmaster Forums ( http://www.ukwebmasterforums.com/ )

Web Hosting Affiliate ( http://www.session9.co.uk/web-hosting-affiliate/ )

Domain Reseller ( http://www.domainvendor.co.uk/ )


About the Author

Web Hosting UK (http://www.session9.co.uk/ )

Webmaster Forums ( http://www.ukwebmasterforums.com/ )

Web Hosting Affiliate ( http://www.session9.co.uk/web-hosting-affiliate/ )



SurgeMatrix Technologies is a value leader in web hosting technologies with 24/7 support system.

Web hosting and design professionals. Providing a 100% Uptime money back guarantee on all accounts.

We offers hosting from $3.95. Domain Names and Privacy Protection from $11.95

Domains, Web Hosting, Dedicated Servers, E-commerce, SSL Certificates, Merchant Accounts & Tools.

Web hosting: Free setup/domain, unlimited emails, As low as $7.50/month. Only $50/year.

Affordable Web Hosting, Money Back Guarantee. 24/7 live support, and Web site builder!

Top Web hosting, domain registration, search submission reviewed for you.

Get quality hosting at ASWhosting. Email PHP MySQL cPanel Fantastico and true 24/7 support. Only $3.

Affordable and reliable one stop shop for e-commerce and internet hosting with 24/7 support.

Business and personal web hosting. Starting at $3.95 a month. No setup fees.

Related Items:

 
< Prev   Next >
spacer.png, 0 kB
spacer.png, 0 kB
spacer.png, 0 kB