resin 3.01配置

(我使用的jdk为:jdk1.5.0_01,环境变量JAVA_HOME=D:\jdk1.5.0_01,

path=D:\jdk1.5.0_01\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;)

1.下载:http://www.caucho.com/download/resin-3.0.10.zip

解压到D:\resin-3.0.10

2.运行setup.exe。指定resin Home:D:\resin-3.0.10

3.运行httpd.exe.

4.修改端口为80:打开D:\resin-3.0.10\conf\resin.conf,

找到"8080",修改为80,保存,重新启动resin。
<!-- The http port -->
<http server-id="" host="*" port="80"/>

5.发布webapp:

在resin.conf的结尾处: <host id="" root-directory=".">
<!--
- configures an explicit root web-app matching the
- webapp's ROOT
-->
<web-app id='/' document-directory="webapps/ROOT"/>
</host>

修改为:

<host id="" root-directory=".">
<!--
- configures an explicit root web-app matching the
- webapp's ROOT
-->
<web-app id='/' document-directory="webapps/ROOT"/>

<web-app id='/lizongbo' document-directory="E:/lizongbo/oscachedemo/test"/>
</host>

重新启动resin,访问 http://localhost/lizongbo/ 就可以看到效果。

6.配置虚拟主机:

在文件结尾处</server>之前加上下面一段:



<host id="lizongbo.myresintest.com" root-directory=".">
<web-app id='/' document-directory="webapps/ROOT"/>
<web-app id='/lizongbo' document-directory="E:/jb/oscachedemo/test"/>
</host>

保存文件。

在c:\windows\system32\drivers\etc\host文件里加上下面一行:

lizongbo.myresintest.com 127.0.0.1



保存host文件。

重新启动resin,重新打开浏览器。输入http://lizongbo.myresintest.com/lizongbo/

就可以看到虚拟主机配置成功。



7.发布我的webapp的时候遇到了下面的错误信息。

org.xml.sax.SAXNotRecognizedException: http://xml.org/sax/features/validation

查找资料http://www.google.com/search?hl=zh-CN&inlang=zh-CN&newwindow=1&q=resin+org.xml.sax.SAXNotRecognizedException&lr=,(参考:http://www.slamb.org/svn/repos/projects/axamol/sax-pipeline/README)

需要新建一个 jaxp.properties, 内容如下:

javax.xml.parsers.SAXParserFactory: org.apache.xerces.jaxp.SAXParserFactoryImpl

保存文件到$JAVA_HOME/jre/lib/下面

接下来可能会出现下面的错误信息:

javax.xml.parsers.FactoryConfigurationError: Provider org.apache.xerces.jaxp.SAX
ParserFactoryImpl could not be instantiated: java.lang.NullPointerException

因此还需要把xercesImpl.jar复制到D:\jdk1.5.0_01\jre\lib\endorsed下面(没有这个目录就创建这个目录)

重新启动resin,我的webapp启动成功了。

访问 http://lizongbo.myresintest.com/mywebapp/,页面正常出现。

b.另外一种更简单的解决方法,不需要修改jdk的配置

((此方法没有测试过,请参考http://www-900.ibm.com/developerWorks/cn/webservices/ws-axisfaq/index.shtml和http://www.caucho.com/quercus/faq/question.xtp?question_id=295)):

<host id="lizongbo.myresintest.com" root-directory=".">
<web-app id='/' document-directory="webapps/ROOT"/>
<web-app id='/lizongbo' document-directory="E:/jb/oscachedemo/test">

<system-property javax.xml.transform.TransformerFactory="org.apache.xalan.processor.TransformerFactoryImpl"/>
<system-property javax.xml.parsers.DocumentBuilderFactory="org.apache.xerces.jaxp.DocumentBuilderFactoryImpl"/>
<system-property javax.xml.parsers.SAXParserFactory="org.apache.xerces.jaxp.SAXParserFactoryImpl"/>
<system-property org.xml.sax.driver="org.apache.xerces.parsers.SAXParser"/>

</web-app>
</host>



8.resin支持二级域名。

同6,主机名和doc路径,都使用正则表达式。

(例子:<host url-regexp='^([^/]*).test.com' app-dir='web/$1'/>)
<host id="^(*).lizongbo.com" root-directory=".">

<!--
- configures an explicit root web-app matching the
- webapp's ROOT
-->
<web-app id='/' document-directory="webapps/ROOT"/>
<web-app id='/lizongbo' document-directory="E:/jb/oscachedemo/test"/>
</host>

再配合上泛域名解析,就非常方便了。

(在host文件里加上

127.0.0.1 aaa.lizongbo.com

127.0.0.1 bbb.lizongbo.com

然后访问这两个主机名,可以看见虚拟主机解析成功。

)

9.在Jbuilder2005中支持resin.

在 http://www.caucho.com/projects/index.xtp 下载 http://www.caucho.com/projects/jbuilder/resin-jbuilder-7.jar

保存到 JBuilderHome/lib/ext下。

(Jb2005不支持)



10.一个host配置参考:



<host id='www.lizongbo.com'>
<welcome-file-list>index.jsp, index.htm, index.html </welcome-file-list>
<error-log id='logs/lizongbo.com.log'/>
<doc-dir>E:/jb/lizongbo/webapp</doc-dir>
<web-app id='/'>
<classpath id='WEB-INF/classes'
source='WEB-INF/classes'
compile='false'/>
<servlet-mapping url-pattern='/servlet/*' servlet-name='invoker'/>
<servlet-mapping url-pattern='*.jsp' servlet-name='jsp'/>
<servlet-mapping url-pattern='*.html' servlet-name='jsp'/>


<character-encoding>UTF-8</character-encoding>

<session-config>
<session-max>4096</session-max>
<session-timeout>30</session-timeout>
<enable-cookies>true</enable-cookies>
<enable-url-rewriting>true</enable-url-rewriting>
</session-config>
</web-app>
</host>


11.与IIS整合。

安装好(WinXP+SP2下的)IIS,运行D:\resin-3.0.10\setup.exe


点Apply即可。

我的电脑-->右键-->管理-->Internet信息服务-->网站-->默认网站,

右键--〉属性-->ISAPI筛选器-->添加

筛选器名称:Resin_3.0.10

可执行文件:C:\Inetpub\scripts\isapi_srun.dll


确定,然后重新启动iis。再启动resin.此时就可以访问

http://localhost/index.jsp了

如果没有启动resin。

将得到下面的错误信息:


Can't contact Servlet Runner at localhost:6802
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值