title: LDAPS Authentication for Nagios Web GUI
body: <p>I am trying to enable LDAPS authentication for my Nagios web GUI (<a href="https://localhost/nagios" rel="nofollow noreferrer">https://localhost/nagios</a>) against Active Directory. I've set this up with LDAP before without much trouble, but LDAPS is a headache.
  I think my cert is valid since Event Viewer in Active Directory shows what I believe is a successful credential validation.
  In my browser, after entering username and pwd for AD, it spins for a while and ends up at an Internal Server Error page.
  None of my logs give me anything useful.</p>
  
  <p>Here's what I've done so far:</p>
  
  <ol>
  <li>nagios.conf - Modified for LDAPS (see below attached file)</li>
  <li><p>ldap.conf - Added the following lines:</p>
  
  <blockquote>
    <p>HOST "hostname"<br>
    PORT 636<br>
    TLS_CACERT /etc/httpd/conf.d/rootcert.pem<br>
    TLS_REQCERT never</p>
  </blockquote></li>
  <li><p>(FYI, rootcert.pem was created by taking the cert issued by the root CA and converting to pem format):</p>
  
  <blockquote>
    <p>openssl x509 -inform der -in rootcert.cer -out rootcert.pem</p>
  </blockquote></li>
  </ol>
  
  <p>Here is my nagios.conf. Stuff in [brackets] are edited to not include my real info:</p>
  
  <blockquote>
    <p>ScriptAlias /nagios/cgi-bin "/usr/local/nagios/sbin"  </p>
    
    <p>&lt;Directory "/usr/local/nagios/sbin"&gt;<br>
    SSLRequireSSL<br>
    Options ExecCGI<br>
    AllowOverride None<br>
    Order allow,deny<br>
    Allow from all<br>
    AuthBasicProvider ldap<br>
    AuthType Basic<br>
    AuthzLDAPAuthoritative on<br>
    AuthLDAPGroupAttribute member<br>
    AuthLDAPGroupAttributeIsDN off<br>
    AuthName "Active Directory Login 1"<br>
    AuthLDAPURL "ldaps://[myActiveDirServerName]:636/DC=[dc1],DC=[dc2],DC=[dc3],DC=[dc4]?sAMAccountName?sub?(objectClass=*)" NONE<br>
    AuthLDAPBindDN "CN=nagiosadmin,OU=[ou1],OU=[ou2],OU=[ou3],DC=[dc1],DC=[dc2],DC=[dc3],dc=[dc4]"<br>
    AuthLDAPBindPassword [passwd]<br>
    Require valid-user<br>
    &lt;/Directory&gt;</p>
    
    <p>Alias /nagios "/usr/local/nagios/share"</p>
    
    <p>&lt;Directory "/usr/local/nagios/share"&gt;<br>
    SSLRequireSSL<br>
    Options ExecCGI<br>
    AllowOverride None<br>
    Order allow,deny<br>
    Allow from all<br>
    AuthBasicProvider ldap<br>
    AuthType Basic<br>
    AuthzLDAPAuthoritative on<br>
    AuthLDAPGroupAttribute member<br>
    AuthLDAPGroupAttributeIsDN off<br>
    AuthName "Active Directory Login 2"<br>
    AuthLDAPURL "ldaps://[myActiveDirServerName]:636/DC=[dc1],DC=[dc2],DC=[dc3],DC=[dc4]?sAMAccountName?sub?(objectClass=*)" NONE<br>
    AuthLDAPBindDN "CN=nagiosadmin,OU=[ou1],OU=[ou2],OU=[ou3],DC=[dc1],DC=[dc2],DC=[dc3],dc=[dc4]"<br>
    AuthLDAPBindPassword [passwd]<br>
    Require valid-user<br>
    &lt;/Directory&gt;</p>
  </blockquote>
  
  <p>Any help you could provide would be greatly appreciated! </p>