免费注册 查看新帖 |

Chinaunix

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

[Web] apache +resin cluster配置文档 [复制链接]

论坛徽章:
17
CU大牛徽章
日期:2013-03-13 15:32:352017金鸡报晓
日期:2017-02-08 10:33:21fulanqi
日期:2016-06-17 17:54:25lufei
日期:2016-06-17 17:38:40平安夜徽章
日期:2015-12-26 00:06:30冥斗士
日期:2015-11-25 14:38:112015年辞旧岁徽章
日期:2015-03-03 16:54:15亥猪
日期:2015-01-26 17:23:43CU大牛徽章
日期:2013-04-17 11:02:58CU大牛徽章
日期:2013-04-17 11:02:36CU大牛徽章
日期:2013-04-17 11:02:15CU大牛徽章
日期:2013-04-17 11:01:45
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2010-04-20 14:35 |只看该作者 |倒序浏览
供各位新手参考:



①、apache的安装
建议不要采取拷贝的方式安装apache,要在服务器上重新进行编译安装。
I、下载APACHE安装包
可以从以下地址获取httpd-2.0.59.tar.gz:http://httpd.apache.org/download.cgi
II、解压
tar –zxvf httpd-2.0.59.tar.gz
III、编译安装
./configure --prefix=/usr/webserver/apache --enable-module=so DFLAGS="-L/usr/lib64 -L/lib64"
LDFLAGS="-L/usr/lib64 -L/lib64"(64位操作系统需要添加该参数)
make
make install
编译安装apache至/usr/webserver/apache 并配置apache支持dso方式
②、resin的安装
I、下载resin安装包
可以从以下地址获取resin-3.0.27:http://www.caucho.com/download/
II、解压并安装
Resin安装包解压完成后即可使用。
tar –zxvf resin-3.0.27.tgz
III、编译生成mod_caucho.so
cd resin-3.0.27
./configure --with-apxs=/usr/webserver/apache/bin/apxs
(/usr/webserver/apache为apache的安装路径)
make
make install
说明:resin编译完成后,/usr/webserver/apache/modules必须生成mod_caucho.so文件。

③、resin、apache配置
I、resin配置
Resin安装完成后,编辑conf/resin.conf文件配置数据源。如下例所示:
<resin xmlns="http://caucho.com/ns/resin"
xmlns:resin="http://caucho.com/ns/resin/core">
<log name="" path="stdout:" timestamp="[%H:%M:%S.%s] "/>
…… ……
<bind-ports-after-start/>
<http server-id="a" host="*" port="8065"/>
<http server-id="b" host="*" port="8066"/>
<http server-id="c" host="*" port="8067"/>
<http server-id="d" host="*" port="8068"/>
////// 这是resin集群的配置方式 ;此处是resin的HTTP访问端口,端口号和id可自行定义 (端口号不能重复) //////
<cluster>
<srun server-id="a" host="192.168.1.17" port="6805"/>
<srun server-id="b" host="192.168.1.17" port="6806"/>
<srun server-id="c" host="192.168.1.17" port="6807"/>
<srun server-id="d" host="192.168.1.17" port="6808"/>
////// 这是resin集群的配置方式 ;此处是apache 和resin内部交互端口,端口号可自行定义,id保持和http的id相同(端口号不能重复) //////
</cluster>
…… ……
<database>
<jndi-name>jdbc/eesdb</jndi-name>
<driver type="oracle.jdbc.OracleDriver">
<url>jdbcracle:thin192.168.1.110:1521:appdb</url>
////// 数据源配置:192.168.1.110是数据库服务器IP;appdb是数据库sid //////
<user>user</user> ///数据库用户名///
<password>pass </password> ///数据库用户密码///
</driver>
<prepared-statement-cache-size>8</prepared-statement-cache-size>
<max-connections>1000</max-connections>
<max-idle-time>130s</max-idle-time>
</database>
…… ……
<resin:set var="resin_admin_localhost" default="true"/>
<web-app id="/" document-directory="/usr/webserver/resin-3.0.27/webapps/"/>
////// 应用网上程序路径 //////
</resin:if>
</host>
</server>
</resin>
II、安装jdbc驱动

将数据库服务器$ORACLE_HOME/jdbc/lib/ojdbc14.jar拷贝到$RESIN_HOME/lib目录
III、apache配置
Apache编译完成后,编辑apache/conf/httpd.conf文件进行配置,如下例所示:
ServerRoot "/usr/webserver/apache"
PidFile logs/httpd.pid
Timeout 60
KeepAlive On
MaxKeepAliveRequests 500
KeepAliveTimeout 8
…… ……
Listen 80 //////配置apache监听端口
User nobody
Group #-1
…… ……
BrowserMatch "^Dreamweaver-WebDAV-SCM1" redirect-carefully
LoadModule caucho_module /usr/webserver/apache/modules/mod_caucho.so
//////加载对resin的支持
#ResinConfigServer 192.168.1.68 16082
#ResinConfigServer 192.168.1.68 16083
#CauchoConfigCacheDirectory /tmp
CauchoHost 192.168.1.17 6805 ////配置部署resin服务器IP和resin srun port下同////
CauchoHost 192.168.1.17 6806
CauchoHost 192.168.1.17 6807
CauchoHost 192.168.1.17 6808
CauchoStatus yes
…… ……
IV、apache、resin启动
Resin的启动与关闭
在/usr/webserver/resin-3.0.27/bin(假如resin安装在这个目录)下执行下面的命令,请注意resin文件目录的所属于的用户组。
启动:./httpd.sh  –server a start
关闭:./httpd.sh –server a stop
 可以将-Djava.awt.headless=true –server a参数添加到httpd.sh脚本中。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP