Anyways, I'm running a LAMP stack and I want to be able to limit the number of concurrent connections. I'm trying to test out the Slowloris denial of service vulnerability for myself, and I was wondering if it is possible to do such a thing?
Use apache's MaxClients Directive in your httpd configuration (/etc/httpd/conf.d/httpd.conf):
Description: Maximum number of connections that will be processed simultaneously Syntax: MaxClients number Default: See usage for details Context: server config Status: MPM Module: beos, prefork, worker
The MaxClients directive sets the limit on the number of simultaneous requests that will be served. Any connection attempts over the MaxClients limit will normally be queued, up to a number based on the ListenBacklog directive. Once a child process is freed at the end of a different request, the connection will then be serviced.
For non-threaded servers (i.e., prefork), MaxClients translates into the maximum number of child processes that will be launched to serve requests. The default value is 256; to increase it, you must also raise ServerLimit.
For threaded and hybrid servers (e.g. beos or worker) MaxClients restricts the total number of threads that will be available to serve clients. The default value for beos is 50. For hybrid MPMs the default value is 16 (ServerLimit) multiplied by the value of 25 (ThreadsPerChild). Therefore, to increase MaxClients to a value that requires more than 16 processes, you must also raise ServerLimit.