LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1224|回复: 6

apache和resin如何整合,鄙人搞了三天两夜都没成功。

[复制链接]
发表于 2003-9-15 16:53:36 | 显示全部楼层 |阅读模式
希望各位大家给予指教!
发表于 2003-9-15 20:22:02 | 显示全部楼层

JAVA

仰视ing
发表于 2003-9-15 20:44:51 | 显示全部楼层
建议使用tomcat和apache整合
发表于 2003-9-15 21:43:13 | 显示全部楼层
resin有比较好的文档,而且只有一种方法,相比之下tomcat就凌乱一点(因为有三种方式,官方文档也比较详细)
我当时配置时记下来的,供参考:
-----------------------------------------------------------------------------
        windows + apache2.0.43 + resin-ee-2.1.6
1、安装j2sdk1.4.1,目录:c:\j2sdk
2、安装apache在c:\apache、解压resin在c:\
3、运行%resin_home%/bin/setup.exe,检查apache2/conf/httpd.conf中mod_caucho.dll的中路径是否正确,
   有时setup会检测到错误的apache版本号,并且apache2.x系列不需要AddModule *.c,因此最好手工添加
                LoadModule caucho_module modules/mod_caucho.dll
                <VirtualHost 127.0.0.1>
                        <IfModule mod_caucho.c>
                          CauchoConfigFile "C:/resin-ee/conf/resin.conf"
                          # For security, deployment sites may want to
                          # comment the following out.
                          <Location /caucho-status>
                            SetHandler caucho-status
                          </Location>
                        </IfModule>
                        ServerAdmin winix@XXX.com
                        DocumentRoot "e:/www/ww2"
                        ServerName ww2.winix.com
                        DirectoryIndex index.htm index.html index.jsp
                        ErrorLog logs/ww2-error_log
                        CustomLog logs/ww2-access_log common
                </VirtualHost>
   将ThreadsPerChild改为25,仅供测试
4、备份%resin_home%/conf/resin.conf,参照附件修改
        关闭8080端口
-----------------------------------------------------------------------------
    redhat7.3 + apache1.3.23 + resin-ee-2.1.6
1、安装j2sdk1.4.1,目录:/usr/local,并建一软链接/usr/local/j2sdk
2、apache使用redhat自带版本,最好下载安装redhat上的最新版本
3、解压resin-ee到/usr/local目录,建立软链接:ln -s resin-ee-2.1.6 resin
4、设置环境变量(/etc/profile)
        JAVA_HOME=/usr/local/j2sdk
        JRE=$JAVA_HOME/jre
        CLASSPATH=$JAVA_HOME/libJRE/lib
        export JAVA_HOME JRE CLASSPATH
        RESIN_HOME=/usr/local/resin-ee-2.1.6
        export RESIN_HOME
5、编译安装mod_caucho.so
        ./configure --with-apxs
        make
        make install
6、启动并测试resin
        cd bin
        ./http.sh;时间比较久,^c退出
        browse http://localhost:8080/
7、配置http.conf和resin.conf
        在http.conf后面增加或修改:
                LoadModule caucho_module /usr/lib/apache/mod_caucho.so
                #AddModule mod_caucho.c
                <IfModule mod_caucho.c>
                        CauchoConfigFile /usr/local/resin/conf/resin.conf
                        <Location /caucho-status>
                                SetHandler caucho-status
                        </Location>
                </IfModule>
        备份resin.conf,并参照附件修改
8、添加startup script
        cd /etc/init.d
        cp /usr/local/resin/contrib/init.resin resin
        chmod +x resin
        根据redhat的规则进行修改
                JAVA_HOME前增加
                        # Source function library.
                        . /etc/rc.d/init.d/functions
                修改
                        PID=/var/run/resin.pid
                        ARGS="-java_home $JAVA_HOME -resin_home $RESIN_HOME"
                $EXE -pid $PID start $ARGS >/dev/null 2>&1
                start的fi后增加
                       touch /var/lock/subsys/resin
                修改
                       $EXE -pid $PID stop >/dev/null 2>&1
                stop的rm -f $PID后增加
                       rm -f /var/lock/subsys/resin
