resin配置端口和虚拟目录
2016-08-30 08:22
369 查看
resin4中配置端口和虚拟目录
在JAVA WEB容器大家族中,Resin可以算的上最轻巧最快速的服务器了。我个人非常喜欢在产品开发阶段使用Resin来测试和调试,因为开发阶段需要频繁地重启服务器。在给客户进行产品部署的时候我还是趋向于使用Tomcat,因为tomcat是全部免费的,而且使用者很多,再加上NIO和GZip模式可以优化服务器性能以及tomcat出色的稳定性。
Resin4可以给不同的Web app分配不同的端口,也就是说Resin4可以同时开启多个端口的服务,这一点是非常赞的,在tomcat中想要实现这个就必须另外再来一份tomcat,配置不同的端口。而Resin4就不需要了,给不同的应用设置好相应的端口就OK了。Resin4有一个全局端口,也就是默认端口,可以在conf/resin.properties文件中,对HTTP元素进行简单的修改,如下:[html] view plain copy print?# Set HTTP and HTTPS ports
http : 8080
#https : 8443
在Resin中创建虚拟目录的方式是修改conf/resin.xml文件,正如我刚刚说的,每一个虚拟目录都是一个Web app,都可以配置独立的端口号。在resin.xml中一个cluster就代表一个端口应用,代码如下:
[html] view plain copy print?<cluster id="app">
<!-- define the servers in the cluster -->
<server-multi id-prefix="app-" address-list="${app_servers}" port="6800" />
<host-default>
<!-- creates the webapps directory for .war expansion -->
<web-app-deploy path="webapps" expand-preserve-fileset="WEB-INF/work/**"
multiversion-routing="${webapp_multiversion_routing}" />
</host-default>
<!-- auto virtual host deployment in hosts/foo.example.com/webapps -->
<host-deploy path="hosts" />
<!-- the default host, matching any host name -->
<host id="" root-directory=".">
<!-- - webapps can be overridden/extended in the resin.xml -->
<web-app id="/" root-directory="webapps/ROOT" />
<web-app id="/jPress" root-directory="D:\workspace\java\myeclipse10\jPress\WebRoot" />
<resin:if test="${resin_doc}">
<web-app id="/resin-doc" root-directory="${resin.root}/doc/resin-doc" />
</resin:if>
</host>
</cluster>
这个cluster是web-app的主簇,在其中添加<web-app>标签就可以配置虚拟目录了,这时候这个应用是使用默认端口进行部署的。如果要给这个簇配置特定的端口号,可以在cluster标签第一个元素前面加上<server-default>标签,如下:
[html] view plain copy print?<resin xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin">
<cluster-default>
<!-- shared configuration across all clusters -->
<resin:import path="classpath:META-INF/caucho/app-default.xml" />
<resin:import path="${__DIR__}/health.xml" optional="true" />
</cluster-default>
<cluster id="my-cluster">
<server-default>
<!-- thread limits, JVM config, keepalives, ports, HTTP -->
<http port="8083" />
</server-default>
<host id="www.myhost.com" root-directory="hosts/myhost.com">
<resin:MovedPermanently regexp="/old-file" target="/new-path" />
<web-app-deploy path="webapps" expand-preserve-fileset="WEB-INF/work/**" />
<web-app id="/custom">
</web-app>
</host>
</cluster>
</resin>
转载自http://blog.csdn.net/howareyouo/article/details/7776875
在JAVA WEB容器大家族中,Resin可以算的上最轻巧最快速的服务器了。我个人非常喜欢在产品开发阶段使用Resin来测试和调试,因为开发阶段需要频繁地重启服务器。在给客户进行产品部署的时候我还是趋向于使用Tomcat,因为tomcat是全部免费的,而且使用者很多,再加上NIO和GZip模式可以优化服务器性能以及tomcat出色的稳定性。
Resin4可以给不同的Web app分配不同的端口,也就是说Resin4可以同时开启多个端口的服务,这一点是非常赞的,在tomcat中想要实现这个就必须另外再来一份tomcat,配置不同的端口。而Resin4就不需要了,给不同的应用设置好相应的端口就OK了。Resin4有一个全局端口,也就是默认端口,可以在conf/resin.properties文件中,对HTTP元素进行简单的修改,如下:[html] view plain copy print?# Set HTTP and HTTPS ports
http : 8080
#https : 8443
在Resin中创建虚拟目录的方式是修改conf/resin.xml文件,正如我刚刚说的,每一个虚拟目录都是一个Web app,都可以配置独立的端口号。在resin.xml中一个cluster就代表一个端口应用,代码如下:
[html] view plain copy print?<cluster id="app">
<!-- define the servers in the cluster -->
<server-multi id-prefix="app-" address-list="${app_servers}" port="6800" />
<host-default>
<!-- creates the webapps directory for .war expansion -->
<web-app-deploy path="webapps" expand-preserve-fileset="WEB-INF/work/**"
multiversion-routing="${webapp_multiversion_routing}" />
</host-default>
<!-- auto virtual host deployment in hosts/foo.example.com/webapps -->
<host-deploy path="hosts" />
<!-- the default host, matching any host name -->
<host id="" root-directory=".">
<!-- - webapps can be overridden/extended in the resin.xml -->
<web-app id="/" root-directory="webapps/ROOT" />
<web-app id="/jPress" root-directory="D:\workspace\java\myeclipse10\jPress\WebRoot" />
<resin:if test="${resin_doc}">
<web-app id="/resin-doc" root-directory="${resin.root}/doc/resin-doc" />
</resin:if>
</host>
</cluster>
这个cluster是web-app的主簇,在其中添加<web-app>标签就可以配置虚拟目录了,这时候这个应用是使用默认端口进行部署的。如果要给这个簇配置特定的端口号,可以在cluster标签第一个元素前面加上<server-default>标签,如下:
[html] view plain copy print?<resin xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin">
<cluster-default>
<!-- shared configuration across all clusters -->
<resin:import path="classpath:META-INF/caucho/app-default.xml" />
<resin:import path="${__DIR__}/health.xml" optional="true" />
</cluster-default>
<cluster id="my-cluster">
<server-default>
<!-- thread limits, JVM config, keepalives, ports, HTTP -->
<http port="8083" />
</server-default>
<host id="www.myhost.com" root-directory="hosts/myhost.com">
<resin:MovedPermanently regexp="/old-file" target="/new-path" />
<web-app-deploy path="webapps" expand-preserve-fileset="WEB-INF/work/**" />
<web-app id="/custom">
</web-app>
</host>
</cluster>
</resin>
转载自http://blog.csdn.net/howareyouo/article/details/7776875
相关文章推荐
- jboss 的一些配置(端口,虚拟目录,虚拟主机,中文问题,数据库连接)
- resin4中配置端口和虚拟目录
- Tomcat配置虚拟目录、多域名、多个Http监听端口的方式
- Tomcat配置虚拟目录、多域名、多个Http监听端口的方式
- jboss 的一些配置(端口,虚拟目录,虚拟主机,中文问题,数据库连接)
- Apache Wamp WampServer 配置多端口 多站点 虚拟目录
- Tomcat配置虚拟目录、多域名、多个Http监听端口的方式
- Tomcat配置虚拟目录、多域名、多个Http监听端口的方式
- Apache虚拟目录和多端口多主机名配置
- JBoss的配置 端口,虚拟目录,虚拟主机,中文问题,数据库连接
- 关于Resin虚拟目录配置的问题
- apache 2.4 配置多端口虚拟目录
- Tomcat配置虚拟目录、多域名、多个Http监听端口的方式
- 配置Tomcat的网站根目录、虚拟目录、端口等
- resin4中配置端口和虚拟目录的方法
- Ubuntu 配置Apache2虚拟目录及对应端口
- tomcat安装配置,虚拟目录,虚拟主机,默认端口,默认应用,默认主页,http协议知识
- Tomcat配置虚拟目录、多域名、多个Http监听端口
- Tomcat配置虚拟目录、多域名、多个Http监听端口的方式
- openssl和虚拟目录的配置--包括配置http和https等的端口