Apache WebDAV and LDAP HOWTO

Saqib Ali

            saqib@seagate.com
         

Revision History
Revision v2.02002-03-22Revised by: sa
Added the SSL section
Revision v1.12001-11-29Revised by: sa
Initial public release.
Revision v1.02001-11-01Revised by: sa
Initial public release.

Table of Contents
1. Introduction
1.1. Copyright and License
1.2. What is WebDAV
1.3. How does WebDAV work?
1.4. What do we need?
1.5. Assumptions
1.6. Opinions and Suggestions
2. Installing WebDAV services
2.1. Pre-Requirements
2.2. Pre-configuring Apache
2.3. Configuring and Installing mod_dav
2.4. Installing and configuring mod_auth_ldap
2.5. Installing and configuring mod_ssl
2.6. Configuring and Installing Apache
3. Configuring and Setting up the WebDAV services
3.1. Modifications to the /usr/local/apache/conf/httpd.conf
3.2. Creating a directory for DAVLockDB
3.3. Enabling DAV
3.4. Create a Directory called DAVtest
3.5. Restart Apache

1. Introduction

The Objective of this document is to setup a Apache based WebDAV server that can authenticate against a LDAP server. You will learn how to install, configure, run, maintain and fine-tune a Apache-based WebDAV server. This document will provide the basic groundwork for setting up a WebDAV server. It will also provide information on fine tuning and maintaining the server.

Note: If you encounter any problems installing Apache or any of the modules please feel free to contact me.

WebDAV Support and Discussion Forum

This document is not a HOWTO on setting up LDAP server. For setting up a LDAP server please visit http://www.linuxdoc.org/HOWTO/LDAP-HOWTO-1.html


1.5. Assumptions

This document assumes that you have the following already installed on your system.

  1. gzip or gunzip - available from http://www.gnu.org

  2. gcc and GNU make - available from http://www.gnu.org

The document also assumes there is a LDAP server installed elsewhere which will be used for the authentication.


2. Installing WebDAV services

Our game plan is to first install OpenLDAP package. OpenLDAP is not required for Apache_LDAP_DAV to work, but we will need the installed OpenLDAP lib files to compile mod_ldap. And then we will compile Apache with mod_ldap and mod_dav.

Please download the following packages.


2.1. Pre-Requirements

To compile the WebDAV service with LDAP authencation capability, we will need to have the LDAP library files installed on the machine. The LDAP library files will be used to compile the LDAP module for Apache. Best way to get the LDAP library files is to download the OpenLDAP sourcecode from http://www.openldap.org and compile it to produce the required library files. You may use any other LDAP like IPlanet as well, but I recommend an OpenSource solution.


2.2. Pre-configuring Apache

mod_dav requires that you have Apache pre-configured so that it knows where where everything is. Change back to the directory where you have the source files:

  # cd /tmp/download 
  # gzip -d apache_1.x.x.tar.gz 
  # tar -xvf apache_1.x.x.tar 
  # cd apache_1.x.x 
  # ./configure --prefix=/usr/local/apache  


3. Configuring and Setting up the WebDAV services

Now for the easy part. In this section we will WebDAV enable a directory under Apache root.


3.3. Enabling DAV

Enabling DAV is a trivial task. To enable DAV for a directory under Apache root, just add the following directive in the container for that particular directory:

  DAV On

This directive will enable DAV for the directory and its sub-directories.

The following is a sample configuration that will enable WebDAV and LDAP authentication on /usr/local/apache/htdocs/DAVtest. Place this in the /usr/local/apache/conf/httpd.conf file.

  <Directory /usr/local/apache/htdocs/DAVtest>
  Dav On
  #Options Indexes FollowSymLinks

  AllowOverride None
  order allow,deny
  allow from all
  AuthName "username_and_passwd_required"
  AuthType Basic
  <Limit PUT POST DELETE PROPFIND PROPPATCH MKCOL COPY MOVE LOCK UNLOCK>
  Require valid-user
  </Limit>
  LDAP_Server your.ldap.server.com
  LDAP_Port 007
  Base_DN "o=ROOT"

  UID_Attr uid
  </Directory>


3.5. Restart Apache

Finally you must run the configuration test routine that comes with Apache to verify the syntax in httpd.conf :

# /usr/local/apache/bin/apachectl configtest

If you get error messages please verify that you followed all of the above mentioned steps correctly. If you can not figure out the error message feel free to email me with the error message (saqib@seagate.com).

If the configtest is successful start the apache web-server:

# /usr/local/apache/bin/apachectl restart

Now you have WebDAV enabled Apache Server with LDAP authentication.

If you have any questions, suggestions, recommendations, kudos, comments, or complaints, please email them to me (saqib@seagate.com).

Note: Please free to contact me if you encounter any problems installing Apache or any of the modules, or if you would like upgrade your existing Apache server to support WebDAV.

WebDAV Support and Discussion Forum