之前用的resin3,结果发布新项目老师文件冲突,我也找不到是哪里有问题,于是尝试使用resin4.
首先从官网下载最新resin4。
然后放到opt下,tar -zvxf 解压。
然后修改conf/resin.xml。
另外,修改resin默认端口8080为其他:8070:
在conf/resin.property中找到8080并修改:
# Set HTTP and HTTPS ports. # Use overrides for individual server control, for example: app-0.http : 8081 app.http : 8070
最终修改如下: 1 <!-- 2 - Resin 4.0 configuration file.
3 -->
4 <resin xmlns="http://caucho.com/ns/resin"
5 xmlns:resin="urn:java:com.caucho.resin">
6
7 <!-- property-based Resin configuration -->
8 <resin:properties path="${__DIR__}/resin.properties" optional="true"/>
9
10 <resin:if test="${properties_import_url}">
11 <resin:properties path="${properties_import_url}"
12 optional="true" recover="true"/>
13 </resin:if>
14
15
16 <!-- Logging configuration for the JDK logging API -->
17 <log-handler name="" level="all" path="stdout:"
18 timestamp="[%y-%m-%d %H:%M:%S.%s]"
19 format=" {${thread}} ${log.message}"/>
20
21 <!--
22 - Alternative pseudo-TTCC log format
23 -
24 - <log-handler name="" level="all" path="stdout:"
25 - timestamp="%y-%m-%d %H:%M:%S.%s"
26 - format=" [${thread}] ${log.level} ${log.shortName} - ${log.message}"/>
27 -->
28
29 <!--
30 - level='info' for production
31 - 'fine' or 'finer' for development and troubleshooting
32 -->
33 <logger name="" level="${log_level?:'info'}"/>
34
35 <logger name="com.caucho.java" level="config"/>
36 <logger name="com.caucho.loader" level="config"/>
37
38 <!--
39 - Default configuration applied to all clusters, including
40 - HTTP, HTTPS, and /resin-admin configuration.
41 -->
42 <resin:import path="${__DIR__}/cluster-default.xml"/>
43
49
50
51
52 <!--
53 - Remote management requires at least one enabled admin user.
54 -->
55 <resin:AdminAuthenticator>
56 <user name="${admin_user}" password="${admin_password}"/>
57
58 <resin:import path="${__DIR__}/admin-users.xml" optional="true"/>
59 </resin:AdminAuthenticator>
60
61 <!--
62 - For clustered systems, create a password in as cluster_system_key
63 -->
64 <cluster-system-key>${cluster_system_key}</cluster-system-key>
65
66 <!--
67 - For production sites, change dependency-check-interval to something
68 - like 600s, so it only checks for updates every 10 minutes.
69 -->
70 <dependency-check-interval>${dependency_check_interval?:'2s'}</dependency-check-interval>
71
72 <!-- For resin.properties dynamic cluster joining -->
73 <home-cluster>${home_cluster}</home-cluster>
74 <home-server>${home_server}</home-server>
75 <elastic-server>${elastic_server}</elastic-server>
76 <elastic-dns>${elastic_dns}</elastic-dns>
77
78 <!--
79 - Configures the main application cluster. Load-balancing configurations
80 - will also have a web cluster.
81 -->
82 <cluster id="app">
83 <!-- define the servers in the cluster 这里配置端口 -->
84 <server-multi id-prefix="app-" address-list="127.0.0.1" port="6801">
85 <watchdog-port>6601</watchdog-port>
86 <http address="*" port="9097"/>
87 </server-multi>
88
89 <host-default>
90 <!-- creates the webapps directory for .war expansion 这里我把webapps修改到webapp,因为我只要发布一个项目,当然理解可能有问题-->
91 <web-app-deploy path="webapp"
92 expand-preserve-fileset="WEB-INF/work/**"
93 multiversion-routing="${webapp_multiversion_routing}"
94 path-suffix="${elastic_webapp?resin.id:''}"/>
95 </host-default>
96
97 <!-- auto virtual host deployment in hosts/foo.example.com/webapps -->
98 <host-deploy path="hosts">
99 <host-default>
100 <resin:import path="host.xml" optional="true"/>
101 </host-default>
102 </host-deploy>
103
<!-- 这里我修改/为我的项目路径,即直接使用项目路由分配,设置项目位置,设置日志按日期输出。-->
104 <host id="" root-directory=".">
105 <web-app id="/" root-directory="webapp/prnewsOrder">
106 <form-parameter-max>100</form-parameter-max>
107 <stderr-log path='log/stderr.log' timestamp='[%Y-%m-%d %H:%M:%S] ' rollover-period='1D'/>
108 <stdout-log path='log/stdout.log' timestamp='[%Y-%m-%d %H:%M:%S] ' rollover-period='1D'/>
109 </web-app>
110 </host>
111
112
113 </cluster>
114
115
116 <cluster id="proxycache">
117 <!-- define the servers in the cluster -->
118 <server-multi id-prefix="proxycache-" address-list="${proxycache_servers}" port="6830">
119 <http address="*" port="9078"/>
120 </server-multi>
121
122 <host id="" root-directory="proxycache">
123 <web-app id="">
124 <resin:HttpProxy regexp=".*">
125 <!-- backend HTTP servers to proxy to -->
126 <addresses>${backend_servers}</addresses>
127 </resin:HttpProxy>
128 </web-app>
129 </host>
130 </cluster>
131
132 </resin>