1、去官网下载程序并上传以src目录解压
tar -zxvf resin-4.0.45.tar.gz
2、配置编译参数
cd resin-4.0.45
./configure --prefix=/usr/local/resin --with-java=/usr/local/jdk1.8.0_91/
3、编译
make
4、安装
make install
5、关闭tomcat服务(占用80端口)启动resin
/etc/init.d/tomcat stop
/etc/init.d/resin start
6、查看监听端口
netstat -lnp |grep java
tcp 0 0 127.0.0.1:6800 0.0.0.0:* LISTEN 44795/java
tcp 0 0 127.0.0.1:6600 0.0.0.0:* LISTEN 44747/java
tcp 0 0 :::8080 :::* LISTEN 44795/java
unix 2 [ ACC ] STREAM LISTENING 114909 44747/java /tmp/.java_pid44747.tmp
也可以使用浏览器访问:http://10.10.13.247:8080/
7、修改默认监听端口
cd /usr/local/resin/conf/
vim resin.properties
将
app.http : 8080
web.http : 8080
改为
app.http : 8080
web.http : 80
8、重启查看监听端口变成80
netstat -lnp |grep java
tcp 0 0 127.0.0.1:6800 0.0.0.0:* LISTEN 45170/java
tcp 0 0 127.0.0.1:6600 0.0.0.0:* LISTEN 45123/java
tcp 0 0 :::80 :::* LISTEN 45170/java
unix 2 [ ACC ] STREAM LISTENING 115855 45123/java /tmp/.java_pid45123.tmp
9、添加虚拟主机测试jsp访问
vim /usr/local/resin/conf/resin.xml
修改编辑文件
在此段 <host id="" root-directory=".">
<!--
- webapps can be overridden/extended in the resin.xml
-->
<web-app id="/" root-directory="webapps/ROOT"/>
</host>
插入以下配置
<host id="www.123.com" root-directory=".">
<web-app id="/" root-directory="/tmp/resin"/>
</host>
使用curl测试
cp /data/tomcatweb/1.jsp /tmp/resin/
curl -xlocalhost:80 www.123.com/1.jsp
<html><body><center>
Now time is: Thu Jun 02 14:24:55 CST 2016
</center></body></html>
#解析正常