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.
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.
Become root by using the su command:
$ su
Now change to the directory where you placed the OpenLDAP (tar) source file into. (I use a temp directory, /tmp/download):
# cd /tmp/download
Extract the files using the gzip and tar utility:
# gzip -d openldap-stable-xxxxxxx.tar.gz
# tar -xvf openldap-stable-xxxxxxx.tar
Change to the NEW directory which was created during the extract.
# cd openldap-x.x.xx
Now you can run "configure" for the openldap package. "configure" has many command line options. Type "configure --help to see all options.
For this WebServer we dont really need the LDAP deamon, assuming there is a LDAP server running elsewhere. We just need the LDAP lib files. Since we will not be compiling the LDAP deamon, we will have to specify '--disable-slapd' as a command line option to 'configure':
# ./configure --disable-slapd
After you are done with configuring, you can make the dependencies for the openldap package:
# ./make depend
After making the dependencies the openldap package needs to be compiled. Use the make command:
# ./make
If everything goes OK, you will end up with compiled version of openldap in the current directory. Then you will need to install the compiled binaries into appropriate places:
# ./make install
Now you should have the compiled LDAP lib files required for the mod_ldap in the correct directory structure.
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 |
As mentioned above mod_dav will be statically linked with the Apache installation. Start by changing to the temp download directory:
# cd /tmp/download
Extract the files using the gzip and tar utilities:
# gzip -d mod_dav-1.x.x.tar.gz
# tar -xvf mod_dav-1.x.x.tar
Change to the NEW directory which was created during the extract:
# cd mod_dav-1.x.x
Now configure the mod_dav package for static linking to Apache:
# ./configure --with-apache= /tmp/download/apache_1.x.x
Compile and install the files:
# make
# make install
mod_dav will have been partially compiled and placed into the Apache tree during the make install step.
Change back to the temp download directory:
# cd /tmp/download
Extract the mod_auth_ldap files:
# gzip -d mod _auth_ldap.tar.gz
# tar -xvf mod_auth_ldap.tar
Now install the modauthldap files to the Apache source tree:
cd apache_x.x.x
mv ../modauthldap ./src/modules/ldap
Finally we have reached the destination. But it is only the beginning.......
Now we are ready to compile and install Apache with WebDAV and LDAP authentication for DAV.
Change back to the temp download directory:
# cd /tmp/download
Change to the Apache tree directory:
# cd apache-x.x.x
and configure apache for the compilation with mod_dav and mod_auth_ldap:
# ./configure --prefix=/usr/local/apache \ --activate-module=src/modules/ldap/mod_auth_ldap.c \ --activate-module=src/modules/dav/libdav.a [...you can add more options here...] |
Now compile the Apache and install it into the appropriate place:
# make
# make install