cd /usr/local/src

wget http://a.lishiming.net/data/resin-4.0.45.tar.gz

wget http://a.lishiming.net/data/resin-4.0.45.tar.gz

tar -zxvf resin-4.0.45.tar.gz

cd resin-4.0.45

编译

./configure --prefix=/usr/local/resin --with-java=/usr/local/jdk1.8.0_131

make

make install

启动

/etc/init.d/tomcat stop  以免期冲突

/etc/init.d/resin start

cd /usr/local/resin/conf/

vim resin.properties

app.http          : 8080

改为

app.http          : 80

修改虚拟主机

[root@mingming conf]# vim resin.xml

<cluster id="app">

<!-- define the servers in the cluster -->

<server-multi id-prefix="app-" address-list="${app_servers}" port="6800"/>

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

<!-- 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>

<!-- 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"/>

</host>

下加上

</host>

<host id="www.123.com" root=".">

<web-app id="/" root-directory="/tmp/resin">

</host>

</cluster>

保存

mkdir /tmp/resin

重启

/etc/init.d/resin restart

测试

cp /data/tomcatweb/111.jsp /tmp/resin/

[root@mingming conf]# curl -xlocalhost:80 www.123.com/111.jsp

<html><body><center>

Now time is: Thu Jun 13 15:26:03 CST 2013

</center></body></html>