设为首页 收藏本站
查看: 271|回复: 0

[经验分享] 从tomcat移动到resin的问题

[复制链接]
发表于 2017-2-2 09:07:36 | 显示全部楼层 |阅读模式
  resin版本3.0.x

  本来一个项目是依赖于tomcat服务器开发的,但 由于的客户的要求,必须移植到resin服务器下运行。其实很简单,没什么大的问题,这两个服务器的兼容性是比较好的。只需要把要发布的项目放在resin的\webapps目录下就可以。
  不同的就是,如果web.xml文件,存在<description>标签的话,必须删除不然在resin运行,会报错。
  不需要改变resin.conf配置文件就可以运行了,不论项目是否运用了SSH框架,一般不会出问题的。当然有时候报的错,可能是xml文件的解析的冲突,检查一下
  如果还是报错的,需要修改resin.conf配置文件的话,这里有一份参考的,贴出来看看,根据需要对比修改。如果不了解配置文件的内容,可以参考这里的中文说明 http://tongjian.iteye.com/blog/268966

<!--
- Resin 3.0 configuration file.
-->
<resin xmlns="http://caucho.com/ns/resin"
xmlns:resin="http://caucho.com/ns/resin/core">
<!--
- Logging configuration for the JDK logging API.
-->
<log name="" path="stdout:" timestamp="[%H:%M:%S.%s] "/>
<logger name="com.caucho.java" level="config"/>
<logger name="com.caucho.loader" level="config"/>
<!--
- For production sites, change dependency-check-interval to something
- like 600s, so it only checks for updates every 10 minutes.
-->
<dependency-check-interval>2s</dependency-check-interval>
<!--
- You can change the compiler to "javac" or jikes.
- The default is "internal" only because it's the most
- likely to be available.
-->
<javac compiler="internal" args=""/>
<!-- Security providers.
- <security-provider>
-    com.sun.net.ssl.internal.ssl.Provider
- </security-provider>
-->
<!--
- If starting bin/resin as root on Unix, specify the user name
- and group name for the web server user.
-
- <user-name>resin</user-name>
- <group-name>resin</group-name>
-->
<!--
- Configures threads shared among all HTTP and SRUN ports.
-->
<thread-pool>
<!-- Maximum number of threads. -->
<thread-max>1024</thread-max>
<!-- Minimum number of spare connection threads. -->
<spare-thread-min>10</spare-thread-min>
</thread-pool>
<!--
- Configures the minimum free memory allowed before Resin
- will force a restart.
-->
<min-free-memory>1M</min-free-memory>
<server>
<!-- adds all .jar files under the resin/lib directory -->
<class-loader>
<tree-loader path="${resin.home}/lib"/>
<tree-loader path="${server.root}/lib"/>
</class-loader>
<!-- Configures the keepalive -->
<keepalive-max>500</keepalive-max>
<keepalive-timeout>120s</keepalive-timeout>
<resin:if test="${resin.isProfessional()}">
<select-manager enable="true"/>
</resin:if>
<!-- listen to the http ports only after the server has started. -->
<bind-ports-after-start/>
<!-- The http port -->
<http server-id="" host="*" port="8081"/>
<!--
- SSL port configuration:
-
- <http port="8443">
-   <openssl>
-     <certificate-file>keys/gryffindor.crt</certificate-file>
-     <certificate-key-file>keys/gryffindor.key</certificate-key-file>
-     <password>test123</password>
-   </openssl>
- </http>
-->
<!--
- The local cluster, used for load balancing and distributed
- backup.
-->
<cluster>
<srun server-id="" host="127.0.0.1" port="6802"/>
</cluster>
<!--
- Configures the persistent store for single-server or clustered
- in Resin professional.
-->
<resin:if test="${resin.isProfessional()}">
<persistent-store type="cluster">
<init path="session"/>
</persistent-store>
</resin:if>
<!--
- Enables/disables exceptions when the browser closes a connection.
-->
<ignore-client-disconnect>true</ignore-client-disconnect>
<!--
- For security, use a different cookie for SSL sessions.
- <ssl-session-cookie>SSL_JSESSIONID</ssl-session-cookie>
-->
<!--
- Enables the cache (available in Resin Professional)
-->
<resin:if test="${isResinProfessional}">
<cache path="cache" memory-size="8M"/>
</resin:if>
<!--
- Enables periodic checking of the server status.
-
- With JDK 1.5, this will ask the JDK to check for deadlocks.
- All servers can add <url>s to be checked.
-->
<resin:if test="${isResinProfessional}">
<ping>
<!-- <url>http://localhost:8080/test-ping.jsp</url> -->
</ping>
</resin:if>
<!--
- Defaults applied to each web-app.
-->
<web-app-default>
<!--
- Extension library for common jar files.  The ext is safe
- even for non-classloader aware jars.  The loaded classes
- will be loaded separately for each web-app, i.e. the class
- itself will be distinct.
-->
<class-loader>
<tree-loader path="${server.root}/ext-webapp"/>
</class-loader>
<!--
- Sets timeout values for cacheable pages, e.g. static pages.
-->
<cache-mapping url-pattern="/" expires="5s"/>
<cache-mapping url-pattern="*.gif" expires="60s"/>
<cache-mapping url-pattern="*.jpg" expires="60s"/>
<!--
- Servlet to use for directory display.
-->
<servlet servlet-name="directory"
servlet-class="com.caucho.servlets.DirectoryServlet"/>
<!--
- Enable EL expressions in Servlet and Filter init-param
-->
<allow-servlet-el/>
<!--
- for security, disable session URLs by default.
-->
<!--session-config>
<enable-url-rewriting>false</enable-url-rewriting>
</session-config-->
<session-config enable-cookies='false' enable-url-rewriting='true'/>
<!--
- For security, set the HttpOnly flag in cookies.
- <cookie-http-only/>
-->
</web-app-default>
<!--
- Sample database pool configuration
-
- The JDBC name is java:comp/env/jdbc/test
<database>
<jndi-name>jdbc/mysql</jndi-name>
<driver type="org.gjt.mm.mysql.Driver">
<url>jdbc:mysql://localhost:3306/test</url>
<user></user>
<password></password>
</driver>
<prepared-statement-cache-size>8</prepared-statement-cache-size>
<max-connections>20</max-connections>
<max-idle-time>30s</max-idle-time>
</database>
-->
<!--
- Default host configuration applied to all virtual hosts.
-->
<host-default>
<class-loader>
<compiling-loader path="webapps/WEB-INF/classes"/>
<library-loader path="webapps/WEB-INF/lib"/>
</class-loader>
<!--
- With another web server, like Apache, this can be commented out
- because the web server will log this information.
-->
<access-log path="logs/access.log"
format='%h %l %u %t "%r" %s %b "%{Referer}i" "%{User-Agent}i"'
rollover-period="1W"/>
<!-- creates the webapps directory for .war expansion -->
<web-app-deploy path="webapps"/>
<!-- creates the deploy directory for .ear expansion -->
<ear-deploy path="deploy">
<ear-default>
<!-- Configure this for the ejb server
-
- <ejb-server>
-   <config-directory>WEB-INF</config-directory>
-   <data-source>jdbc/test</data-source>
- </ejb-server>
-->
</ear-default>
</ear-deploy>
<!-- creates the deploy directory for .rar expansion -->
<resource-deploy path="deploy"/>
<!-- creates a second deploy directory for .war expansion -->
<web-app-deploy path="deploy"/>
</host-default>
<!-- includes the web-app-default for default web-app behavior -->
<resin:import path="${resin.home}/conf/app-default.xml"/>
<!-- configures a deployment directory for virtual hosts -->
<host-deploy path="hosts">
<host-default>
<resin:import path="host.xml" optional="true"/>
</host-default>
</host-deploy>
<!-- configures the default host, matching any host name -->
<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="/OA" document-directory="D:/OA">
<!--jsp fast-jstl="false"/-->
<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"/>
<servlet-mapping url-pattern='/*' servlet-name='plugin_match'/>
<servlet-mapping url-pattern='*.do' servlet-name='action'/>
<servlet-mapping url-pattern='/j_security_check/*' servlet-name='plugin_match'/>
<servlet-mapping url-pattern='*.htm' servlet-name='action'/>
<servlet-mapping url-pattern='/codeServlet/*' servlet-name='plugin_match'/>
</web-app>
<resin:if test="${java.isJava5()}">
<!--
- Administration application /resin-admin
-
- password is the md5 hash of the password.
- localhost is true to limit access to the localhost
-->
<resin:set var="resin_admin_password"  default=""/>
<resin:set var="resin_admin_localhost" default="true"/>
<web-app id="/resin-admin" document-directory="${resin.home}/php/admin"/>
</resin:if>
</host>
</server>
</resin>

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-336373-1-1.html 上篇帖子: Tomcat DBCP 连接池参数说明 下篇帖子: 在windows上配置lighttpd+tomcat
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

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