I am developing a quick web application that is riding on Tomcat. I need to set up a virtual directory in Tomcat. It has taken me quite sometime to find the solution (not a surprise for a junkie “well-trained” by Microsoft)

  1. Let’s assume the name of the virtual directory is my_virtual, and the location is at d:\MyApp\foo\bar, and the host is localhost
  2. Go to [Tomcat_installation_directory]\conf\Catalina\localhost
  3. Create an XML file named my_virtual.xml with the following content
<Context path="/my_virtual"
        docBase="d:\MyApp\foo\bar"
        debug="0" privileged="true"></Context>
Advertisements