-
您当前所在位置:首页 → 服务器 → WEB服务器 → apache + resin的多机部署方案实现方法
apache + resin的多机部署方案实现方法
时间:2015/6/28来源:IT猫扑网作者:网管联盟我要评论(0)
-
前言:前段时间,对公司前台多机分布方案的做了一些探索,总结了一些东西,贴出来分享。类似内容网上比较多,但是都不够详细,我第一次弄时费力不少,希望后来人可以更方便一些。
一. 编译安装Apache
1) 从apache官网上下载apache最新的 release版本2.2.6
unix版本取httpd-2.2.6.tar.gz
2) 解开包
gunzip httpd-2.2.6.tar.gz
tar xvf httpd-2.2.6.tar
3) 编译安装
进入解压后的目录httpd-2.2.6,依次执行
./configure --prefix=/*要安装apache的目录*/ --enable-so
make
make install
成功后apache就安装到前面指定的目录了
二) 启动apache
进入apache安装目录
1) 修改apache/conf/httpd.conf
Listen 80 修改80为需要的端口如 11280
2) 启动
进入apache/bin/执行: ./apachectl start
3) 打开浏览起访问
https://ip: 11280
三) 编译安装resin
./configure --prefix=/data/aoxj/artest/resin --with-apxs=/data/aoxj/artest/apache/bin/apxs --with-apache=/data/aoxj/artest/apache
make
make install
上述操作除了编译安装resin外(其实不做这些操作,resin本身也是可以跑起来的),还会修改apache,包括:
1. copy mod_caucho.so到apache目录(就是前面指定的--with-apache=/data/aoxj/artest/apache)的modules
2. 修改apache的配置文件conf/httpd.conf,自动增加以下内容
LoadModule caucho_module ***/modules/mod_caucho.so
ResinConfigServer localhost 6802
CauchoConfigCacheDirectory /tmp
CauchoStatus yes
四)配置resin
需要修改resin.conf文件
<cluster>
<srun server-id="a" host="192.168.0.1" port="6802"/>
<srun server-id="a" host="192.168.0.1" port="6802"/>
</cluster>
五)启动resin
运行resin/bin/httpd.sh
注意一定要加-server,否则resin启动后是监听80/8080这样的端口,而不是上面cluster设置里面的6802
./httpd.sh -server a start
这样resin才会监听6802,建议手工telnet确认一下。如果resin启动不正确,后面apache启动后访问resin就会失败,然后在页面报503错误。
以后stop/restart 时也需要加-server
六) 配置apache
确认conf/httpd.conf文件中的以下内容
1) LoadModule caucho_module ***/modules/mod_caucho.so
检查mod_caucho.so是否存在
2) ResinConfigServer localhost 6802
这个ResinConfigServer只能出现一行,如果resin有多台,请在这里指定的那台resin配置文件中的<cluster>中配置其他机器的ip/port
3) CauchoConfigCacheDirectory /tmp
4)CauchoStatus yes
最后修改的配置为:
LoadModule caucho_module "/data/aoxj/artest/apache/modules/mod_caucho.so"
ResinConfigServer 192.168.0.1 6802
AddHandler caucho-request .action
CauchoConfigCacheDirectory /tmp
CauchoStatus yes
八)web访问
启动apache
用浏览器访问apache的端口,注意不是访问resin的端口
关键词标签:apache,resin
相关阅读
-
热门文章
ISAPI Rewrite实现IIS图片防盗链IIS6.0下配置MySQL+PHP5+Zend+phpMyAdmin在Windows服务器上快速架设视频编解码器全攻win2000server IIS和tomcat5多站点配置
人气排行
XAMPP配置出现403错误“Access forbidden!”的解决办法WIN2003 IIS6.0+PHP+ASP+MYSQL优化配置访问网站403错误 Forbidden解决方法Server Application Unavailable的解决办法如何从最大用户并发数推算出系统最大用户数报错“HTTP/1.1 400 Bad Request”的处理方法http 500内部服务器错误的解决办法(windows xp + IIS5.0)Windows Server 2003的Web接口
查看所有0条评论>>