Web application Configuration Virtual Host
Virtual path mapping for 1.web applications, which is the real path for Web applications configure a virtual path
In the Server.xml <Host> tab of the Conf directory, configure <Context> tag, you can configure a Web app for this virtual host
Unpackwars= "true" autodeploy= "true"
Xmlvalidation= "false" Xmlnamespaceaware= "false" >
<context Path = virtual path docbase= true path/>
</Host>
True path: Is the true path of file storage D:\news
Virtual path: Is the path to the browser knocking/news
Access method: http://localhost:8080/news/1.html
Configure the default Web app to set path to NULL
<context path = "" Docbase= Real paths/>
Cons: After the modification, all need to reboot, not recommended
2. In tomcat/conf/[engin]/[host]/in this directory to write an XML file, this XML name is the virtual path, the XML CAS configuration <Context> tag, which configures the real path
File name Tomcat6\conf\catalina\localhost\new2.xml
<?xml version= "1.0" encoding= "Utf-8"?>
<context docbase= "D:\news"/>
Pros: No need to restart Tomcat
Cons: If the virtual path is multilevel, the file name should be modified to Xxx#xxx#xxx.xml
As long as the file name is modified to root.xml this web app becomes the default Web App
3. Put the Web application directly into the directory managed by the virtual host, the virtual host can find
Just copy the news directory to the WebApp directory and it's OK.
Change the Web App folder name to root, the Web app is the default Web App
Configure Web Apps