how to configure Tomcat7 to serve static content


You need to add the following line (mutatis mutandis):

<Context docBase="/var/lib/tomcat7/webapps/oaipmh" path="/oaipmh"/>
… in the server.xml Tomcat7 that, e.g., in my system lives in: /var/lib/tomcat7/conf/server.xml.

E.g., in my system:

$ cat /var/lib/tomcat7/conf/server.xml | tail -20
      <Host name="localhost"  appBase="webapps"
        unpackWARs="true" autoDeploy="true">

        <!-- SingleSignOn valve, share authentication between web applications
             Documentation at: /docs/config/valve.html -->
             <Valve className="org.apache.catalina.authenticator.SingleSignOn" />

        <!-- Access log processes all example.
             Documentation at: /docs/config/valve.html
             Note: The pattern used is equivalent to using pattern="common" -->
            <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
                   prefix="localhost_access_log." suffix=".txt"
                   pattern="%h %l %u %t "%r" %s %b" />
            <Context docBase="/var/lib/tomcat7/webapps/oaipmh" path="/oaipmh"/>
… followed of course by a server restart:
 sudo /etc/init.d/tomcat7 restart

I was then able to view the static content by pointing my browser at: http://localhost:8080/oaipmh/