9、测试
        service httpd start
        service resin start
        在/var/www/html目录下建一test.jsp,内容:2 + 2 = <%= 2 + 2 %>
        浏览http://localhost/test.jsp
10、用缺省配置启动resin
        cd $RESIN_HOME/bin
        ./http.sh -conf ../resin.conf.bak

-----------------------------------------------------------------------------
<caucho.com>
        <log id='/log' href='stderr:' timestamp='[%Y-%m-%d %H:%M:%S.%s]'/>
        <java compiler="internal" compiler-args=""/>
        <!--
           - Sample database pool configuration
           - The JDBC name is java:comp/env/jdbc/test
        <resource-ref>
          <res-ref-name>jdbc/test</res-ref-name>
          <res-type>javax.sql.DataSource</res-type>
          <init-param driver-name="com.caucho.jdbc.mysql.Driver"/>
          <init-param url="jdbc:mysql_caucho://localhost:3306/test"/>
          <init-param user=""/>
          <init-param password=""/>
          <init-param max-connections="20"/>
          <init-param max-idle-time="30"/>
        </resource-ref>
          -->
        <jsp precompile='true' static-encoding='true' recompile-on-error='true'/>
        <http-server>
                <app-dir>C:/apache/apache2/htdocs</app-dir>
                <http port='8080'/>
                <srun host='localhost' port='6802'/>
               
                <class-update-interval>2</class-update-interval>
                <servlet-classloader-hack>false</servlet-classloader-hack>
                <caucho-status>true</caucho-status>
                <thread-max>150</thread-max>
                <thread-keepalive id='100'/>
                <request-timeout id='30s'/>
                <accept-buffer-size id='256'/>
                <thread-min id='5'/>
                <ignore-client-disconnect>true</ignore-client-disconnect>
                <cache dir='cache' size='1024' entries='8192'/>
                <cache-mapping url-pattern='/' expires='2s'/>

                <servlet-mapping url-pattern='/servlets/*' servlet-name='invoker'/>
                <servlet-mapping url-pattern='*.xtp' servlet-name='com.caucho.jsp.XtpServlet'/>
                <servlet-mapping url-pattern='*.jsp' servlet-name='com.caucho.jsp.JspServlet'/>

                <welcome-file-list>index.xtp, index.jsp, index.html</welcome-file-list>
               
                <host id=''>
                    <error-log id='log/error.log'/>
                    <!--
                       - Specifies an automatically-expanding .war dir.  Any foo.war
                       - file will be expanded to a /foo application.
                    <war-dir id='webapps'/>
                      -->
                    <web-app id='/'>
                                <!--
                                 - The classpath directive may be repeated.  Source is optional
                                 - Servlets and beans generally belong in WEB-INF/classes
                                -->
                                <classpath id='WEB-INF/classes'
                                         source='WEB-INF/classes'
                                         compile='true'/>
                               
                                <session-config>
                                        <session-max>4096</session-max>
                                        <session-timeout>30</session-timeout>
                                        <enable-cookies>true</enable-cookies>
                                        <enable-url-rewriting>true</enable-url-rewriting>
                                       
                                        <!--
                                           - Store sessions in the filesystem, so they can persist across
                                           - servlet and class changes.
                                           -
                                           - Uncomment this during development.
                                          -->
                                        <file-store>WEB-INF/sessions</file-store>
                                </session-config>
                               
                                <!-- enable multipart-mime/form processing -->
                                <!--
                                 - <multipart-form upload-max='-1'/>
                                -->
                               
                                <!-- /~user maps to user directories -->
                                <!--
                                <path-mapping url-regexp='^/~([^/]*)' real-path='/home/$1/public_html/'/>
                                -->
                    </web-app>
                </host>
        </http-server>
</caucho.com>
发表于 2003-9-15 21:47:04 | 显示全部楼层
FT,无法上传文件
发表于 2003-9-16 09:26:45 | 显示全部楼层

单独用resin也一样。

根本不需要apache. 速度更快
 楼主| 发表于 2003-9-16 09:42:09 | 显示全部楼层
谢谢各位大侠,其实也觉得光用RESIN解析JSP比较好,但是出于各种原因,只能用APACHE+RESIN啊,最后谢谢winix
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表