


apache下限制每個(gè)虛擬主機(jī)的并發(fā)數(shù)
下載模塊:
http://www.nowhere-land.org/prog ... st_limit-0.4.tar.gz
官方網(wǎng)址: 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 個(gè)并發(fā)線程數(shù)。 server2 被限制為 30 個(gè)并發(fā)線程數(shù)。 server3 沒有被限制。
注:需 mod_status 的 ExtendedStatus On 支持!!
如超出限制的并發(fā)數(shù)在客戶端就會(huì)出現(xiàn)503錯(cuò)誤:
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 中將會(huì)有類似以下的錯(cuò)誤提示:
[Mon Jun 23 15:22:24 2003] [error] clientaccessto server1 deferred, MaxVhostClients 100 exceeded
關(guān)鍵字:apache 限制 虛擬主機(jī) 并發(fā)數(shù)
新文章:
- CentOS7下圖形配置網(wǎng)絡(luò)的方法
- CentOS 7如何添加刪除用戶
- 如何解決centos7雙系統(tǒng)后丟失windows啟動(dòng)項(xiàng)
- CentOS單網(wǎng)卡如何批量添加不同IP段
- CentOS下iconv命令的介紹
- Centos7 SSH密鑰登陸及密碼密鑰雙重驗(yàn)證詳解
- CentOS 7.1添加刪除用戶的方法
- CentOS查找/掃描局域網(wǎng)打印機(jī)IP講解
- CentOS7使用hostapd實(shí)現(xiàn)無AP模式的詳解
- su命令不能切換root的解決方法
- 解決VMware下CentOS7網(wǎng)絡(luò)重啟出錯(cuò)
- 解決Centos7雙系統(tǒng)后丟失windows啟動(dòng)項(xiàng)
- CentOS下如何避免文件覆蓋
- CentOS7和CentOS6系統(tǒng)有什么不同呢
- Centos 6.6默認(rèn)iptable規(guī)則詳解