您的位置:首页 > 其它

resin安装配置

2015-05-30 20:39 246 查看
resin安装配置

Resin是CAUCHO公司(http://www.caucho.com/)的产品,是一个非常流行的支持servlets 和jsp的引擎,速度非常快。Resin本身包含了一个支持HTTP/1.1的WEB服务器。虽然它可以显示动态内容,但是它显示静态内容的能力也非常强,速度直逼APACHE SERVER。许多站点都是使用该WEB服务器构建的。

Resin也可以和许多其他的WEB服务器一起工作,比如Apache server和IIS等。Resin支持Servlets 2.3标准和JSP 1.2标准。熟悉ASP和PHP的用户可以发现用Resin来进行JSP编程是件很容易的事情。

Resin支持负载平衡(Load balancing),可以增加WEB站点的可靠性。方法是增加服务器的数量。比如一台SERVER的错误率是1%的话,那么支持负载平衡的两个Resin服务器就可以使错误率降到0.01%。

Resin有免费、收费版本;

1.安装jdk,步骤和上面tomcat安装一样;

2.安装resin
[root@webserver src]# cd /usr/local/src/
[root@webserver src]# wget www.aminglinux.com/bbs/data/attachment/forum/resin-4.0.36.tar.gz
[root@webserver src]# tar zxf resin-4.0.36.tar.gz

[root@webserver resin-4.0.36]# cd resin-4.0.36

[root@webserver resin-4.0.36]# ./configure --prefix=/usr/local/resin --with-java-home=/usr/local/jdk1.8.0_45
[root@webserver resin-4.0.36]# make

[root@webserver resin-4.0.36]# make install

[root@webserver resin-4.0.36]# /etc/init.d/resin start

3.配置resin
[root@webserver resin-4.0.36]# cd /usr/local/resin/conf/
[root@webserver conf]# vi resin.properties //修改resin监听端口
app.http : 80 //将默认的8080端口改为80端口
[root@webserver conf]# vi resin.xml
在web-app的区域的</host>下内添加以下内容
<host id="www.111.com" root-directory=".">
<web-app id="/" root-directory="/tmp/123"/>
</host>
[root@webserver conf]# mkdir /tmp/123
[root@webserver conf]# vi /tmp/123/time.jsp
<html><body><center>
Now time is: <%=new java.util.Date()%>
</center></body></html>
[root@webserver conf]# /etc/init.d/resin restart
Stopping resin: .
Starting resin: .
[root@webserver conf]# curl -x127.0.0.1:80 www.111.com/time.jsp
<html><body><center>
Now time is: Sat May 30 05:15:17 CST 2015
</center></body></html>

[root@webserver conf]# date
2015年 05月 30日 星期六 05:15:22 CST

4.使用nginx代理8080端口访问
[root@webserver conf]# vi resin.properties //修改resin监听端口
app.http : 8080 //将之前修改为80端口改为8080端口
[root@webserver conf]# cat /usr/local/nginx/conf/vhosts/proxy.conf //使用nginx代理8080端口
server {
server_name www.111.com;
location / {
proxy_pass http://127.0.0.1:8080/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
[root@webserver conf]# /etc/init.d/nginx restar
[root@webserver conf]# curl -x127.0.0.1:8080 www.111.com/time.jsp
<html><body><center>
Now time is: Sun May 31 02:40:38 CST 2015
</center></body></html>
[root@webserver conf]# curl -x127.0.0.1:80 www.111.com/time.jsp
<html><body><center>
Now time is: Sun May 31 02:40:31 CST 2015
</center></body></html>

用浏览器测试服务:
在C:\Windows\System32\drivers\etc更改host文件:192.168.1.111 www.111.com
浏览器访问 www.111.com/time.jsp 不用输入端口号,可以直接访问;



内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  安装 配置 resin