下载模块:
到官方网址: http://www.nowhere-land.org/programs/mod_vhost_limit/下载模块P>
http://www.nowhere-land.org/programs/mod_vhost_limit/mod_vhost_limit-0.4.tar.gz
安装:
apxs -c mod_vhost_limit.c -o /path/to/libexec/mod_vhost_limit.so
在 httpd.conf 加入:
LoadModule vhost_limit_module libexec/mod_vhost_limit.so
AddModule mod_vhost_limit.c
配置:
MaxClients 150
ExtendedStatus On
NameVirtualHost *
ServerName server1
DocumentRoot /some/where/1
MaxVhostClients 100
ServerName server2
DocumentRoot /some/where/2
MaxVhostClients 30
ServerName server3
DocumentRoot /some/where/3
其中: server1 被限制为 100 个并发线程数。 server2 被限制为 30 个并发线程数。 server3 没有被限制。
注:需 mod_status 的 ExtendedStatus On 支持!!
如超出限制的并发数在客户端就会出现503错误
———————————————————————————————-
责任编辑:小草