您的位置:首页 > 其它

resin4的初次配置与使用

2015-08-07 17:59 645 查看
之前用的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.

-->
<resin xmlns="http://caucho.com/ns/resin"
xmlns:resin="urn:java:com.caucho.resin">

<!-- property-based Resin configuration -->
<resin:properties path="${__DIR__}/resin.properties" optional="true"/>

<resin:if test="${properties_import_url}">
<resin:properties path="${properties_import_url}"
optional="true" recover="true"/>
</resin:if>

<!-- Logging configuration for the JDK logging API -->
<log-handler name="" level="all" path="stdout:"
timestamp="[%y-%m-%d %H:%M:%S.%s]"
format=" {${thread}} ${log.message}"/>

<!--
- Alternative pseudo-TTCC log format
-
- <log-handler name="" level="all" path="stdout:"
-           timestamp="%y-%m-%d %H:%M:%S.%s"
-           format=" [${thread}] ${log.level} ${log.shortName} - ${log.message}"/>
-->

<!--
- level='info' for production
- 'fine' or 'finer' for development and troubleshooting
-->
<logger name="" level="${log_level?:'info'}"/>

<logger name="com.caucho.java" level="config"/>
<logger name="com.caucho.loader" level="config"/>

<!--
- Default configuration applied to all clusters, including
- HTTP, HTTPS, and /resin-admin configuration.
-->
<resin:import path="${__DIR__}/cluster-default.xml"/>

<!--
- Remote management requires at least one enabled admin user.
-->
<resin:AdminAuthenticator>
<user name="${admin_user}" password="${admin_password}"/>

<resin:import path="${__DIR__}/admin-users.xml" optional="true"/>
</resin:AdminAuthenticator>

<!--
- For clustered systems, create a password in as cluster_system_key
-->
<cluster-system-key>${cluster_system_key}</cluster-system-key>

<!--
- For production sites, change dependency-check-interval to something
- like 600s, so it only checks for updates every 10 minutes.
-->
<dependency-check-interval>${dependency_check_interval?:'2s'}</dependency-check-interval>

<!-- For resin.properties dynamic cluster joining -->
<home-cluster>${home_cluster}</home-cluster>
<home-server>${home_server}</home-server>
<elastic-server>${elastic_server}</elastic-server>
<elastic-dns>${elastic_dns}</elastic-dns>

<!--
- Configures the main application cluster.  Load-balancing configurations
- will also have a web cluster.
-->
<cluster id="app">
<!-- define the servers in the cluster 这里配置端口 -->
<server-multi id-prefix="app-" address-list="127.0.0.1" port="6801">
<watchdog-port>6601</watchdog-port>
<http address="*" port="9097"/>
</server-multi>

<host-default>
<!-- creates the webapps directory for .war expansion  这里我把webapps修改到webapp,因为我只要发布一个项目,当然理解可能有问题-->
<web-app-deploy path="webapp"
expand-preserve-fileset="WEB-INF/work/**"
multiversion-routing="${webapp_multiversion_routing}"
path-suffix="${elastic_webapp?resin.id:''}"/>
</host-default>

<!-- auto virtual host deployment in hosts/foo.example.com/webapps -->
<host-deploy path="hosts">
<host-default>
<resin:import path="host.xml" optional="true"/>
</host-default>
</host-deploy>

     <!-- 这里我修改/为我的项目路径,即直接使用项目路由分配,设置项目位置,设置日志按日期输出。-->
<host id="" root-directory=".">
<web-app id="/" root-directory="webapp/prnewsOrder">
<form-parameter-max>100</form-parameter-max>
<stderr-log path='log/stderr.log' timestamp='[%Y-%m-%d %H:%M:%S] ' rollover-period='1D'/>
<stdout-log path='log/stdout.log' timestamp='[%Y-%m-%d %H:%M:%S] ' rollover-period='1D'/>
</web-app>
</host>

</cluster>

<cluster id="proxycache">
<!-- define the servers in the cluster -->
<server-multi id-prefix="proxycache-" address-list="${proxycache_servers}" port="6830">
<http address="*" port="9078"/>
</server-multi>

<host id="" root-directory="proxycache">
<web-app id="">
<resin:HttpProxy regexp=".*">
<!-- backend HTTP servers to proxy to -->
<addresses>${backend_servers}</addresses>
</resin:HttpProxy>
</web-app>
</host>
</cluster>

</resin>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: