WebDav

Introduction
This HOWTO attempts to give a short overview on how to use WebDAV with Apache 2. WebDAV can be used for many things including remote file access and for a iCal/Sunbird repository. This HOWTO will assume you have understanding on how gentoo works along with portage commands. It will focus on the new Apache2 configuration.

Installing Apache2
In the first step add the necessary apache modules to your /etc/make.conf.

Now you need to install apache. This is done using

[ebuild    I ] www-servers/apache-2.2.9-r1 USE="ssl threads -debug -doc -ldap (-selinux) -sni -static -suexec"\ APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile  \ authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident \ imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif     \ speling status unique_id userdir usertrack vhost_alias -asis -authn_alias -cern_meta -charset_lite -dumpio -log_forensic -proxy_ftp -substitute -version" \ APACHE2_MPMS="-event -itk -peruser -prefork -worker" 4,887 kB

Configuring Apache for WebDAV
Once Apache is installed, you will want to edit the conf.d file to tell Apache to start with support for WebDAV.

Now you need to create a repository for WebDAV. This should not be anywhere on the web directory. This folder will contain usernames and passwords file, along with your WebDAV content.

Now you can create the users that should be able to access the WebDAV

The -c option will create the file, or empties the existing file if one exists. For all other users do the following

Now you need to configure mod_dav

Additional Notes

 * The Apache documentation for versions 2.0 and 2.2 recommend against using the Location directive to specify a location within the file system and instead recommend  or .


 * I also found a problem with Apache denying access to the WebDAV file/directory. One fix is to include

within the  (or ) directive. This was recommended by jamesrh in a post at [2].


 * I had to place the config inside of the vhosts file or Apache would give me 405 errors. - Brian

SSL Support
When installing Apache, at the end, you get self-sign certificates that are put in /etc/apache2/ssl/. They will also work. Change the following options:

We need to add "-nodes" to "create a certificate" and "create a certificate" request code in order to let our new ssl certs be loaded without a password. Otherwise when you reboot your ssl certs will not be available.

Now add support for your default vhost

Now restart Apache and you should be up and running.

Troubleshooting

 * First of all, a normal web browser will not list a WebDAV directory, instead you get this forbidden error (HTTP 403). Make sure you are actually using a WebDAV client to access your server and not a web browser. See the testing chapter in the FAQ how build-in WebDAV clients are used for different client operating systems. Additionally a web browser can be used to access a single file, so entering the webdav-url + file-name should work too.
 * If your are using vhost, you should do the webdav configuration into your vhost.conf file, like i did :