现在的位置: 首页 > 综合 > 正文

play framework 之 整合 ckeditor 和 ckfinder 时注意的一些问题

2013年10月15日 ⁄ 综合 ⁄ 共 1361字 ⁄ 字号 评论关闭

 

问题主要出在 整合 ckfinder时候,ckfinder是相对独立,项目只需要引入 ckfinder.js 其他的都不需要。

 

<script type="text/javascript">

$(window).load(

function(){

var editor = CKEDITOR.replace('editor');     //editor就是要替换的元素

CKFinder.setupCKEditor( editor,"/assets/ckfinder/"); 

//'http://localhost/assets/ckfinder/'就是解压到assets虚拟目录下的ckfinder文件的URL,

//需要在同一域名下,虚拟主机中需要配置此路径

}

);

</script>

 

接下来要做的就是,在apache代理转交给play的URL剔除ckfinder的部分,不要转交,而自己解析。

LoadModule proxy_module modules/mod_proxy.so

LoadModule proxy_http_module modules/mod_proxy_http.so

LoadModule proxy_balancer_module modules/mod_proxy_balancer.so

NameVirtualHost 188.188.1.109:80

<VirtualHost 188.188.1.109:80>

  ServerName 188.188.1.109

  <Location /balancer-manager>

    SetHandler balancer-manager

    Order Deny,Allow

    Deny from all

    Allow from ALL

  </Location>

  <Proxy balancer://mycluster>

    BalancerMember http://localhost:9000

    BalancerMember http://localhost:9001 status=+H

  </Proxy>

  <Proxy *>

    Order Allow,Deny

    Allow From All

  </Proxy>

  ProxyPreserveHost On

 

  ProxyPass /assets/  !                   //这就是剔除ckfinder的URL,记住一定要放在前面,否则无效

  ProxyPassReverse /assets/ !

 

  ProxyPass /balancer-manager !

  ProxyPass / balancer://mycluster/

  ProxyPassReverse / http://localhost:9000/

  ProxyPassReverse / http://localhost:9001/

 

  Alias /assets "d:/assets"

  <Directory "d:/assets">

    Options Indexes FollowSymLinks MultiViews IncludesNoExec

    AddOutputFilter Includes html

    AllowOverride None

    order allow,deny

    Allow from all

  </Directory>

</VirtualHost>

抱歉!评论已关闭.