tomcat虚拟主机配置问题
各位高手好,我配置虚拟主机内容如下 <Host appBase= "e:\trdz " name= "www.trdz.com " unpackWARs= "true " autoDeploy= "true "
xmlValidation= "false " xmlNamespaceAware= "false ">
<Context path= "/trdz " docBase= ". " debug= "5 " privileged= "true "/>
<Valve className= "org.apache.catalina.valves.AccessLogValve "
directory= "logs " prefix= "home_access_log. " suffix= ".txt "
pattern= "common " resolveHosts= "false "/>
</Host>
<Realm className= "org.apache.catalina.realm.UserDatabaseRealm "/>
上面这一配置我是放在 <Engine> 和 </Engine> 间,(数据库用的是SQLServer2000)我在浏览器里输入如下内容:http://www.trdz.com:8080/trdz这样是没问题,一切正常,但是我想现在只输入http://www.trdz.com:8080,可这就出问题了,游览器找不到网页,如是我将 <Context path= "/trdz " docBase= ". " debug= "5 " privileged= "true "/> 中的path= "/trdz "修改成path= " ",可是又有这样一个问题,我有一个文件目录是e:/trdz/forum/,想在游览器里打开它下面的网页(http://www.trdz.com:8080/forum/index.jsp,这就出现了异常,并且只要是有连接数据库的,(index.jsp有连接数据库的部分),都会出现异常(页面当然打不开拉),但是只要我把path= " "改回path= "/trdz " 就没问题了,现在我是想不要在 'www.trdz.com:8080 '后面输入 '/trdz ',那些页面都能访问,请教各位高手,帮忙,解决一下,十分感谢!!!
------解决方案-------------------- <Context path= ". " docBase= "e:/trdz " debug= "5 " privileged= "true "/>