站内搜索: 请输入搜索关键词

当前页面: 开发资料首页JSP 专题TomCat 多虚拟站点配置

TomCat 多虚拟站点配置

摘要: TomCat 多虚拟站点配置
<tr> <td>   在网络上找了许久,没有一个真正可以解决TomCat多虚拟站点的配置问题的,经过试验和参考官方网站资料,终于解决了这个问题.
  参考资料:Apache Tomcat文档http://tomcat.apache.org/tomcat-5.0-doc/config/host.html

  在文中有这么一段话:
  One or more Host elements are nested inside an Engine element. Inside the Host element, you can nest Context elements for the web applications associated with this virtual host. Exactly one of the Hosts associated with each Engine MUST have a name matching the defaultHost attribute of that Engine.

  译文:Engine元素中需要一个或多个Host元素,在Host元素里面,你必需有Context元素让网站应用程序与虚拟主机连接上,严密地说,每一个主机所关联的引擎必须有一个名字跟那个引擎默认的主机属性匹配 .
  可知,在Engine元素里面可以有多个Host,那么说,可以有在一个Engine里面设置多个服务器了,这正是我们需要的.每个Host元素里面要有一个Context元素.
  根据conf\server.xml里面的说明和范例,我样可以编写出下面一个配置文件:

1 </tr> </table>
↑返回目录
前一篇: tomcat下的jsp和servlet的字符编码问题
后一篇: Tomcat中用web.xml控制Web应用详解