Ldap – [Solved]Internal Error 500 occur when use apache 2.4 with LDAP Authetication

active-directoryapache-2.4ldapsvnwindows-server-2012-r2

I have an CentOS 7 server with SVN server configured and I have another windows server 2012R2 with LDAP, that I use for domain controller. I can use ldapsearch communicate with windows server.

Well my problem now is that When I try to login into svn server via browser, It comes up a Internal Error (500) no matter what I entered.

The error message is :

[Thu May 12 13:27:36.786664 2016] [authz_core:debug] [pid 10377] mod_authz_core.c(809): [client 1.1.1.1:50409] AH01626: authorization result of Require valid-user : denied (no authenticated user yet)
[Thu May 12 13:27:36.786695 2016] [authz_core:debug] [pid 10377] mod_authz_core.c(809): [client 1.1.1.1:50409] AH01626: authorization result of <RequireAny>: denied (no authenticated user yet)
[Thu May 12 13:27:36.786732 2016] [authnz_ldap:debug] [pid 10377] mod_authnz_ldap.c(501): [client 1.1.1.1:50409] AH01691: auth_ldap authenticate: using URL ldap://a-d01:389/,dc=a,dc=domain,dc=com?sAMAccountName?sub?(ObjectClass=*)
[Thu May 12 13:27:36.787048 2016] [ldap:debug] [pid 10377] util_ldap.c(372): AH01278: LDAP: Setting referrals to On.
[Thu May 12 13:27:36.874625 2016] [authnz_ldap:info] [pid 10377] [client 1.1.1.1:50409] AH01695: auth_ldap authenticate: user svnuser authentication failed; URI /repo [ldap_search_ext_s() for user failed][Invalid DN syntax]

Best Answer

As the error says, there seems to be error in DN syntax:

[Thu May 12 13:27:36.874625 2016] [authnz_ldap:info] [pid 10377] [client 1.1.1.1:50409] AH01695: auth_ldap authenticate: user svnuser authentication failed; URI /repo [ldap_search_ext_s() for user failed][Invalid DN syntax]

As per the error logs, you have used "ldap://a-d01:389/,dc=a,dc=domain,dc=com" Iguess it should be "ldap://a-d01:389/dc=a,dc=domain,dc=com" instead.

[Thu May 12 13:27:36.786732 2016] [authnz_ldap:debug] [pid 10377] mod_authnz_ldap.c(501): [client 1.1.1.1:50409] AH01691: auth_ldap authenticate: using URL ldap://a-d01:389/,dc=a,dc=domain,dc=com?sAMAccountName?sub?(ObjectClass=*)
[Thu May 12 13:27:36.787048 2016] [ldap:debug] [pid 10377] util_ldap.c(372): AH01278: LDAP: Setting referrals to On.