We will use mod_dav with mod_encoding on apache to enable it on your mac OS X client.
Now it's time to open your Terminal.
[Editor's note: I have not tested this hint myself, and if it fails, it's possible you'll wind up with a non-functional Apache, so proceed at your own discretion. We ran a hint on setting up WebDAV a while back, but this one is much more thorough...]
1) Install mod_dav (http://www.webdav.org/mod_dav/)
Type the following in the Terminal:
% curl -O http://www.webdav.org/mod_dav/mod_dav-1.0.3-1.3.6.tar.gz2) Install libconv (http://www.gnu.org/software/libiconv)
% tar xvzf mod_dav-1.0.3-1.3.6.tar.gz
% pushd mod_dav-1.0.3-1.3.6/
% ./configure --with-apxs=/usr/sbin/apxs
% make
% sudo make install
% popd
Type the following into the Terminal:
% curl -O http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.8.tar.gz3) Install mod_encoding (http://webdav.todo.gr.jp/download/)
% tar xvzf libiconv-1.8.tar.gz
% pushd libiconv-1.8/
% ./configure --mandir=/usr/local/share/man
% make
% sudo make install
% popd
This module improves non-ascii filename interoperability of apache (and mod_dav) and fix Windows XP authorization. See INSTALL for more details. Type the following in the Terminal:
% curl -0 http://webdav.todo.gr.jp/download/mod_encoding-20020611a.tar.gz4) Enable WebDAV in the Apache Config File
% tar xvzf mod_encoding-20020611a.tar.gz
% pushd mod_encoding-20020611a/
% ./configure --with-apxs=/usr/sbin/apxs
% make
% sudo make install
% popd
Modify your httpd.conf in /private/etc/httpd/. I use vi to do it:
% sudo vi /private/etc/httpd/httpd.confAdd or uncomment in the beginning of httpd.conf (where you see LoadModules directives):
LoadModule headers_module libexec/mod_headers.soZoom down to the end of the file and add this text:
LoadModule encoding_module libexec/mod_encoding.so
AddModule mod_headers.c
AddModule mod_encoding.c
#Save httpd.conf and exit.
# Set DAVLockDB for webdav support
#
DAVLockDB /private/var/run/davlocks/DAVLockDB
#
#
Fix header for webdav#
BrowserMatch "^WebDAVFS/1.[012]" redirect-carefully
BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully
BrowserMatch "Microsoft-WebDAV-MiniRedir/5.1.2600" redirect-carefully
BrowserMatch "^WebDrive" redirect-carefully
BrowserMatch "^WebDAVFS" redirect-carefully
<IfModule mod_headers.c>
Header add MS-Author-Via "DAV"
</IfModule>
<IfModule mod_encoding.c>
EncodingEngine on
NormalizeUsername on
</IfModule>
5) Configure Webdav folder
Create Dav folder in Default root:
% sudo mkdir /Library/WebServer/Documents/davOpen httpd.conf again and zoom down to the end of the file and add this text:
% sudo chmod -R 775 /Library/WebServer/Documents/dav
Alias /dav /Library/WebServer/Documentsd/avSave httpd.conf and exit.
<Location /dav>
DAV On
AuthType Basic
AuthName "WebDAV Restricted"
AuthUserFile /private/etc/httpd/passwords/webdav.access
require valid-user
Order allow,deny
Allow from all
</Location>
6) Create a user password
If it doesn't exist, create password dir in /private/etc/httpd:
% sudo mkdir /private/etc/httpd/passwordsThen create a user named davuser1:
% sudo htpasswd -c /private/etc/httpd/passwords/webdav.accessProvide a password when prompted.
7) Restart apache:
% sudo apachectl gracefulAnd that's all, now you have webdav enabled. Open your webdav folder with this url: http://your_ip_number/dav
Useful links:
WevDAV install document
MacDevCenter article

