上传并且解压安装包
tar -zxvf apache-tomcat-6.0.44.tar.gz
修改配置文件
vim conf/web.xml
<init-param>
<param-name>listings</param-name>
<param-value>true</param-value>
</init-param>
注意将原来的false改为true
tomcat外部文件映射
如果不想把文件放到webapps目录下面,
想把外部文件路径映射到tomcat的某个下载路径下时,
还需要配置文件conf/server.xml:
<Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true"> <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" prefix="localhost_access_log." suffix=".txt" pattern="%h %l %u %t "%r" %s %b" /> <Context path="/download2" docBase="/home/tomcat/download2"></Context> </Host>
其中path为虚拟路径,docBase为本地真实路径。