How to install 'mod_throttle' in apache ?

billau

Well-Known Member
Dec 24, 2003
63
0
156
Brisbane, Australia
WARNING :: You should not install 'mod_throttle' in any SHARED WEB SERVER if you do that it may violate the existing bandwidth modules install in your server::

Ok! Here are the steps to install 'mod_throttle' in your web server (Please install it in your test mechain before proceeding)

What is 'mod_throttle' ?

The Apache module, mod_throttle gives you the ability to further focus your client's bandwidth usage. Instead of giving them 30 GB/Month, how about giving them 1 GB/Day? Or 42 MB/Hour? Even 11KB/sec? You get the idea. Well to do that we need to install 'mod_throttle' ::


SSH into your box and do the following:

mkdir /home/src
cd /home/src

wget http://www.snert.com/Software/mod_throttle/mod_throttle312.tgz

tar zxvf mod_throttle312.tgz

cd mod_throttle-3.1.2

pico Makefile

In the Makefile, you should change this line:

APXS=apxs


Now save this file, and continue to compile..

make
make install


Now, restart apache:

/usr/local/apache/bin/apachectl restart



That's it now it's installed!


To use 'mod_throttle' for your virtual hosts ::

Find the line:

</virtualhost>


At the end of whichever domain you want to throttle, right above this line, insert these lines:

<IfModule mod_throttle.c>
ThrottlePolicy Volume 1G 1d
</IfModule>
<Location /throttle-me>
SetHandler throttle-me
</Location>


Now, also go to the very first virtual host entry, and add these lines:

<Location /throttle-status>
SetHandler throttle-status
</Location>


This is all you have to do, you can check the statistics for throttling, by going to the URL:

http://www.example.com/throttle-me

If you would like to check the stats on all the throttled domains you can go to:

http://www.example.com/throttle-status
 

Worelock

Active Member
Mar 23, 2004
37
0
156
not working anymore

I had this setup on the server at one stage and it was working fine.
Somewhere along the line of updates I have lost the ability to see the throttle-status pages.

I have mod_throttle-3.1.2
changed the paths to the correct once for APXS and APACHECTRL
did make
make install

I have this in the config file right under whm-serverstauts entries.

<IfModule mod_throttle.c>
ThrottlePolicy none
<Location /throttle-status>
SetHandler throttle-status
AuthType Basic
AuthName "Administrators Only"
AuthUserFile /usr/local/apache/passwd/passwords
Require user admin
</Location>

It asks for the Username and password but then 404's
I have restarted the server since installing the mod.....many times!

Anyone got any ideas on this

Thanks in advance.
Paul