Pages

Wednesday, February 20, 2008

Linux as the WebDAV Server:

On Linux, use your favorite package manager to install Apache. Most distributions will use Apache httpd 2.0 which has mod_dav built-in, so the only editing of the httpd.conf file needed are the DAVLockDB and Directory definitions. Note that you can also authenticate against Active Directory or LDAP using the mod_auth_kerb or mod_auth_ldap Apache modules. For this example, we’ll stick with using htpasswd:

$ sudo vi /etc/httpd/conf/http.conf
..
DAVLockDB /usr/local/apache/var/DAVLockDB

DAV On
AuthName “WebDAV Login”
AuthType Basic
AuthUserFile /etc/httpd/.htpasswd

require valid-user

Order allow,deny
Allow from all

Now create the directories and set permissions:

$ sudo su
# mkdir /usr/local/apache/var
# chown apache:apache /usr/local/apache/var
# mkdir /var/www/html/webdav
# chown www:www /var/www/html/webdav

Finally, on Linux create the user and password file and restart the httpd daemon:

# htpasswd -m -c /etc/httpd/.htpasswd testuser
New password:
Re-type new password:
Adding password for user testuser
# /sbin/service httpd restart
Stopping httpd: [ OK ]
Starting httpd: [ OK ]

Now let’s try it out by connecting some clients!

reference:
http://weblog.bignerdranch.com/?p=18

No comments: