By default, Apache does not limit the number of connections from the same IP address. In practice, the number of connections from the same IP address is usually large, which affects the server performance. To avoid this situation, you can configure such a module for apache. This article describes how to implement this process in Debian VPS. This module is not official from apache, but from a third party. Its homepage is http://dominia.org/djao/limitipconn2.html. First download the source code here. Install the compilation tool in Debian VPS:
apt-get install make gcc apache2-prefork-dev
Undo the source code package, modify Makefile, change apxs to apxs2, and then run:
makemake install
Add in http. conf
ExtendedStatus On <IfModule mod_limitipconn.c> <Location/> # MaxConnPerIP 3 in the/directory of all virtual hosts # Only three concurrent connections are allowed per IP address </Location> </IfModule>
Restart apache and use thunder to download something on your website. By default, we will find five threads opened by thunder, which can successfully establish connections with your web site, the number of concurrent connections you set will not exceed