I'm focusing on an internet application that enables customers to upload accessories. These accessories are saved on the different drive compared to the net application. How do i create an alias (equal to Apache HTTP server's aliases) for this drive to ensure that customers can download these accessories?

Presently I'm developing a context file and dumping it in CATALINA_HOME/conf/Catalina/localhost, however it will get at random erased once in awhile. The context file is known as accessories.xml and also the contents are proven below. I've also find out about virtual hosts, but when I realize properly, a virtual host isn't things i am searching for. I'm using version 6..18 of Apache Tomcat.


<?xml version="1.0" encoding="UTF-8"?>
<Context docBase    = "e:\uploads\attachments"
     reloadable = "true"
     crossContext   = "true">

I spent much more time researching this and located an answer that solves the random deletion from the context files. I discovered this excerpt on Apache's website underneath the host configuration section:

You are able to nest a number of Context elements inside this Host element, each representing another web application connected with this particular virtual host.

The virtual hosts are saved within the server.xml file situated at *CATALINA_HOMEconf*. Tomcat comes set up with localhost because the default host. So, as we add the items in accessories.xml in the first publish, we obtain the next:

<Host name="localhost"  appBase="webapps"
    unpackWARs="true" autoDeploy="true"
    xmlValidation="false" xmlNamespaceAware="false">

    <Context path="/attachments"
             crossContext="true" />

This is because close as you can get to determining aliases much like Apache's HTTP server, I believe.