我是靠谱客的博主 危机流沙,这篇文章主要介绍resin3.0.10 入门 基本配置,现在分享给大家,希望可以做个参考。

复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
(我使用的jdk为:jdk1.5.0_01,环境变量JAVA_HOME=D:jdk1.5.0_01, path=D:jdk1.5.0_01bin;%SystemRoot%system32;%SystemRoot%;%SystemRoot%System32Wbem;) 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.10confresin.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:windowssystem32driversetchost文件里加上下面一行: 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_01jrelibendorsed下面(没有这个目录就创建这个目录) 重新启动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'/> <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.10setup.exe 点Apply即可。 我的电脑-->右键-->管理-->Internet信息服务-->网站-->默认网站, 右键--〉属性-->ISAPI筛选器-->添加 筛选器名称:Resin_3.0.10 可执行文件:C:Inetpubscriptsisapi_srun.dll 确定,然后重新启动iis。再启动resin.此时就可以访问 http://localhost/index.jsp了 如果没有启动resin。 将得到下面的错误信息: Can't contact Servlet Runner at localhost:6802


 

最后

以上就是危机流沙最近收集整理的关于resin3.0.10 入门 基本配置的全部内容,更多相关resin3.0.10内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(52)

评论列表共有 0 条评论

立即
投稿
返回
顶部