mod_cband是一个通过Apache 2模块来解决限制用户和虚拟主机带宽问题的应用,当前版本可以调整虚拟主机和用户带宽限额,最高下载速度(like in mod_bandwidth),每秒访问请求速度和最高并发访问ip连接数(like in mod_limitipconn)。
"我告诉主机服务提供商使用mod_cband,想要限制他们用户数据传输,像“每月10 Gb流量”这样。但已有了mod_curb模块,可以限制流量,但无法工作在虚拟主机和Apache 2下,所以我写了自己的模块完全适合于Apache 2 API同时支持每用户和每虚拟主机带宽限制。"(此段翻译自官方网站)

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.

好了,说道这里我想这个模块的精髓之处在于完美的支持Apache 2并实现了原有两个模块的全部功能(2in1)且支持每用户和每虚拟主机带宽限制。这在进行web平台应用与整合之时给我们提供了又一易用的方法。准备动手吧!文中实例与系统平台均基于freebsd6.1平台。

提示:
在进行实际操作之前请确保你的ports tree已经同步到当前版本。具体方法请参考http://cnsnap.cn.freebsd.org/doc ... ok/ports-using.html,关于freebsd和apache2的安装本文不予介绍,同时假定你已经安装并配置了所需环境。

安装:
#cd /usr/ports/www/mod_cband
#make install clean
安装结束后末尾输出:
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已经自动添加到你的httpd.conf文件中并开启了。
LoadModule cband_module libexec/apache2/mod_cband.so
至此mod_cband安装已经完成,让我们继续后面的操作。之前说mod_cband易用是相对的,主要是看你如何配置让他为你所用。一些基础配置还是很容易完成,但是要发挥它的强大和灵活配置还是要好好看看documentation,充分理解良好驾驭。不啰嗦了,下面看看如何进行基本配置和使用并观测实际效果。以我这个blog为实例,看看基本情况:

DocumentRoot “/other/blog/wordpress”
ServerName blog.citygrit.cn

allow from all
Options +Indexes

# 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

SetHandler cband-status

#Then you can access the status page with a URL like:http://server_name/cband-status-me

SetHandler cband-status-me


为了便于理解将上面内容里与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
限制此虚拟主机每秒最高接受请求数10个
限制此虚拟主机最高并发连接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

SetHandler cband-status

开启了mod_cband的实时监测功能,可以通过http://server_name/cband-status进行直观的观测。(全局监测)
#Then you can access the status page with a URL like:http://server_name/cband-status-me

SetHandler cband-status-me

开启了mod_cband的实时监测功能,可以通过http://server_name/cband-status-me进行直观的观测。(单一监测)

通过上文简单介绍了mod_cband在freebsd平台下与apache2进行整合及基本配置,整个过程属于理论结合实际操作并得以真实应用,保证其可实施性但不承诺由于其他原因造成的配置与使用问题。如果希望详细了解mod_cband的更加强大的功能和高级配置请访问其网站。本文中部分实例参考了官方网站和Manage Apache Download Speed And Traffic Limits With mod_cband这里的文章。

通告:本文系作者原创,并未抄袭互联网及其他已发表的类似文章。文中所引用
系官方网站实例及说明。欢迎转载但请注明出处已示对作者劳动成果的尊重,谢谢。如果您发现文中的表述有误请联络我,我会及时做出修正。(但不包括由于系统平台及应用软件发生变化而产生的问题)

FCKeditor的安装(PHP)

[不指定 2006/10/02 00:46 | by ipaddr ]
1.下载新最版的FCKEditor,解压
2.删除/FCKeditor/目录下除fckconfig.js, fckeditor.js, fckstyles.xml, fcktemplates.xml,fckeditor.php五个文件以外的所有文件
删除目录/editor/_source,_testcases(基本上,所有_开头的文件夹或文件都是可选的),
删除/editor/filemanager/browser/default/connectors/下除PHP目录的所有目录
删除/editor/filemanager/upload/下的除PHP目录的所有目录
删除/editor/lang/下的除了 en.js, zh.js, zh-cn.js三个文件的所有文件

3.
打开/FCKeditor/fckconfig.js
修改
var FCKConfig.DefaultLanguage = 'zh-cn' ;
var _FileBrowserLanguage  = 'php' ;
var _QuickUploadLanguage  = 'php' ;
要开启文件上传的话,还需要配置FCKeditor\editor\filemanager\upload\php\config.php以及\FCKeditor\editor\filemanager\browser\default\connectors\php\config.php
(上传中文名文件会乱码)

4.调用方法
将FCKeditor放在网站根目录
在PHP文件里面,包含/FCKeditor/fckeditor.php文件
//包含fckeditor类
include("../FCKeditor/fckeditor.php") ;
//设置编辑器路径
$sBasePath = "/FCKeditor/";
//创建一个Fckeditor,表单的名称为ipaddr
$oFCKeditor = new FCKeditor('ipaddr') ;
$oFCKeditor->BasePath  = $sBasePath ;
//设置表单初始值
$oFCKeditor->Value  = 'This is some <strong>sample text</strong>' ;
$oFCKeditor->Create() ;

//还可设置
$oFCKeditor->Width
$oFCKeditor->Height
$oFCKeditor->ToolbarSet

5.定制
a.定制调用路径
直接将FCKeditor目录改为editor/,并且在调用的时候指定根路径为/editor/。
b.定制风格
可以通过修改editor\skins目录下的Skin来定制风格,主要是修改CSS。
c.定制toolbar

在fckconfig.js中,默认定制好了Default,Basic两种toolbar,你也可以根据格式定制自己的toolbar,并且在php中使用$oFCKeditor->ToolbarSet=toolbarname调用

d.定制字体
将fckconfig.js里面的FCKConfig.FontNames字体列表前面加上:
宋体;黑体;隶书;楷体_GB2312;
(注意保存为UTF8格式)

e.关闭文件上传
i.将fckconfig.js里面的FCKConfig.LinkBrowser,FCKConfig.ImageBrowser,FCKConfig.FlashBrowser,FCKConfig.LinkUpload,FCKConfig.ImageUpload,FCKConfig.FlashUpload设置为false.
ii.直接将filemanager里面的php文件删降
iii.定制toolbars
最重要的一点,你需要更改filemanager下面的php文件,只有认证的用户才可以访问。

f.注意事项:请用Editplus之类的编辑器编辑配置文件,注意保存格式为utf8.

其它:
asp的安装方法基本类似,将所有php换成asp就行了。
JSP平台下,需要把filemanager下的都删除,再用Servlet替换,需要修改fckconfig.js里面的几个配置(LinkBrowserURL,ImageBrowserURL,FlashBrowserURL,LinkUploadURL ,FlashUploadURL ,ImageUploadURL )。
分页: 1/1 第一页 1 最后页 [ 显示模式: 摘要 | 列表 ]