Debian Admin - Your way to Debian World

July 2, 2008

WebDAV Configuration With Apache2 On Debian Etch

by @ 1:28 pm. Filed under Webserver

If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!

Web-based Distributed Authoring and Versioning, or WebDAV, is a set of extensions to the Hypertext Transfer Protocol (HTTP) which allows users to collaboratively edit and manage files on remote World Wide Web servers. The group of developers responsible for these extensions was also known by the same name and was a working group of the Internet Engineering Task Force (IETF).

Install apache 2 and enable webdav in debian

Install apache2 using the following comamnd

#aptitude install apache2

Enable webdav modules using the following commands

#a2enmod dav_fs

#a2enmod dav

Restart Apache web server using the following command

#/etc/init.d/apache2 restart

Create Virtualhost in apache

Now you need to create a default apache vhost in the directory /var/www/webdav.Now you need to modify default apach cofiguration file located at /etc/apache2/sites-available/default

You need to create /var/www/webdav directory and make www-data use the owner of the directory.

#mkdir /var/www/webdav

#chown www-data:www-data /var/www/webdav

Now you need to make a backup of default apache server config file

cp /etc/apache2/sites-available/default /etc/apache2/sites-available/default.back

Now you need to edit the /etc/apache2/sites-available/default file

#vi /etc/apache2/sites-available/default

add the following lines

NameVirtualHost *

<VirtualHost *>

ServerAdmin root@localhost
DocumentRoot /var/www/webdav/
<Directory /var/www/webdav/>
Options Indexes MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
</VirtualHost>

Restart Apache web server using the following command

#/etc/init.d/apache2 restart

Configure The Virtual Host For WebDAV

If you don’t want to use password authentication you don’t have to use the htpasswd steps this is very useful when you are using ip phone configuration for backup.
Now we create the WebDAV password file /var/www/webdav/passwd.dav with the user test (the -c switch creates the file if it does not exist)

#htpasswd -c /var/www/webdav/passwd.dav admin

You will be asked to type in a password for the user admin.

Now we change the permissions of the /var/www/webdav/passwd.dav file so that only root and the members of the www-data group can access it:

#chown root:www-data /var/www/webdav/passwd.dav

#chmod 640 /var/www/webdav/passwd.dav

Now we modify our vhost in /etc/apache2/sites-available/default and add the following lines to it

#vi /etc/apache2/sites-available/default

add the following lines to

Alias /share /var/www/webdav

<Location /share>
DAV On
AuthType Basic
AuthName “webdav”
AuthUserFile /var/www/webdav/passwd.dav
Require valid-user
</Location>

Restart Apache web server using the following command

#/etc/init.d/apache2 restart

Test your Configuration

First you need to install cadaver, a command-line WebDAV client using the following command

#apt-get install cadaver

To test if WebDAV works, type the following comamnd from the terminal

cadaver http://localhost/share/

You should be prompted for a user name. Type in admin and then the password for the user admin. If all goes well, you should be granted access which means WebDAV is working fine. Type quit to leave the WebDAV shell:

# cadaver http://localhost/share/
Authentication required for admin on server `localhost’:
Username: admin
Password:
dav:/share/> quit
Connection to `localhost’ closed.

Tags: , , , , ,

You may also be interested in...

4 Responses to “WebDAV Configuration With Apache2 On Debian Etch”

  1. Jeff Says:

    Has anyone had success getting this to work with Microsoft Expression Web? Although my setup seems to work with cadaver and even with XP Web folders, Frontpage and Expression Web choke. Mostly I end up with “301 Document Moved” errors.

  2. Anonymous Coward Says:

    These instructions leave some significant security holes. In particular, you probably do not want the password file in the same directory tree that the web server will be providing to the world.

  3. Ryan Says:

    Excellent tip, I work with a team of individuals who I need to setup a file share for and I was prepared to attempt SMB over a tunnel. This is a much better solution and that it utilizes Apache means it is something I already understand.

    As for Jeff’s comment about plugging into Microsoft software… well, I just don’t have a clue - why you would want to do this I do not know, but I suspect it has something to do with the infamous “pointy haired boss”.

  4. Ferdi Vriezen Says:

    Great tutorial! But i can not authenticatie in Windows XP. With cadaver it works…

    Please help!

Leave a Reply

Subscribe RSS Feed

subscribe to the Debian Admin RSS feed

Internal links:

Sponsors:



Categories:

Support Debian Admin

Amount $:
Website(Optional):

Sponsors:

Archives:

Related Links:


Favourite Sites:

Wordpress Collection
Windows Reference
Ubuntu Geek
DebianHelp
All About Debian Tutorials
Power Electrical
Check Your IP Here
Debian,Ubuntu News
DebCentral
Tuxmachines
Capnkirby
Libervis
Nuxifield
Linux Horizon
Linux Appfinder
Debuntu
GNU/Linux For Everyone
Free Penguin
DebianAdmin is not related to the Debian Project.
This site is copyright © 2006,2007 Debian Admin
All Trademarks are the property of their respective owners.
The contents of this website may not be mirrored or archived without the express written permission of DebianAdmin Site Owner.

DISCLAIMER: All the information, troubleshooting methods, utilities offered in this website is provided AS-IS, without any warranties. Though I strive for perfection, and always test the validity and effectiveness of the troubleshooting content in various systems, I assume no responsibility for your use of these Fixes, Utilities and other troubleshooting advice. The author will not be liable for any special, incidental, consequential or indirect damages due to loss of data or any other reason. All use is completely at your own risk. Changes to the existing content and new additions are made to this website periodically, without notification.
Rodney's Kontera DynamiContext Plugin plugged in.