在apache下限制每个虚拟主机的并发数!!!!Web服务器教程
|
| 论文作者:佚名 论文来源:不详 论文发布时间:2006-6-18 23:07:33 论文发布人:chjchjchj |
减小字体
增大字体
摘要:在apache下限制每个虚拟主机的并发数!!!! 下载模块:
http://www.nowhere-land.org/programs/mod_vhost_limit/mod_vhost_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 *
<VirtualHost *> ServerName server1 DocumentRoot /some/where/1 MaxVhostClients 100 </VirtualHost>
<VirtualHost *> ServerName server2 DocumentRoot /some/where/2 MaxVhostClients 30 </VirtualHost>
<VirtualHost *> ServerName server3 DocumentRoot /some/where/3 </VirtualHost>
其中: 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
希望对大家有用!!
也希望斑竹来个精:)
南非蜘蛛 回复于:2003-06-24 10:35:42好的,我给你加个精,以后多多努力
iloveyoufreebsd 回复于:2003-06-24 16:33:24好的好的:)
zhangquan 回复于:2003-07-03 13:44:36如何限制连接? 不是指下载,是平常的访问WEB服务,我只想让它运行XX个进程,那该怎样做?
iloveyoufreebsd 回复于:2003-07-04 11:39:54在<VirtualHost *> 里加入 MaxVhostClients X
雨杉 回复于:2003-08-19 14:22:02谢谢,一直在找这方面的资料!
haohaoo 回复于:2003-08-19 20:27:14有没有限制虚拟主机CPU站用百分比的
|
|
|
|
|
|
|
| ∷相关技术评论 |
(评论内容只代表网友观点,与本站立场无关!) [查看发表评论...] | |
|
|
| |
站内广告 |
| |
|
站内搜索 |
| |
栏目导航 |
| |
|
|
本月热门 |
| |
|
|
本日热门 |
| |
|
|
|