Installing the JDK
wget http://nj02.poms.baidupcs.com/file/32f19f3a0fb872f363689c85321e0021?bkt= P3-140032f19f3a0fb872f363689c85321e0021c081421d00000391386b&fid=2150970041-250528-268937617971823&time =1459413386&sign=fdtaxgerlbh-dcb740ccc5511e5e8fedcff06b081203-sngl2x7z1%2bshajh1ewdkxte5hoe%3d&to=n2b &fm=nan,b,t,t&sta_dx=57&sta_cs=0&sta_ft=gz&sta_ct=0&fm2=nanjing02,b,t,t&newver=1 &newfm=1&secfm=1&flow_ver=3&pkey=140032f19f3a0fb872f363689c85321e0021c081421d00000391386b& sl=77660238&expires=8h&rt=pr&r=440362609&mlogid=2103402834800013704&vuk=2150970041& vbdid=1645308789&fin=server-jre-8u77-linux-x64.tar.gz&fn=server-jre-8u77-linux-x64.tar.gz&slt=pm &uta=0&rtype=1&iv=0&isw=0&dp-logid=2103402834800013704&dp-callid=0.1.1
TAR-XF server-jre-8u77-linux-x64.tar.gz
Mkdir/usr/local/java
MV jdk1.8.0_77//usr/local/java/
Vim/etc/profile at the end add the following
Export java_home=/usr/local/java/jdk1.8.0_77/
Export classpath= $CLASSPATH: $JAVA _homeb: $JAVA _home/jreb
Export path= $JAVA _home/bin: $JAVA _home/jre/bin: $PATH: $HOMR/bin
Source/etc/profile
[Email protected] java]# Source/etc/profile
[Email protected] java]# java-version
Java Version "1.8.0_77"
Java (TM) SE Runtime Environment (build 1.8.0_77-b03)
Java HotSpot (TM) 64-bit Server VM (build 25.77-b03, Mixed mode)
Installing resin
wget http://nj01ct01.baidupcs.com/file/068982f303ad297c3b503c5b1c2f5aa5?bkt= P3-1400068982f303ad297c3b503c5b1c2f5aa52287038a00000198c14b&fid=2150970041-250528-245424891824325&time =1459413383&sign=fdtaxgerlbh-dcb740ccc5511e5e8fedcff06b081203-tlqf9rro7bkrihnd7xfimonhrfo%3d&to=njhb &fm=nan,b,t,t&sta_dx=26&sta_cs=0&sta_ft=gz&sta_ct=0&fm2=nanjing,b,t,t&newver=1 &newfm=1&secfm=1&flow_ver=3&pkey=1400068982f303ad297c3b503c5b1c2f5aa52287038a00000198c14b& sl=77660238&expires=8h&rt=pr&r=163555855&mlogid=2103401997557105771&vuk=2150970041& vbdid=1645308789&fin=resin-4.0.44.tar.gz&fn=resin-4.0.44.tar.gz&slt=pm&uta=0&rtype=1& iv=0&isw=0&dp-logid=2103401997557105771&dp-callid=0.1.1
TAR-XF resin-4.0.44.tar.gz
CD resin-4.0.44
./configure--prefix=/usr/local/resin--with-resin-log=/usr/local/resin/logs--with-java-home=/usr/local/java/ jdk1.8.0_77/
Make make Install
/usr/local/resin/bin/resinctl start
Virtual Host Configuration
Cd/usr/local/resin
Cp-r WebApps WEBAPPS2
CP Conf/resin.xml Conf/resin2.xml
Modify the Resin2.xml as follows Red Part
<cluster id= "app2" >
<!--define the servers in the cluster-
<server-multi id-prefix= "app2-" address-list= "${app_servers2}" port= "6801"/>
<!--creates the WebApps directory for. War Expansion--
<web-app-deploy path= "webapps2"
expand-preserve-fileset= "web-inf/work/**"
multiversion-routing= "${webapp_multiversion_routing}"
path-suffix= "${elastic_webapp?resin.id: '}"/>
<!--Auto Virtual host deployment in Hosts/foo.example.com/webapps--
<resin:import path= "Host.xml" optional= "true"/>
<!--The default host, matching any host name--
<!--
-WebApps can overridden/extended in the Resin.xml
-
<web-app id= "/" root-directory="Webapps2/root"/>
<resin:if test= "${resin_doc}" >
<web-app id= "/resin-doc" root-directory= "${resin.root}/doc/resin-doc"/>
</resin:if>
</cluster>
<cluster id= "Web" >
<!--define the servers in the cluster-
<server-multi id-prefix= "web-" address-list= "${web_servers}" port= "6810"/>
<web-app id= "" >
<resin:loadbalance regexp= "" cluster= "app2"/>
</web-app>
<web-app id= "/async" >
<resin:loadbalance regexp= "" cluster= "app2"/>
</web-app>
</cluster>
Modify the Resin.properties file
Add app2.http:8081 app_servers2:127.0.0.1:6801
app_servers:127.0.0.1:6800
app_servers2:127.0.0.1:6801
app.http:8080
app2.http:8081
Start the service when you are finished modifying
/usr/local/resin/bin/resin.sh-conf/usr/local/resin/conf/resin.xml start
/usr/local/resin/bin/resin.sh-conf/usr/local/resin/conf/resin2.xml start
Test
vim/usr/local/resin/webapps/root/index.jsp
<body>
<%=new java.util.Date ()%>
</body>
vim/usr/local/resin/webapps2/root/index.jsp
<body>
<%=new java.util.Date ()%>
</body>
Chmiod +x/usr/local/resin/webapps/root/index.jsp
Chmiod +x/usr/local/resin/webapps2/root/index.jsp
To this finish about static and dynamic separation and load balancing and Tomcat is not demonstrated here.
This article from "No Trace" blog, declined reproduced!
Resin Virtual Host Configuration