Detailed explanation of Tomcat6 setting virtual directory and Server.xml

      Tomcat is a popular JSP server. Just like IIS needs to be used in ASP, a server is required when the edited JSP page is deployed. Tomcat is the preferred server in common use. Programs downloaded from the Internet or jsp projects copied from other places can be directly placed in the Webapps directory in the TOmcat main directory and run, but don't we want to put them in any directory and access them through a browser? In fact, it is very simple, open the Server.xml file in the conf folder in the Tomcat home directory, and add the following code to the file in the <host> tag:

<Context path="/myjsp" docBase="c:/myjsp" debug="0" reloadable="true" crossContext="true"></Context>
where path is the virtual directory we want to create, and docBase is the actual The location of the directory on the hard disk.

Of course, after modifying server.xml, you need to restart the Tomcat server to take effect.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326576447&siteId=291194637
Recommended