After Tomcat is installed, simply put your package under $tomcat_home$/webapps and you can use it directly. This will make the WebApps more and more large and need to set up the virtual directory:
1. Single app settings:
Add between <Host> and <context path= "/site" docbase= "D:\site" reloadable= "true" debug= "0" >
</Context>
Parameter: path means the Http://localhost:8080/site is entered in the browser
Docbase represents the physical absolute path of your package, and the default absolute path is $tomcat_home$/webapps
This setting will then generate a Site.xml file in the $tomcat_home$/conf/catalina/localhost directory, the content of which is the content just set.
2. By the previous we know that the corresponding configuration file will be generated in the $tomcat_home$/conf/catalina/localhost directory, so we can directly
$tomcat _home$/conf/catalina/localhost Directory write profile file name arbitrary, preferably with your Web application is the same ease of management, such as site.xml content ibid.
<context path= "/site" docbase= "D:\site" reloadable= "true" debug= "0" >
</Context>
3. Change the entire root directory:
Find Unpackwars= "true" autodeploy= "true" >
Set the appbase to the desired path (absolute path)
Problem: Input: http://localhost:8080/No default page appears
The cause of course is that the path was changed. The solution is also very simple, copy the file over, or set the original default to a virtual path.
Tomcat Virtual Host Configuration
The first step,
<context path= "" docbase= "." debug= "0"/>
</Host>
<context path= "" docbase= "." debug= "0"/>
</Host>
Step Two,
For Windows XP:
\windows\system32\drivers\etc\hosts, this file does not have an extension and can be created manually.
127.0.0.1 localhost
127.0.0.1 www.dykj.com
127.0.0.1 www.zhip.com
Example:
<context path= "/site" docbase= "F:\workspace\myjsp\WebRoot" reloadable= "true" debug= "0" ></Context>
Where F:\workspace\myjsp\WebRoot has two directories and a file Meta-inf and Web-inf and index.jsp files, Web-inf file contains classes and Lib and web. xml
I want to deploy the server in Tomcat 6, and I added the Server.xml
<context path= "/ext" docbase= "D:\ext"/>
Then launch tomcat with no error alerts and then enter Http://localhost:8080/ext
Display client 404 error
Tomcat virtual directory configuration method and principle