Search ServerWatch
Search ServerWatch
Search ServerWatch



Become a Marketplace Partner

  • Partner With Us















March 2003 Netcraft Survey Results

Newest Apache Release Fixes Yet Undisclosed Vulnerability

Apache's Ant 1.5.2 Released

Microsoft Offers Exchange Support for OS X

ServerWatch > Tutorials

December 28, 2007
Enabling WebDAV on Apache
By Martin Brown

If you are using a statically built server you can skip over this bit. If you're using a dynamic setup, you must tell Apache to load the corresponding DAV module. For Apache 1.3.x under Unix edit the httpd.conf file, find the LoadModule section and uncomment or add the line:

LoadModule dav_module libexec/libdav.so

Under Windows you need:

LoadModule dav_module libexec/mod_dav.dll

Under Mac OS X you need:

LoadModule dav_module libexec/httpd/libdav.so

For Apache 2.x under Unix or Mac OS X, mod_dav you'll need:

LoadModule dav_module modules/mod_dav.so

Under Windows you need:

LoadModule dav_module modules/mod_dav.dll

The next steps are more complex, so we'll take a little breather and find out exactly what is needed. To make use of WebDAV you must provide the location of a lock file (using the DAVLockDB directive) which will be used to record which user has a particular file open for writing or updating and prevents multiple users from trying to write to the same file. You can also specify a timeout value; Apache will automatically remove a lock if no access occurs during this period, the client specifies the requested timeout during connection, but you can override this using the DAVMinTimeout directive. These first two settings are handled by two lines in our httpd.conf file that you can you place more or less anywhere; the first sets the lock file location and the second the timeout value, in seconds:

DAVLockDB /tmp/DAVLock
DAVMinTimeout 600

I've used /tmp here for the lock file location, if you're particularly security conscious you might to use a different directory which is more secure. Note as well that these settings are global to the Apache server instance - we don't need to specify different lock databases for different directories. You can, however, specify different timeout values for different directories just by embedding the DAVMinTimeout.

To enable individual directories with DAV functionality we use a Location directive -- a straightforward DAV directive tells Apache to enable WebDAV on this location. We can also use the Location directive to enable security on the directory both to secure the information we'll be storing and to prevent just anybody adding information to our WebDAV enabled directory. The following block specifies the location of a password file and limits everything but read operations from our directory using the LimitExcept directive:

<Location /dav/>
    DAV On
    AuthType Basic
    AuthName "WebDAV Restricted"
    AuthUserFile /export/http/webs/pri.mcslp/dav/.DAVlogin
    <LimitExcept GET HEAD OPTIONS>
        Require user webdav
    </LimitExcept>
</Location>

The last step is to create our password file (unless we're using an existing one) and if necessary the directory we're enabling with WebDAV:

mkdir /export/http/webs/pri.mcslp/dav
chgrp www /export/http/webs/pri.mcslp/dav
chmod 775 /export/http/webs/pri.mcslp/dav
htpasswd -c /export/http/webs/pri.mcslp/dav/.DAVlogin webdav

Once all that is done, we need to restart the Apache server to enable the new settings. Under Unix/Mac OS X we can do this with apachectl:

apachectl restart

Within Windows, use the Restart control option available from the Start menu.

Testing your Setup
If you are using Mac OS X, probably the easiest way to test it is to share one of your calendars in iCal. Choose Publish from the Calendar menu, choose Publish from a Web Server and enter the full URL of your server and DAV-enabled directory, then enter the username and password you set. Assuming everything has gone correctly, you should have published your calendar to the WebDAV share.

Under Windows, Windows 98, Me, 2000 and XP can all access a Web Share (the Microsoft term for a WebDAV-enabled directory). Use the Add a Network Place wizard, either through the links in the My Network Places window or through a standard File Open/Save dialog and enter the URL - you'll be prompted for a username and password.

Alternatively use a WebDAV enabled client like JEdit. JEdit is Java based and happens to be a very good editor. It also has a plug-in that allows you to open and save files directly from and to a WebDAV folder.

Original date of publication, 04/07/2003

Go to page 1  2  


Discuss this article
Tools:
Add serverwatch.com to your favorites
Add serverwatch.com to your browser search box
IE 7 | Firefox 2.0 | Firefox 1.5.x

Tutorials Archives




JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Solutions
Whitepapers and eBooks
IBM Whitepaper: Innovative Collaboration to Advance Your Business
Internet.com eBook: Real Life Rails
Avaya Article: Call Control XML - Powerful, Standards-Based Call Control
Tripwire Whitepaper: Seven Practical Steps to Mitigate Virtualization Security Risks
Internet.com eBook: The Pros and Cons of Outsourcing
Go Parallel Article: Scalable Parallelism with Intel(R) Threading Building Blocks
Internet.com eBook: Best Practices for Developing a Web Site
IBM CXO Whitepaper: The 2008 Global CEO Study "The Enterprise of the Future"
Avaya Article: Call Control XML in Action - A CCXML Auto Attendant
Go Parallel Article: James Reinders on the Intel Parallel Studio Beta Program
IBM CXO Whitepaper: Unlocking the DNA of the Adaptable Workforce--The Global Human Capital Study 2008
Adobe Acrobat Connect Pro: Web Conferencing and eLearning Whitepapers
Go Parallel Article: Getting Started with TBB on Windows
HP eBook: Storage Networking , Part 1
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
Webcasts
Go Parallel Video: Intel(R) Threading Building Blocks: A New Method for Threading in C++
HP Video: Is Your Data Center Ready for a Real World Disaster?
Microsoft Partner Portal Video: Microsoft Gold Certified Partners Build Successful Practices
HP On Demand Webcast: Virtualization in Action
Go Parallel Video: Performance and Threading Tools for Game Developers
Rackspace Hosting Center: Customer Videos
Intel vPro Developer Virtual Bootcamp
HP Disaster-Proof Solutions eSeminar
HP On Demand Webcast: Discover the Benefits of Virtualization
MORE WEBCASTS, PODCASTS, AND VIDEOS
Downloads and eKits
Microsoft Download: Silverlight 2 Software Development Kit Beta 2
30-Day Trial: SPAMfighter Exchange Module
Red Gate Download: SQL Toolbelt
Iron Speed Designer Application Generator
Microsoft Download: Silverlight 2 Beta 2 Runtime
MORE DOWNLOADS, EKITS, AND FREE TRIALS
Tutorials and Demos
IBM IT Innovation Article: Green Servers Provide a Competitive Advantage
Microsoft Article: Expression Web 2 for PHP Developers--Simplify Your PHP Applications
Featured Algorithm: Intel Threading Building Blocks - parallel_reduce
MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES