resin4.0.53安装部署文档(Linux)

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即可

本文转载于:https://blog.csdn.net/zhanngle/article/details/77591530


猜你喜欢

转载自blog.csdn.net/qq_15092079/article/details/80944093