WebHostGear.com - the hosting resource for professionalshosting tutorials 
hosting howto webhost guide server managementFebruary 09, 2010
server management, apache tutorials, hosting tutorials, cpanel, server security
Home / Hosting Tutorials / cPanel Hosting / Installing Mod_Throttle on cPanel

Installing Mod_Throttle on cPanel



Printer Friendly Printer Friendly Send to a friend Send to a friend
By : Jon Rating : Average Rating : 7.20 From 15 Voter(s)

This Apache module is intended to reduce the load on your server & bandwidth generated by popular virtual hosts, directories, locations, or users according to supported polices (see below) that decide when to delay or refuse requests. Also mod_throttle can track and throttle incoming connections by IP address or by authenticated remote user.

Every request now passes through four levels of throttling, which are: by client's IP address (ThrottleClientIP), by authenticated remote user name (ThrottleRemoteUser), by local user ID (ThrottleUser), and by directory, location, virtual host, or server (ThrottlePolicy).

To install with cPanel, SSH into your server as root and perform the following:

cd /usr/src



Article provided by WebHostGear.com

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

tar zxvf mod_throttle312.tgz

cd mod_throttle-3.1.2

pico Makefile

Then edit the line that reads:

APXS=apxs

And change it to read:

APXS=/usr/local/apache/bin/apxs

Save the file and then:

make

make install

service httpd restart

Usage

Best bet is to go to http://www.snert.com/Software/mod_throttle/ and read up on all the options, but I will give you an example of limiting a site, and how to monitor all your throttled sites status.

Edit your /etc/httpd/conf/httpd.conf and locate the virtualhost entry for the site you wish to throttle. Just BEFORE the </VirtualHost> entry, insert:

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

The ThrottlePolicy line is the key. The first number is the amount of data and acceptable letters are G, M and K. The second number is the period and acceptable letters are m, w, d, h, and s.

Then restart Apache (service httpd restart) Now you can go to:

http://throttleddomain.com/throttle-me

And see the status of the throttle.

If you want to be able to see the status of all throttled sites on the server at once, go to the first virtualhost entry in your httpd.conf file (this should be the entry for your server's hostname) and add the following:

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

Then restart Apache again, and you can go to http://host.name.com/throttle-status and see the status of all throttled sites.

Enjoy!

New! - Need server help? Hire an Expert

Get professional help with your configuration, script installation or server issue.
Learn how we can help you with any server problem and make your server run like new. Professional staff will contact you, after submitting a quote request, by phone or email.

Rate this Article :

1

2

3

4

5

6

7

8

9

10
Poor Excellent

Related Articles


Official Cpanel Newbie Guide
Force (SSL) secure logins in WHM and Cpanel
Setting up Private Nameservers in Cpanel
Securing Your /tmp Partition with Cpanel/WHM
Fix Cpanel Quotas
Linux Apache ASP for Cpanel
Howto mod_rewrite with Apache
cPanel Apache Security Hole Alert
Updating Apache using Cpanel EasyApache
Turck MMCache for PHP
Fix Log Rotation Problems
Installing mod_bandwidth For the Ultimate in Apache Utilization Control


Discuss this article with others in our new hosting forums

Comments / Feedback

anoop
This Article is very usefull. Described in a very simple way....!

 Add Comment
Name
Email
Image Code
Refresh Image

Comments / Feedback



Our site offers free hosting tutorials, cpanel tutorial, web hosting news, shell commands, running a web hosting business, dedicated guides, linux tutorial, apache install, home web server, web server guide, ssh commands, dedicated servers, DNS nameservers, chkrootkit, apf firewall, exim configuration, server compromised, cron backup solution, ftp backup script

Server Tutorials


WebHostGear Reviewed by Ping Zine - Click here

Links:
Lunarpages Coupon