How do you create “Aliases” in Apache Tomcat?

前端 未结 3 1140
灰色年华
灰色年华 2021-01-02 07:34

I am working on a web application that allows users to upload attachments. These attachments are stored on a different drive than that of the web application. How can I cr

3条回答
  •  没有蜡笔的小新
    2021-01-02 08:09

    I spent a lot more time researching this and found a solution that solves the random deletion of the context files. I found this excerpt on Apache's website under the host configuration section:

    You can nest one or more Context elements inside this Host element, each representing a different web application associated with this virtual host.

    The virtual hosts are stored in the server.xml file located at CATALINA_HOME\conf. Tomcat comes configured with localhost as the default host. So, if we add the contents of attachments.xml from the first post, we get the following:

    
    
        
    
    

    This is as close as one can get to defining aliases similar to Apache's HTTP server, I think.

提交回复
热议问题