Page 1 of 1

Help: Active Directory authentication for website

PostPosted: 21. October 2010 15:10
by sportyones
Hi people,

I'm a first time user of Xampp and want to quickly deploy and test a solution. I am trying to protect the root of my intranet site using Microsoft Active Directory 2003. This will mean that visitors to the intranet site will need to provide their network logon to access the intranet pages. From what I understand I need to do two things to accomplish this:

1. enable LDAP by going to C:\xampp\php\php.ini and uncommenting extension=php_ldap.dll
2. create a .htaccess file in C:\xampp\htdocs

Here is what my .htaccess file looks like

Code: Select all
Order deny,allow
   Allow from all
   AuthBasicProvider ldap
   AuthzLDAPAuthoritative Off
   AuthLDAPURL
   ldap://domaincontroller:389/CN=Users,DC=location,DC=company,DC=com?sAMAccountName?sub?(objectClass=user)
   AuthLDAPBindDN cn=myusername,cn=Users,dc=location,dc=company,dc=com
   AuthLDAPBindPassword mypassword
   AuthType Basic
   AuthName "Protected"
   require valid-user



After doing this I try to browse to localhost and get this error message

Server error!

The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there was an error in a CGI script.

If you think this is a server error, please contact the webmaster.
Error 500
localhost
21/10/2010 15:04:42
Apache/2.2.14 (Win32) DAV/2 mod_ssl/2.2.14 OpenSSL/0.9.8l mod_autoindex_color PHP/5.3.1 mod_apreq2-20090110/2.7.1 mod_perl/2.0.4 Perl/v5.10.1


Can anyone point out what I'm doing wrong. Thanks a lot for your time :)

Re: Help: Active Directory authentication for website

PostPosted: 21. October 2010 15:33
by Stepke-DSL
Hi,

You have to edit the httpd.conf file for .htaccess

Regards Stepke

Re: Help: Active Directory authentication for website

PostPosted: 21. October 2010 17:23
by sportyones
Thanks for the quick reply Stepke-DSL :)

What line do I need to add/edit in the http.conf file? I have read up quite a bit about how to do this, but I'm still new to Xampp and I've been scratching my head over this problem.

Thanks for your patience.

Re: Help: Active Directory authentication for website

PostPosted: 22. October 2010 01:02
by JonB
I have the oddest feeling that the context names may need to be in CAPS to be parsed right - who knows - worth a shot.

i.e CN= DC= etc

Also - did you look in the apache errror log???

I'll be very inerested to see if this works correctly with XAMPP

I also think - Stepke may have been saying you need to add a AccessFileName directive to httpd.conf - but in XAMMP (I just found out answering another topic) its in /apache/extra/default-httpd.conf, so its not where you usually find it. (httpd.conf)

Good Luck
' :)