Search This Blog

Monday, 9 August 2010

WebDav configuration with apache webserver


Web-based Distributed Authoring and Versioning (WebDAV) is a set of methods based on the Hypertext Transfer Protocol (HTTP) that facilitates collaboration between users in editing and managing documents and files stored on World Wide Web servers.

The WebDAV protocol makes the Web a readable and writable medium. It provides a framework for users to create, change and move documents on a server (typically a web server or "web share").


Appache configuration for webdev:


1. Make sure mod_dav_fs is loaded with Apache

[root@shimna ]# apachectl -t -D DUMP_MODULES|grep  dav_fs_module
dav_fs_module (shared)
Syntax OK

The above command list all the modules loaded by Apache and grep fordav_fs_module.


2. Create a lock file with httpd user permission because DAVLockDB that can be written by the web server process

To find out httpd user name group name, grep for User and Group in httpd.conf as below.  Here the username is apache and group name  is apache.

[root@shimna]# egrep 'User |Group ' /etc/httpd/conf/httpd.conf|grep -v ^#

User apache
Group apache
Now this we can create the lock file.
#mkdir /var/lib/dav/
#touch /var/lib/dav/lockdb
#chown -R apache:apache /var/lib/dav/

3. Create a Apache password file for authentication purpose. Below is the steps to add a user latheefp.

[root@shimna dav]#  htpasswd -c /etc/httpasswd latheefp
New password:
Re-type new password:
Adding password for user latheefp

4.Editing Apache configuration file
This is the default line in configuration file regarding webdav.
    # Location of the WebDAV lock database.
    DAVLockDB /var/lib/dav/lockdb


We have to edit above depends up on our configuration like below.

<IfModule mod_dav_fs.c>
# Location of the WebDAV lock database.
DAVLockDB /var/lib/dav/lockdb
#setting an alias path to /locker/audit/web as /webdav
Alias /webdav /locker/audit/web/
<Directory /locker/audit/web/>
AuthName "Webdev for unixindia"
AuthType basic
#Rplace below lines accordingly
AuthUserFile /etc/httpasswd
require user latheefp



5. Restart Apache

[root@shimna ]# /etc/init.d/httpd restart

Stopping httpd:                    [  OK  ]

Starting httpd                     [  OK  ]


We  have completed all required settings in Server side. Now let us see how to access it from Windows system.


my network place

Click on Add a network place


Click Next


Click on Choose Another Network location


Type the path to webdav directory as above and click next.


Provide the username and password (here its latheefp and password created using htpasswd command in server configuration)




Just follow above 3 steps. Provide the same username and password when you open the webdav as windows drive for the first time.

         open window

Now the remote wedav is ready to accces as windows directory.

test dir

Just created a test dir.

No comments:

Post a Comment