Tomcat as the HTTP download server, there are many ways online
But I think the simplest is:
1, directly put the file in the/var/lib/tomcat6/webapps/root directory,
2, then in the Web site access: Http://192.168.2.31:8080/download.zip can be downloaded.
However, if you don't want to put it under Webapps/root, configure the directory you want to download:
1, in the Tomcat installation directory \conf\catalina\localhost under the establishment of arbitrary file name XML file, such as: Download.xml,
The contents are as follows:
<?xml version= "1.0" encoding= "UTF-8"?> <context reloadable= " true" docbase= "D://download" Crosscontext= "true" >
</Context>
2, configure Web.xml (Tomcat configuration file), modify the following configuration:
<servlet>
<servlet-name>default</servlet-name>
<servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>0</param-value>
</init-param>
<init-param>
<param-name>listings</param-name>
<param-value>false</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
To change the red false to true.
3, restart Tomcat.
4. Visit http://19.168.23.31:8080/download
Reprint Source: http://blog.csdn.net/yuan882696yan/article/details/26680253