Steps to limit the number of connections per IP to an Apache web server
-
Access your server via SSH as the user “root”.
Additional information
You can find more information about SSH access to your VPS Cloud server in the article: -
Once you are logged in to your server, you will need to locate the Apache configuration file
Note
The configuration file varies depending on the Apache version but is usually called apache2.conf or httpd.conf
-
Once you have found the configuration file, you must edit it by adding the following lines at the end of the file:
LoadModule limitipconn_module libexec/apache24/mod_limitipconn.so ExtendedStatus On <IfModule mod_limitipconn.c> <Location /> MaxConnPerIP 2 </Location> </IfModule> - Save the changes made to the file
- Finally, restart Apache for the change to take effect