tomcat服务器虚拟路径配置

来源:互联网 发布:卷积矩阵运算法则 编辑:程序博客网 时间:2024/06/05 00:43

tomcat官网:http://tomcat.apache.org


  • 根据各个版本的tomcat不同,在Documentation中找到相应的版本
  • 在页面中找到Reference,在里面找到Configuration
  • 在configuration页面里面找到Containers分类,查看这个分类里面的Context

这个Context里面的说明内容即各个版本的tomcat虚拟目录的详细配置
这里就对tomcat7.0的配置进行解读

在这个版本文档的context部分里面查看Defining a context部分,其中有这样的一个选项

In individual files (with a “.xml” extension) in the $CATALINA_BASE/conf/[enginename]/[hostname]/ directory. The context path and version will be derived from the base name of the file (the file name less the .xml extension). This file will always take precedence over any context.xml file packaged in the web application’s META-INF directory.

这段话的意思是,在“CATALINA_BASE/conf/[enginename]/[hostname]/ ”这个路径下建立一个xml文件,这个文件名将会是要配置虚拟路径的path,在里面自定义的baseDoc即可实现虚拟路径。并且这个配置文件将会被服务器自动解析,在更改的情况下不需要重启服务器即可生效。注:CATALINA_BASE指的是tomcat的安装路径。

0 0
原创粉丝点击