您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

在apache下限制每个虚拟主机的并发数!!!!_PHP

2025/8/19 19:37:20发布33次查看
apache虚拟主机
来自http://www.allabc.com
论坛:http://seecee.dev-c.nl/forumdisplay.php?fid=4
下载模块:
http://www.nowhere-land.org/prog ... st_limit-0.4.tar.gz
官方网址: http://www.nowhere-land.org/programs/mod_vhost_limit/
安装:
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错误:
service temporarily unavailable
the server is temporarily unable to service your request due to maintenance downtime or capacity problems. please try again later.
--------------------------------------------------------------------------------
apache/1.3.27 server at server1 port 80
在 error_log 中将会有类似以下的错误提示:
[mon jun 23 15:22:24 2003] [error] client access to server1 deferred, maxvhostclients 100 exceeded
希望对大家有用!! (出处:http://www.allabc.com)
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product