I'm running a tomcat
webserver and want to expose as local directory via the tomcat itself in a webbrowser.
I found the following, which would list the full content of docBase
.
server.xml (access via localhost:8080/logs):
<Context docBase="/opt/tomcat/logs" path="/logs" />
web.xml:
<servlet>
<servlet-name>default</servlet-name>
<servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
<init-param>
<param-name>listings</param-name>
<param-value>true</param-value> <!-- this is important -->
</init-param>
</servlet>
By default, tomcat just shows any files in that dir, and sorts them just randomly.
Question: how can I restrict the files inside that directory that should be exposed? And how could I tell tomcat to order the files being shown eg by filename, or by modification date?