Prevent multiple threads from being downloaded from APACHE

Source: Internet
Author: User
Tags 503 service temporarily unavailable
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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.