它和tomcat类似,都可以去解析jsp,当然,它也需要安装jdk
## 下载
[root@wy ~]# cd /usr/local/src
[root@wy src]# wget http://www.caucho.com/download/resin-4.0.36.tar.gz
## 解压
[root@wy src]# tar zxvf resin-4.0.36.tar.gz
## 编译安装
[root@wy src]# cd resin-4.0.36
解释说明:
这个跟tomcat不一样,不是直接挪目录,而是需要去编译
[root@wy resin-4.0.36]# ./configure --prefix=/usr/local/resin --with-java=/usr/local/jdk1.8.0_31
解释说明:
--with-java 表示java所在的路径
[root@wy resin-4.0.36]# make
解释说明:
错误的原因是做tomcat实验时用的32位的jdk;后换成64位的,编译成功。
[root@wy resin-4.0.36]# make install
## 启动resin
[root@wy resin-4.0.36]# /etc/init.d/resin start
注:启动resin前先停掉tomcat,以免有冲突
## 查看进程与端口
[root@wy resin-4.0.36]# ps aux |grep resin
root 23595 1.2 15.3 2034916 75768 pts/0 Sl 04:17 0:04 /usr/local/jdk1.8.0_111/bin/java -Dresin.watchdog=app-0 -Djava.util.logging.manager=com.caucho.log.LogManagerImpl -Djavax.management.builder.initial=com.caucho.jmx.MBeanServerBuilderImpl -Djava.awt.headless=true -Dresin.home=/usr/local/resin/ -Dresin.root=/usr/local/resin -Xrs -Xss256k -Xmx32m -d64 -server com.caucho.boot.WatchdogManager -root-directory /usr/local/resin -conf /usr/local/resin/conf/resin.xml -log-directory /usr/local/resin/log start-all --log-directory /usr/local/resin/log
root 23637 3.9 36.9 2324476 182744 pts/0 Sl 04:17 0:13 /usr/local/jdk1.8.0_111/bin/java -Dresin.server=app-0 -Djava.util.logging.manager=com.caucho.log.LogManagerImpl -Djava.system.class.loader=com.caucho.loader.SystemClassLoader -Djava.endorsed.dirs=/usr/local/jdk1.8.0_111/jre/lib/endorsed:/usr/local/resin//endorsed:/usr/local/resin/endorsed -Djavax.management.builder.initial=com.caucho.jmx.MBeanServerBuilderImpl -Djava.awt.headless=true -Dresin.home=/usr/local/resin/ -Xss1m -Xmx256m -d64 -server com.caucho.server.resin.Resin --root-directory /usr/local/resin -conf /usr/local/resin/conf/resin.xml -server app-0 -socketwait 38468 -root-directory /usr/local/resin -log-directory /usr/local/resin/log start-all --log-directory /usr/local/resin/log
root 23715 0.0 0.1 103268 840 pts/0 S+ 04:22 0:00 grep resin
[root@wy resin-4.0.36]# netstat -lnp|grep 8080
tcp 0 0 :::8080 :::* LISTEN 23637/java
## 页面访问 ip:8080
解释说明:
这是resin的默认页面
点resin_doc可以查看文档
它的配置比tomcat有一点点复杂
## 编辑配置文件,修改监听端口
[root@wy resin-4.0.36]# cd /usr/local/resin/conf
[root@wy conf]# vim resin.properties
# Set HTTP and HTTPS ports.
# Use overrides for individual server control, for example: app-0.http : 8081
app.http : 80
## 重启服务
[root@wy conf]# /etc/init.d/resin restart
## 查看端口
[root@wy conf]# netstat -lnp|grep java
tcp 0 0 127.0.0.1:6800 0.0.0.0:* LISTEN 25140/java
tcp 0 0 127.0.0.1:6600 0.0.0.0:* LISTEN 25098/java
tcp 0 0 :::80 :::* LISTEN 25140/java
unix 2 [ ACC ] STREAM LISTENING 82608 25098/java /tmp/.java_pid25098.tmp
## 页面直接访问ip
## 编辑配置文件,添加虚拟主机
[root@wy conf]# vim resin.xml
<host id="www.123.com" root-directory="." >
<web-app id="/" root-directory="/tmp/resin"/>
</host>
## 创建 /tmp/resin
[root@wy conf]# mkdir /tmp/resin
## 拷贝测试文件
[root@wy conf]# cp /data/tomcatweb/1.jsp /tmp/resin/
## 重启
[root@wy conf]# /etc/init.d/resin restart
## 测试
[root@wy conf]# curl -x127.0.0.1:80 www.123.com/1.jsp
<html><body><center>
Now time is: Mon Dec 19 05:10:28 CST 2016
</center></body></html>