编译apache和resin安装的几个步骤

网络 通信技术
如果resin启动不正确,后面编译apache启动后访问resin就会失败,然后在页面报503错误。 以后stop/restart 时也需要加-server。

编译apache和resin安装的几个步骤,如何编译apache,网络上有不少的方法,下面是编译apache方法的一个集锦,希望对广大爱好者有帮助,都是比较常用的方式。借机提供给大家。

PACING: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0" class=Apple-style-span>    前言:前段时间,对公司前台多机分布方案的做了一些探索,总结了一些东西,贴出来分享。类似内容网上比较多,但是都不够详细,我***次弄时费力不少,希望后来人可以更方便一些。

一. 安装编译apache
◆从编译apache官网上下载apache***的 release版本2.2.6
unix版本取httpd-2.2.6.tar.gz
◆解开包
gunzip httpd-2.2.6.tar.gz
tar xvf httpd-2.2.6.tar
◆编译安装
进入解压后的目录httpd-2.2.6,依次执行
./configure --prefix=/*要安装apache的目录*/ --enable-so
make
make install
成功后apache就安装到前面指定的目录了

二.启动apache
进入编译apache安装目录
◆修改apache/conf/httpd.conf
Listen 80 修改80为需要的端口如 11280
◆启动
进入apache/bin/执行: ./apachectl start
◆打开浏览起访问
http://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,包括:
◆copy mod_caucho.so到apache目录(就是前面指定的--with-apache=/data/aoxj/artest/apache)的modules
◆v修改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文件中的以下内容
◆LoadModule caucho_module ***/modules/mod_caucho.so
检查mod_caucho.so是否存在
◆ResinConfigServer localhost 6802
这个ResinConfigServer只能出现一行,如果resin有多台,请在这里指定的那台resin配置文件中的<cluster>中配置其他机器的ip/port
◆CauchoConfigCacheDirectory /tmp
◆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的端口。

责任编辑:佟健 来源: wade2007
相关推荐

2010-01-14 16:53:40

CentOS Apac

2021-12-31 08:15:00

Percona SerMySQL开发

2010-01-07 17:03:47

Linux操作系统

2011-03-09 14:34:10

lamp安装

2010-03-29 17:17:51

Nginx Resin

2010-01-07 16:34:08

Ubuntu apac

2010-01-15 10:16:50

CentOS rpm安

2010-05-04 16:20:11

resin负载均衡

2011-03-25 17:20:37

NagiosApache

2010-01-13 16:46:44

CentOS Apac

2024-01-07 17:11:53

网络IDC机房

2011-03-31 17:14:56

MySQL安装

2010-01-07 11:08:56

Ubuntu DB2

2010-05-04 13:27:27

apache负载均衡

2011-07-14 23:42:42

SEO

2010-06-08 17:26:36

OpenSUSE 安装

2010-05-25 19:12:26

SVN+TRAC+AP

2010-09-07 13:51:07

PPPoE Serve

2010-05-26 13:14:23

cacti 监控lin

2010-06-01 09:51:11

点赞
收藏

51CTO技术栈公众号