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: