Article Title: prevent multiple threads from downloading APACHE. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Mod_limitipconn.c is an unofficial apache module that can be used as a WEB file download restriction, but it uses the ExtendedStatus On form and works at the application layer. When the connection from the same IP address reaches the limit, apache sends a get request:
HTTP/1.1 503 Service Temporarily Unavailable
This prevents users from downloading, but does not prevent such attacks and allows connections. However, this Dongdong pair
Network management is still very useful, especially for download site network management. Brief Introduction to installation (dynamic module Mode)
Install apache in the/usr/local/apache directory ):
Download: http://dominia.org/djao/limit/mod_limitipconn-0.04.tar.gz
# Tar xzf mod_limitipconn-0.04.tar.gz
# Cd mod_limitipconn-0.04
# Vi Makefile
Put the first line:
APXS = apxs
Change
APXS =/usr/local/apache/bin/apxs
Then:
# Make
# Make install
Modify the apache configuration file:
# Vi/usr/local/apache/conf/httpd. conf
Welcome to Internet Technology Online http://www.chinaitlab.com
ExtendedStatus On ### before this sentence in make install # not removed, must be removed
### Make install has added the following two statements to confirm that they exist.
LoadModule limitipconn_module libexec/mod_limitipconn.so
AddModule mod_limitipconn.c
### The following are restrictions on downloading files in the web directory
MaxConnPerIP 3 ### restrict the same IP address in the web root directory to be downloaded by three processes at the same time
# Other options, such:
# NoIPLimit image /*
# OnlyIPLimit audio/mpeg video
# You can set multiple locations.
Restart apache and use a multi-threaded download tool to download more than three threads. The rest will get information:
HTTP/1.1 503 Service Temporarily Unavailable
Or, based on the User_Agent's judgment, give deny all known multithreading tools.
In httpd. conf
.....
BrowserMatch "NetAnt" badguy
BrowserMatch "GetRight" badguy
BrowserMatch "JetCar" badguy
BrowserMatch "Mass Downloader" badguy
BrowserMatch "ReGet" badguy
BrowserMatch "DLExpert" badguy
BrowserMatch "FlashGet" badguy
Welcome to Internet Technology Online http://www.chinaitlab.com
BrowserMatch "Offline Explorer" badguy
BrowserMatch "Teleport" badguy
...........
Order deny, allow
Deny from env = badguy
Allow from all
Note that the httpd should contain the mod_setenvif module.