国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開APP
userphoto
未登錄

開通VIP,暢享免費電子書等14項超值服

開通VIP
使用mod_cband管理Apache 2帶寬和流量
使用mod_cband管理Apache 2帶寬和流量

About the module

mod_cband is an Apache 2 module provided to solve the problem of limiting users’ and virtualhosts’ bandwidth usage. The current versions can set virtualhosts’ and users’ bandwidth quotas, maximal download speed (like in mod_bandwidth), requests-per-second speed and the maximal number of simultaneous IP connections (like in mod_limitipconn)

I advise using mod_cband by hosting companies, which would like to limit data transfer for their users, such as “10 Gb of traffic per month”. There already exists the mod_curb module, which can limit data transfers, but it doesn’t work with virtualhosts and Apache 2, so I wrote my own module fully compatible with Apache 2 API and supporting per-user and per-virtualhost bandwidth limiting

FreeBSD ports path and pkg-descr info
/usr/ports/www/mod_cband
mod_cband is an Apache 2 module provided to solve the problem of limiting virtualhosts bandwidth usage. When the configured virtualhost’s transfer limit is exceeded, mod_cband will redirect all further requests to a location specified in the configuration file.

簡譯:
mod_cband是一個通過Apache 2模塊來解決限制用戶和虛擬主機帶寬問題的應用,當前版本可以調(diào)整虛擬主機和用戶帶寬限額,最高下載速度(like in mod_bandwidth),每秒訪問請求速度和最高并發(fā)訪問ip連接數(shù)(like in mod_limitipconn)。
我告訴主機服務提供商使用mod_cband,想要限制他們用戶數(shù)據(jù)傳輸,像“每月10 Gb流量”這樣。但已有了mod_curb模塊,可以限制流量,但無法工作在虛擬主機和Apache 2下,所以我寫了自己的模塊完全適合于Apache 2 API同時支持每用戶和每虛擬主機帶寬限制。

好了,說道這里我想這個模塊的精髓之處在于完美的支持Apache 2并實現(xiàn)了原有兩個模塊的全部功能(2in1)且支持每用戶和每虛擬主機帶寬限制。這在進行web平臺應用與整合之時給我們提供了又一易用的方法。準備動手吧!文中實例與系統(tǒng)平臺均基于freebsd6.1平臺。

提示:
在進行實際操作之前請確保你的ports tree已經(jīng)同步到當前版本。具體方法請參考http://cnsnap.cn.freebsd.org/doc/zh_CN.GB2312/books/handbook/ports-using.html,關于freebsd和apache2的安裝本文不予介紹,同時假定你已經(jīng)安裝并配置了所需環(huán)境。

