[iyunv@resin ~]# vim /usr/local/resin/conf/resin.xml
<host id="" root-directory="/webdata">
<!--
- webapps can be overridden/extended in the resin.xml
-->
<web-app id="/" root-directory="api"/>
</host>
3.重启resin服务
1
[iyunv@resin ~]# /etc/init.d/resin restart
测试结果
四、resin基于域名和目录的部署
【第一种配置方法】
1
2
3
4
5
6
7
8
9
10
11
<!-- the default host, matching any host name -->
<host id="" root-directory=".">
<!--
- webapps can be overridden/extended in the resin.xml
-->
<web-app id="/" root-directory="webapps/ROOT"/>
<web-app id="/api" root-directory="webapps/api"/>
<web-app id="/cms1" root-directory="/www/cms1.cdvcloud.com"/>
<web-app id="/cms2" root-directory="/www/cms2.cdvcloud.com"/>
</host>
【第二种配置方法】
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#第一个appserver
<host id="www.allentuns.com" root-directory=".">
<!--
- webapps can be overridden/extended in the resin.xml
-->
<web-app id="/" root-directory="webapps/tset1/ROOT"/>
</host>
#第二个appserver
<host id="www.zhengyansheng.com" root-directory=".">
<!--
- webapps can be overridden/extended in the resin.xml
-->
<web-app id="/" root-directory="webapps/test2/ROOT"/>
[iyunv@Resin ~]# cd /usr/local/resion/conf/
[iyunv@Resin conf]# vim resin.xml
#只展示重点部分
#注释:Resin默认端口是8080;添加如下代码,在本机配置两个实例端口为8081、8082
<cluster id="app1">
<!-- define the servers in the cluster -->
<server-multi id-prefix="app1" address-list="${app1_servers}" port="6801"/>
<!-- the default host, matching any host name -->
<host id="" root-directory=".">
<!--
- webapps can be overridden/extended in the resin.xml
-->
<web-app id="/" root-directory="/var/www/html/app1/ROOT"/>
</host>
</cluster>
<cluster id="app2">
<!-- define the servers in the cluster -->
<server-multi id-prefix="app2" address-list="${app2_servers}" port="6802"/>
<!-- the default host, matching any host name -->
<host id="" root-directory=".">
<!--
- webapps can be overridden/extended in the resin.xml
-->
<web-app id="/" root-directory="/var/www/html/app2/ROOT"/>