resin4.0.53安装部署文档

resin4.0.53安装部署文档


1.下载安装包

wget http://caucho.com/download/resin-4.0.53.tar.gz

2.解压安装

tar xzvf resin-4.0.53.tar.gz
cd resin-4.0.53
./configure --prefix=/data/resin-4.0.53
make && make install

3.配置resin.properties

cd /data/resin-4.0.53/conf
vim resin.properties

将app_servers参数改为127.0.0.1:6852

注释app.http和web.http

一定要注释app.http,app_servers参数改不改也可以,因为我们会在resin.xml中不使用它,不改的话,会有歧义

4.配置resin.xml,修改端口与部署war包

vim resin.xml

删除id不是app的cluster,只保留app cluster,其余不需要,此cluster的示例配置如下:

<cluster id="app">
<!--
<server-multi id-prefix="app-" address-list="${app_servers}" port="6800"/>
-->
<server id="app" address="127.0.0.1" port="6852" >
    <watchdog-port>4852</watchdog-port>
    <http address="*" port="8852"/>
</server>

<host-default>
  <!-- creates the webapps directory for .war expansion -->
  <web-app-deploy path="webapps"
                  expand-preserve-fileset="WEB-INF/work/**"
                  multiversion-routing="${webapp_multiversion_routing}"
                  path-suffix="${elastic_webapp?resin.id:''}"/>
</host-default>

<!-- the default host, matching any host name -->
<host id="" root-directory=".">
  <web-app id="/" root-directory="/path/to/appdir"/>    
</host>

<resin:if test="${resin_doc}">
  <host id="${resin_doc_host}" root-directory="${resin_doc_host}">
    <web-app id="/resin-doc" root-directory="${resin.root}/doc/resin-doc"/>
  </host>
</resin:if>
</cluster>

重点关注server与host标签

server配置了管理端口:6852,监控端口:4852,http端口:8852

管理端口:resin内部管理使用

监控端口:类似守护进度,时刻关注resin是否挂了,若挂了则重启

http端口:对外开放使用的http端口

host配置了app路径,如果是部署war包,使用以下配置

<host id="" root-directory=".">
  <web-app id="/" root-directory="webapps/app" archive-path="/path/to/app.war"/>
</host>

web-app标签解释

archive-path:war包路径

root-directory:war包解压之后的文件存放路径

5.启动/停止/重启 resin

cd resin-4.0.53/bin
./resinctl start
./resinctl stop
./resinctl restart
./resinctl status
./resinctl console

附加说明

在resin中使用spring框架注入properties文件时,若properties文件未找到,则需要修改配置

<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
    <property name="locations" value="classpath:*.properties" />
    <property name="ignoreUnresolvablePlaceholders" value="true" />
</bean>

classpath:*.properties改为classpath*:*.properties即可

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值