In Windows, Apache requires the mod_limitipconn.dll module to limit the number of IP connections. apache2.2 is used as an example.
1. Download the corresponding module mod_limitipconn.dll.
2. Place it under apache2.2 \ modules
3. Modify httpd. conf configuration
Loadmodule status_module modules/mod_status.so remove the previous #
Add
Extendedstatus on
Loadmodule limitipconn_module modules \ mod_limitipconn.dll
<Ifmodule mod_limitipconn.c>
<Location/>
Maxconnperip 3
Noiplimit image /*
</Location>
</Ifmodule>
Note:
<Location/> # the directory to be restricted. The root directory is shown here.
Maxconnperip 3 # limit the number of concurrent connections of each IP address, which is 3
Noiplimit image/* # No IP address limit on image folders
Restart Apache
Traffic control:
Find a module of the bandwidth module in the http://modules.apache.org website
Installation:
1. Place mod_b1_dll in modules under the Apache installation folder.
2. Edit httpd. conf and add loadmodule bw_module modules/mod_bw.dll
3. Restart Apache
4. Check whether mod_bw exists in phpinfo ().
The following is an example of settings:
Each connection line is limited to 100 kb/s, and the minimum speed is 50kb/S. When the file exceeds 500 kb, the speed is limited to 50kb/s.
Bandwidthmodule on
Forcebandwidthmodule on
Bandwidth all 1024000
Minbandwidth all 50000
Largefilelimit * 500 50000
Servername www.example.com