Hello Jakarta Horde,

A little HOWTO for Apache webDAV users with Tomcat. I found that I was
unable to edit JSP files over webdav until I factored the DAV
functionailty into a <VirtualHost> directive.

The problem lies in the fact that in your Apache config has a mapping of
".jsp" to go to Tomcat, like so:

AddType text/jsp .jsp
AddHandler jserv-servlet .jsp
 
Put this mapping into a virtual host directive instead of in your main
server.

Then, create a another <VirtualHost> with a special name. So for
znutar.cortexity.com, I have a WebDAV host called dav.cortexity.com. My
two virtual hosts are laid out like this:

<VirtualHost znutar.cortexity.com>
    ServerAdmin [EMAIL PROTECTED] 
    DocumentRoot /usr/local/jakarta-tomcat-3.2/webapps/ROOT 
    ServerName znutar.cortexity.com

    ApJServDefaultPort 8007
    AddType text/jsp .jsp
    AddHandler jserv-servlet .jsp
    <LocationMatch "/BugRat*">
      SetHandler jserv-servlet 
    </LocationMatch>

    ApJServMount /servlet /ROOT

    ErrorLog logs/znutar-error_log
    CustomLog logs/znutar-access_log combined
</VirtualHost>

This then is complemented by a special virtual host which has a different
mapping for .jsp, like so:

<VirtualHost dav.cortexity.com>
    ServerAdmin [EMAIL PROTECTED] 
    DocumentRoot /usr/local/jakarta-tomcat-3.2/webapps/ROOT 
    ServerName edit.cortexity.com
    ErrorLog logs/edit-error_log
    CustomLog logs/edit-access_log combined
    DAVLockDB /usr/local/apache/.dav/DAVLock
    DAVMinTimeout 600
    AddType text/plain .jsp

    Alias /mdav /usr/local/jakarta-tomcat-3.2/webapps/ROOT
    <Location /dav>
      AuthUserFile /usr/local/apache/.auth/.bugrat_dav
      AuthName DAV 
      AuthType Basic
      DAV On
      <Limit GET PUT POST DELETE PROPFIND PROPPATCH MKCOL COPY MOVE LOCK 
UNLOCK>
        Require valid-user 
      </Limit>
    </Location>
</VirtualHost>

Works great. Note, don't try these hostnames yourself as you can only see
them from behind my firewall. And this is in place of any
tomcat-apache.conf.

-- 
Nicolaus Bauman


Reply via email to