eXist apps outside of webapps

By default eXist expects all to find all the web apps in $EXIST/webapps. You can change the location by

  1. symlinking $APP_PATH to $EXIST/webapps/$app, or
  2. configuring a <root pattern="appname" path="$APP_PATH" /> in controller-conf.xml

Neither of those methods works well on its own: symlinking will sometimes prevent the controllers from being found and configuring a root will cause permissions errors for static, non-eXist, files like .css stylesheets.

The only reliable method to run a web app outside the eXist installation seems to be to symlink, configure a root which points to the symlink, and then set jetty to ignore alias checking.

Update: For newer versions of Jetty (mine is 8.1.8 or something):

In $EXIST/tools/jetty/etc/webdefault.xml, configure aliases in this ridiculously verbose bit of XML:

<servlet>
 <servlet-name>default</servlet-name>
 <servlet-class>org.eclipse.jetty.servlet.DefaultServlet</servlet-class>
 <init-param>
 <param-name>aliases</param-name>
 <param-value>true</param-value>
 </init-param>

For older versions of Jetty (versions 7 and earlier, I guess): In $EXIST/tools/jetty/etc/jetty.xml

<Set class="org.mortbay.util.FileResource" name="checkAliases" type="boolean">false</Set>