1

I have multiple VirtualHosts and some of them require authorization. I have one config that I include in those hosts that handles basic authentication. I would like apache to lookup group based on server name I've tried

Require ldap-group cn=%{SERVER_NAME},ou=Groups,dc=example,dc=com

but unfortunately the variable is not resolved. Any tips?

Buri
  • 61
  • 5

1 Answers1

1

The answer is spaces between identifiers, so

Require ldap-group cn=%{SERVER_NAME}, ou=Groups, dc=example, dc=com

See example 5 in the official documentation

Buri
  • 61
  • 5
  • Nice, although it's odd if the spaces are really important here. The docs show them but don't say that they're required. Also, this answers an old question: [Dynamically Authenticate Apache with LDAP Based on Request String?](https://serverfault.com/questions/289569/dynamically-authenticate-apache-with-ldap-based-on-request-string/1052381#1052381) – Andrew Schulman Feb 04 '21 at 12:03