Saturday, June 30, 2012


Recently I needed to use NetBeans to work on a project that needed HTTP access to a set of static files. The way I did it was to edit the embedded Tomcat server.xml like so:

    <Engine defaultHost="localhost" name="Catalina">
        <Realm className="org.apache.catalina.realm.LockOutRealm">
            <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
                   resourceName="UserDatabase"/>
        </Realm>
        <Host appBase="webapps" autoDeploy="false" name="localhost"
              unpackWARs="true">
            <Valve className="org.apache.catalina.valves.AccessLogValve"
                   directory="logs" pattern="%h %l %u %t &quot;%r&quot; %s %b"
                   prefix="localhost_access_log."
                   resolveHosts="false" suffix=".txt"/>
            <Context path="/sdk" docBase="z:/Data/Foo" />
            <Context path="/web" docBase="z:/web" />
        </Host>
    </Engine>

Enjoy!

No comments: