我这里的jdk采用的是1.8版本的rpm包,包可以从官网上下载
http://www.oracle.com/technetwork/cn/java/javase/downloads/jdk8-downloads-2133151-zhs.html
下载完成后上传到服务器上安装
rpm -ivh jdk-8u40-linux-x64.rpm
安装完成之后需要在/etc/profile中加入如下环境变量
JAVA_HOME=/usr/java/jdk1.8.0_40
JAVA_BIN=/usr/java/jdk1.8.0_40/bin
JRE_HOME=/usr/java/jdk1.8.0_40/jre
PATH=$PATH:/usr/java/jdk1.8.0_40/bin:/usr/java/jdk1.8.0_40/jre/bin
CLASSPATH=/usr/java/jdk1.8.0_40/jre/lib:/usr/java/jdk1.8.0_40/lib:/usr/java/jdk1.8.0_40/jre/lib/charsets.jar
Wget www.aminglinux.com/bbs/data/attachment/forum/resin-4.0.36.tar.gz
tar zxvf resin-4.0.36.tar.gz
cd resin-4.0.36
./configure --prefix=/usr/local/resin --with-java-home=/usr/java/jdk1.8.0_40
make && make install
/etc/init.d/resin start
cd /usr/local/resin/conf
vim resin.xml
结构: <cluster id="app"> <host></host> </cluster> 虚拟主机配置就在<host></host>里配置
<host id="www.123.com" root-directory=".">
<web-app id="/" root-directory="/tmp/123"/>
</host>
注意,这里并不是在</host>下面再加一段,而是直接更改里面的<host></host>
vim /tmp/123/111.jsp //加入
<html><body><center>
Now time is: <%=new java.util.Date()%>
</center></body></html>
在本地实验时需要在主机的host中加入域名解析
测试 :
curl http://127.0.0.1 www.123.com/111.jsp
参考资料:http://blog.csdn.net/howareyouo/article/details/7776875
原文地址:http://881955.blog.51cto.com/871955/1662773