安裝:
#cd /usr/ports/www/mod_cband
#make install clean
安裝結(jié)束后末尾輸出:
chmod 755 /usr/local/libexec/apache2/mod_cband.so
[activating module `cband’ in /usr/local/etc/apache2/httpd.conf]
===> Registering installation for mod_cband-0.9.7.3
此時cband_module已經(jīng)自動添加到你的httpd.conf文件中并開啟了。
LoadModule cband_module libexec/apache2/mod_cband.so
至此mod_cband安裝已經(jīng)完成,讓我們繼續(xù)后面的操作。之前說mod_cband易用是相對的,主要是看你如何配置讓他為你所用。一些基礎配置還是很容易完成,但是要發(fā)揮它的強大和靈活配置還是要好好看看documentation,充分理解良好駕馭。不啰嗦了,下面看看如何進行基本配置和使用并觀測實際效果。以我這個blog為實例,看看基本情況:
<VirtualHost *:80>
DocumentRoot “/other/blog/wordpress”
ServerName blog.citygrit.cn
<Directory “/other/blog/wordpress”>
allow from all
Options +Indexes
</Directory>
# 100MB virtualhost bandwidth limit
CBandLimit 100M
# Maximal 1024kbps speed for this virtualhost
# Maximal 10 requests per second for this virtualhost
# Maximal 30 open connections for this virtualhost
CBandSpeed 1024 10 30
# Maximal 10kB/s speed, 3 requests/s and 2 open connections for any remote client
CBandRemoteSpeed 10kb/s 3 2
# a period of time after which the scoreboard will be cleared (4 weeks)
CBandPeriod 4W
#Then you can access the status page with a URL like:http://server_name/cband-status
<Location /cband-status>
SetHandler cband-status
</Location>
#Then you can access the status page with a URL like:http://server_name/cband-status-me
<Location /cband-status-me>
SetHandler cband-status-me
</Location>
</VirtualHost>
為了便于理解將上面內(nèi)容里與mod_cband相關設置予以說明,(約定“#”為注釋標記)。
# 100MB virtualhost bandwidth limit
CBandLimit 100M
限制虛擬主機總訪問帶寬為100Mb。
# Maximal 1024kbps speed for this virtualhost
# Maximal 10 requests per second for this virtualhost
# Maximal 30 open connections for this virtualhost
CBandSpeed 1024 10 30
限制此虛擬主機最高訪問速度1024kbps
限制此虛擬主機每秒最高接受請求數(shù)10個
限制此虛擬主機最高并發(fā)連接30個
# Maximal 10kB/s speed, 3 requests/s and 2 open connections for any remote client
CBandRemoteSpeed 10kb/s 3 2
限制來自遠端訪問速度10kB每秒,3個請求每秒,2個連接。
# a period of time after which the scoreboard will be cleared (4 weeks)
CBandPeriod 4W
設定多久對所記錄的全局訪問帶寬進行重設(清零)。
4W=4 weeks 4周(一個月)
#Then you can access the status page with a URL like:http://server_name/cband-status
<Location /cband-status>
SetHandler cband-status
</Location>
開啟了mod_cband的實時監(jiān)測功能,可以通過http://server_name/cband-status進行直觀的觀測。(全局監(jiān)測)
#Then you can access the status page with a URL like:http://server_name/cband-status-me
<Location /cband-status-me>
SetHandler cband-status-me
</Location>
開啟了mod_cband的實時監(jiān)測功能,可以通過http://server_name/cband-status-me進行直觀的觀測。(單一監(jiān)測)

通過上文簡單介紹了mod_cband在freebsd平臺下與apache2進行整合及基本配置,整個過程屬于理論結(jié)合實際操作并得以真實應用,保證其可實施性但不承諾由于其他原因造成的配置與使用問題。如果希望詳細了解mod_cband的更加強大的功能和高級配置請訪問其網(wǎng)站。本文中部分實例參考了官方網(wǎng)站和Manage Apache Download Speed And Traffic Limits With mod_cband這里的文章。

通告:本文系作者轉(zhuǎn),并未抄襲互聯(lián)網(wǎng)及其他已發(fā)表的類似文章。文中所引用
系官方網(wǎng)站實例及說明。歡迎轉(zhuǎn)載但請注明出處已示對作者勞動成果的尊重,謝謝。如果您發(fā)現(xiàn)文中的表述有誤請聯(lián)絡我,我會及時做出修正。(但不包括由于系統(tǒng)平臺及應用軟件發(fā)生變化而產(chǎn)生的問題)
 
=======================================
 
安裝配置mod-cband      (支持httpd-2.0)

#        cd        /tmp
#        wget        http://cband.linux.pl/download/mod-cband-0.9.7.3.tgz
#        tar        zxvf                mod-cband-0.9.7.3.tgz
#        cd        mod-cband-0.9.7.3
#        PATH=/usr/local/apache/bin:$PATH
#        ./configure
#        make
#        make        install



NameVirtualHost 12.34.56.78                ( 主機 IP 地址 )
<VirtualHost www.test.net.cn>
        ServerName www.test.net.cn:80
        ServerAdmin admin@test.net.cn
        DocumentRoot "/usr/local/apache/htdocs/www.test.net.cn "
        DirectoryIndex test.php
        ErrorLog logs/www.test.net.cn/error_log
        CustomLog logs/www.test.net.cn/access_log        common

CBandLimit 100M
限制虛擬主機總訪問帶寬為100Mb。


CBandSpeed 1024 10 30
限制此虛擬主機最高訪問速度1024kbps
限制此虛擬主機每秒最高接受請求數(shù)10個
限制此虛擬主機最高并發(fā)連接30個

CBandRemoteSpeed 10kb/s 3 2
限制來自遠端訪問速度10kB每秒,3個請求每秒,2個連接。

CBandPeriod 4W
設定多久對所記錄的全局訪問帶寬進行重設(清零)。
4W=4 weeks 4周(一個月)


<Location /cband-status>
SetHandler cband-status
</Location>
開啟了mod_cband的實時監(jiān)測功能,可以通過http://server_name/cband-status進行直觀的觀測。(全局監(jiān)測)

<Location /cband-status-me>
SetHandler cband-status-me
</Location>

</VirtualHost>


本站僅提供存儲服務,所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權內(nèi)容,請點擊舉報。
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
Apache httpd 2.4.x 使用 mod_proxy_fcgi 和 PHP-FPM 的方式
apache配置
WinXp Apache虛擬主機開啟Mod_rewrite
同時支持ASP和PHP?apache與IIS共用80端口的方法
Apache集群功能
Apache + Tomcat 配置多個應用
更多類似文章 >>
生活服務
分享 收藏 導長圖 關注 下載文章
綁定賬號成功
后續(xù)可登錄賬號暢享VIP特權!
如果VIP功能使用有故障,
可點擊這里聯(lián)系客服!

聯(lián)系客服