In linux, how does apache limit the download speed?

Source: Internet
Author: User
Tags 503 service temporarily unavailable
For more information about how to restrict the download speed of linux and apache-Linux Enterprise applications-Linux server applications, see the following. At present, various multi-thread download tools are prevalent, which is a headache for websites that provide some download functions. Due to the multi-thread download, the load on the server is huge, in addition, it may have an impact on the entire site so that it cannot be accessed normally. Is there any way to solve these problems? The answer is yes. Currently, most sites in China are based on the LAMP (Linux + Apache + Mysql + php) architecture. Apache is an open-source, powerful, stable, and WEB server with the largest usage. Apache is developed in a modular manner. You can add various functional modules as needed. Here I will introduce two modules: mod_limitipconn and bw_mod.

The following describes their installation configurations. They are:
Mod_limitipconn: http://dominia.org/djao/limitipconn.html
Http://www.ivn.cl/

1. mod_limitipconn

Mod_limitipconn is an unofficial apache module that controls concurrent connections based On the same source IP address. It uses ExtendedStatus On and works at the application layer. When the connection of the same source IP address reaches the limit, apache sends the HTTP/1.1 503 Service Temporarily Unavailable to the get request, so that users cannot download multiple threads, but cannot prevent attacks.

The latest version is 0.44 and supports apache2.0.
Tar-zxvf mod_limitipconn-0.44.tar.gz
Cd mod_limitipconn-0.44

Install: before installing apxs, check the location of apxs and try the wheries apxs command to find the location of the apxs file. You can install it in two ways.

One way is to modify the Makefile file of mod_limitipconn to ensure that APXS = points to the correct apxs file in the Makefile.

Then in make; make install

Another method is to directly use the apxs command for installation and compilation, such:
/Usr/local/apache/bin/apxs-c-I-a mod_limitipconn.c

Modify the configuration file httpd. conf of apache

1. I didn't find this ExtendeStatus On added to any line during installation.

2. confirm that the LoadModule limitipconn_module/usr/lib/apache/mod_limitipconn.so option exists;

3. Configure mod_limitipconn in httpd. conf. The configuration example is as follows:
QUOTE:

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.