A - Is there a LDAP authentication module (mod_auth_ldap) for the version of Apache that comes built into MacOS Server 10.5?
(I'm pretty sure no, but maybe someone compiled one.)
B - If not, can it be compiled into MacOS' version of Apache?
(Man, that would be nice.)
3 - If I can't use the Apple version of Apache for this, what is the best way to get Apache LDAP authentication working on MacOS Server 10.5?
(Preferably one that works with MacOS Servers management software)
Good luck using apsx to build mod_authnz_ldap against Apple's httpd.
But you can build your own httpd with ldap without much effort.
Disable Apple's httpd in Server Admin and create your own launchd plist.
Edit your plist to point to your httpd (replace /usr/sbin/httpd with /usr/local/apache2/bin/httpd) and change the Label.
Update /usr/local/apache2/bin/apachectl to use launchd as per this patch:
No, you will not be able to use Apple Server Admin to configure and administer your httpd. But Server Admin cannot provide a GUI that encompasses all of httpd's configuration options anyway. Add /usr/local/apache2/bin to your PATH (or always specify full paths). Configure and test httpd, and load it via launchctl:
http://www.opensource.apple.com/ and http://www.macports.org/ are good sources for hints on how to compile open source software for OSX.
It has been a pain, but I finally managed to successfully compile Apache 2.2.15 with LDAP support on Mac OS X 10.5.8 (PowerBook G4). I hope the steps below can be used as well for the Server version. This document: http://www.grahamcox.co.uk/serendipity/index.php?/archives/30-Compiling-LDAP-support-for-Apache-2.2.4.html helped a lot. This is what I did:
/opt/openldap
(luckily I could use my Subversion's BerkeleyDB libraries that I had previously installed.)/opt/apache-2.2.15
, I know, I'm a fan of/opt
, guess where I installed Subversion):Now it works like a charm.
Hopefully this will also work for you.
mod_auth_ldap / mod_authnz_ldap aren't built in to the version of Apache that comes with OS X (Why I don't know, since they include mod_ldap... sigh)
I'm not sure about(B) -- You could conceivably download Apache from httpd.apache.org, compile it (specify mod_authnz_ldap as a shared module), copy the mod_authnz_ldap.so module into /usr/libexec/apache2/ and hand-edit the OS X apache configuration to load the module. Theoretically that should work.
If you try this I would suggest using source code that matches the version of Apache on your mac (Probably 2.2.13 but check "httpd -v" in the terminal to get the version number)
Re: #3, as far as I know there are no other Apache version that integrate with the OS X server manager, though (again theoretically) any 2.2.x version should work as long as its using the configuration files the server manger writes out).
I'd be interested if there is a less hackish way to enable LDAP authentication.
You can download Apple's Apache source code from their site. If you build this using their Makefile you should end up with a version of Apache pretty much identical to the one that comes installed with Mac OS X. From there I'd try changing some of the options in the build process to enable the
mod_authnz_ldap
module. A good start would be adding--enable-authnz-ldap
to theConfigure_Flags
part of the Makefile and seeing what happens.Chances are you will need the OpenLDAP source for your system, which you can also get from Apple. Then you can add another configure flag to point to the source:
--enable-ldap=<source dir>
.This should get you started but you will probably have to work out a few kinks along the way. Remember, if you need the source/headers for any system components just download them from the Apple site so they match the versions on your machine.