免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2312 | 回复: 1
打印 上一主题 下一主题

Apache2 中 Resin2.x 与 Resin3.x 中共存方法[原创] [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2005-02-20 04:07 |只看该作者 |倒序浏览
Apache2 上的 Resin2.x 和 Resin3.x 共存方法
最近公司增加新服务器,新的服务器上将运行 resin3, 且处于内网,作为外网的服务器(运行Resin2)上的应用不进行迁移,为了可以使外网服务器上运行的 apache2 可以同时加载 resin 模块且分别将请求发送到不同的 resin 处理,对 resin3 apache模块进行了小修改,使一个 apache2 里可以共存 resin2 和 resin3 模块。

对 Resin2 模块不进行修改

Resin3 模块的修改
1.        复制 Resin3 模块源代码 mod_caucho.c 为 mod_caucho3.c
找到 mod_caucho3.c 中 的 Apache 模块定义 caucho_module 修改为 caucho3_module 同时把应用到该定义的地方全部修改为 caucho3_module
/*
* Apache magic module declaration.
*/
module AP_MODULE_DECLARE_DATA caucho_module;

修改 caucho-status 为 caucho3-status
修改 caucho-request 为 caucho3-request
以上 2 个是为了在 apache2 配置中可以区分把这两个请求分别发送到不同版本的 resin 中

然后重新编译生成 mod_caucho.so 改名为 mod_caucho3.so 备用


设系统中已经正常运行了 apache2 resin2 以及 resin3

在 apache2 配置文件中
对 resin2 的配置

  1. <IfModule !mod_caucho.c>;
  2.         LoadModule caucho_module "modules/mod_caucho.so"
  3. </IfModule>;

  4. <IfModule mod_caucho.c>;
  5.         CauchoConfigFile "/usr/local9/srv/resin/conf/resin.conf"       
  6.         <Location /caucho-status>;
  7.                 SetHandler caucho-status
  8.         </Location>;
  9.         <Location /resin2-doc>;
  10.                 SetHandler caucho-request
  11.         </Location>;
  12. </IfModule>;
复制代码

对 Resin3 的配置

  1. <IfModule !mod_caucho3.c>;
  2.         LoadModule caucho3_module "modules/mod_caucho3.so"
  3. </IfModule>;
  4. <IfModule mod_caucho3.c>;
  5. #############################
  6. ResinConfigServer 192.168.0.2 7802
  7. CauchoStatus yes
  8. <Location /caucho3-status>;
  9.         SetHandler caucho3-status
  10. </Location>;
  11. <Location /resin3-doc>;
  12.         SetHandler caucho3-request
  13. </Location>;

  14. #############################
  15. </IfModule>;
复制代码


忽略对 webapp 的配置

配置好后 重新启动 apache2,启动好 resin2,resin3 后

在浏览器中分别输入
http://<server>;/caucho-status  
http://<server>;/caucho3-status

http://<server>;/resin3-doc
http://<server>;/resin2-doc

将会由不同的resin 处理不同的请求.

论坛徽章:
0
2 [报告]
发表于 2005-02-22 17:37 |只看该作者

Apache2 中 Resin2.x 与 Resin3.x 中共存方法[原创]

呵呵,顺便把 Resin3.0.11 给 Crack 了,可以用 JNI 库了。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP