WebDAV on Leopard

to setup webdav for either file or ical sharing on your own mac running mac os 10.5 (leopard) do the following – terminal experience is beneficial.

1. start or ensure Apache is running under system preferences > sharing > web sharing

2. to enable WebDAV support in Apache edit httpd.conf…

sudo nano /etc/apache2/httpd.conf

and locate this line…

LoadModule dav_module libexec/apache2/mod_dav.so

ensure it is not commented, i.e. remove “#” at the beginning of the line.
next locate this line:

Include /private/etc/apache2/extra/httpd-dav.conf

again remove the “#” from this line.

3. configure WebDAV. Next, edit httpd-dav.conf.

sudo nano /etc/apache2/extra/httpd-dav.conf

as security measure, you should also comment the /usr/uploads share that is set by default, by adding a # at the start of the line.

add the following section to create your new WebDAV share.

Alias /webdav "/Library/WebServer/WebDAV"

<directory “/Library/WebServer/WebDAV”>
Dav On

Order Allow,Deny
Allow from all

AuthType Basic
AuthName WebDAV-Realm
AuthUserFile “/usr/webdav.passwd”

require vaild-user

line 1, the name following the Alias keyword is the URL you’d like for your new WebDAV share. If you want the share to be located at http://your-server-name/your-fancy-webdav-share, then line 1 should read:

Alias /your-fancy-webdav-share "/your-server-name/your-fancy-webdav-share"

line 9, specifies the authentication scheme as Basic, not Digest – note that this sends unencrypted passwords over plain text. do not use an important password for any of the accounts you setup.

4. create user accounts and passwords, the htpasswd tool creates a new password file.
sudo htpasswd -c /usr/webdav.passwd "YourUserName"
New password:
Re-type new password:
Adding password for user YourUserName

please note the -c flag overwrites any existing password file, if you would like to update an already existing file the command is as follows:

sudo htpasswd /usr/webdav.passwd "YourUserName"
New password:
Re-type new password:
Adding password for user YourUserName

5. create the necessary directories.
sudo mkdir -p /Library/WebServer/WebDAV
sudo mkdir -p /usr/var

6. setup permissions correctly.
sudo chown -R www:www /Library/WebServer/WebDAV
sudo chown -R www:www /usr/var
sudo chgrp www /usr/webdav.passwd

7. restart Apache gracefully.
sudo apachectl graceful

8. check the syntax of the httpd.conf file.
apachectl -t
it should report “Syntax OK”

9. tail the server error log for any problems…
sudo tail -f /var/log/apache2/error_log

the above is mainly based on the following sources, with slight adjustments mainly to allow for more than one user.

http://manas.tungare.name/blog/howto-setup-webdav-on-mac-os-x-leopard-for-syncing-omnifocus-to-iphone/
http://www.timefold.com/osx/tips/webdavical.html

Next Post

Previous Post