Chinaunix
标题:
Linux下resin与apache的整合配置(作为上一篇的参考文档)
[打印本页]
作者:
luozhongbiao
时间:
2007-05-14 11:24
标题:
Linux下resin与apache的整合配置(作为上一篇的参考文档)
OS: Fedora Core 4
Apache: 1.3.34 (不要用2.2.X版,否则resin编译的时候会出错)
Resin: resin-2.1.17 & resin-3.0.17 (不要用source版,source在安装过程中似乎会出现各种奇怪的错误)
resin各版本的一些说明:
3.0.X对各种框架的支持更好,而2.0.X版对于简单的jsp应用系统可能效率更高,但对框架的支持比较差(ee版可能支持会好一些)。
3.0.X分成pro(not op)和一般版本(op); 2.0.X分ee版和一般版本。
关于3.0.X版的原文说明:Resin is provided in two versions, Resin Professional and Resin Open Source. Resin Professional adds features and enhancements commonly needed in a production environment. Resin Open Source is suitable for hobbyists, developers, and low traffic websites that do not need the performance and reliability enhancements of Resin Professional.
安装apache-1.3.34
1)下载源码,并解压;
2)./configure --prefix=/home/apache-1.3.34 --enable-module=so
3)make
4)make install
安装resin
1)下载bin版archive,解压到/home/resin-XXXX;
2)./configure --with-apxs=/home/apache-1.3.34/bin/apxs (这里prefix似乎是无效的)
3)make
4)make install (在apache-1.3.34/libexec目录下生成对应的mod_caucho.so模块,并自动修改apache-1.3.34/conf/httpd.conf)
修改配置文件中的根目录设置
手工修改httpd.conf和resin.conf,使httpd.conf中的DocumentRoot和resin.conf中的document-directory目录一致,一般可在resin目录下建立doc目录,然后把根目录都指向该目录。
注意:2.X和3.X的mod_caucho.so是不一样的,不可混用,另外对httpd.conf的修改也是不一样的;
2.X的如下:
LoadModule caucho_module /home/webadm/libexec/mod_caucho.so
CauchoConfigFile /home/resin/conf/resin.conf
而3.X的则如下:
LoadModule caucho_module /home/apache_1.3.34/libexec/mod_caucho.so
ResinConfigServer localhost 6802
CauchoStatus yes
如果你想让resin在系统启动时自动运行还应该给resin添加一个start.sh,内容如下:
#--------------------------------------
if [ -e /home/resin/httpd.pid ]; then
kill -9 `cat /home/resin/httpd.pid`
fi
JAVA_HOME="/home/jdk"
RESIN_HOME="/home/resin"
PATH="$JAVA_HOME/bin:$PATH"
CLASSPATH="."
export PATH JAVA_HOME RESIN_HOME CLASSPATH
/home/resin/bin/httpd.sh restart &
#--------------------------------------
文件可以放到resin安装目录的bin目录下,之所以要用start.sh启动是因为在系统启动时resin还获取不到系统环境变量JAVA_HOME或CLASSPATH
然后在/etc/rc.local中直接添加如下代码就ok了:
/home/resin/bin/start.sh
/bin/sleep 5
/home/apache-1.3.34/bin/apachectl start
本文来自ChinaUnix博客,如果查看原文请点:
http://blog.chinaunix.net/u/25604/showart_300753.html
欢迎光临 Chinaunix (http://bbs.chinaunix.net/)
Powered by Discuz! X3.2