-1

When I browse to my apache website, I get the normal website login screen. After the login I can see the site like normal. But when I click on some hyperlink a new login window is showing up.

I can use the same login information and it will work. Or I can cancel the 2nd login and can see the full site content. But I can not understand why the system wants a 2nd login.

This is the conf-enabled/nagios.conf

    ScriptAlias /nagios/cgi-bin "/usr/local/nagios/sbin"

   <Directory "/usr/local/nagios/sbin">
   #  SSLRequireSSL
   Options ExecCGI FollowSymLinks
   AllowOverride None
   #  Order allow,deny
#  Allow from all
   Order deny,allow
   #Deny from all
   Allow from 127.0.0.1 192.168.0.0/24
   AuthName "Nagios Access"
   AuthType Basic
   AuthUserFile /usr/local/nagios/etc/htpasswd.users
   Require valid-user
</Directory>

    Alias /nagios "/usr/local/nagios/share"

<Directory "/usr/local/nagios/share">
#  SSLRequireSSL
   Options None FollowSymLinks
   AllowOverride None
#  Order allow,deny
   Allow from all
   Order deny,allow
   #Deny from all
   Allow from 127.0.0.1 192.168.0.0/24
   AuthName "Nagios Access"
   AuthType Basic
   AuthUserFile /usr/local/nagios/etc/htpasswd.users
   Require valid-user
</Directory>

And this is the conf-enabled/thruk.conf

<IfModule mod_fcgid.c>
  AddHandler fcgid-script .sh
  IPCCommTimeout 120

  <Directory /usr/share/thruk>
    Options FollowSymLinks
    AllowOverride All
    order allow,deny
    allow from all
    # required for apache 2.4
    <IfModule mod_authz_core.c>
      Require all granted
    </IfModule>
  </Directory>
  <Directory /etc/thruk/themes>
    Options FollowSymLinks
    allow from all
    # required for apache 2.4
    <IfModule mod_authz_core.c>
      Require all granted
    </IfModule>
  </Directory>
  <Directory /etc/thruk/plugins>
    Options FollowSymLinks
    allow from all
    # required for apache 2.4
    <IfModule mod_authz_core.c>
      Require all granted
    </IfModule>
  </Directory>

  Alias /thruk/documentation.html /usr/share/thruk/root/thruk/documentation.html
  Alias /thruk/startup.html /usr/share/thruk/root/thruk/startup.html
  AliasMatch ^/thruk/(.*\.cgi|.*\.html)  /usr/share/thruk/fcgid_env.sh/thruk/$1
  AliasMatch ^/thruk/plugins/(.*?)/(.*)$  /etc/thruk/plugins/plugins-enabled/$1/root/$2
  Alias /thruk/themes/  /etc/thruk/themes/themes-enabled/
  Alias /thruk /usr/share/thruk/root/thruk

  <Location /thruk/>
    Options ExecCGI FollowSymLinks
    AuthName "Thruk Monitoring"
    AuthName "Nagios Access"
    AuthType Basic
    #AuthUserFile /usr/local/nagios/etc/htpasswd.users
    AuthUserFile /etc/thruk/htpasswd
    Require valid-user
  </Location>
  <Location /thruk/cgi-bin/remote.cgi>
    Order Deny,Allow
    Allow from all
    Satisfy any
  </Location>
</IfModule>

# use compressed output if available
<IfModule mod_deflate.c>
  <Location /thruk/>
    AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript
  </Location>
</IfModule>

Both using the same password file and the same "AuthName". Since this is some cgi-module site I am not sure whats the problem is.

1 Answer 1

1

The answer is here:

 AuthUserFile /usr/local/nagios/etc/htpasswd.users

When you login into application its 1st one. When you try to open localtion which is configured to use htpasswd its the second logging. Disable logging by htpasswd to get rid of second logging.

Just delete those fileds:

  AuthName "Nagios Access"
  AuthType Basic
  AuthUserFile /usr/local/nagios/etc/htpasswd.users
  Require valid-user
6
  • Thanks for your answer. But when I delete the lines the other login does not longer work. I need the login working for /nagios and for /thruk. Unfortunately this didn't solve the problem... The interesting part is that I can just cancel the 2nd login and the site shows me the full content. Aug 31, 2015 at 15:15
  • I changed the lines and did an apache service restart just for information. Aug 31, 2015 at 15:23
  • This didn't solve the problem. I pasted the full conf file text know. maybe there is something with the cgi-module happening? Sep 1, 2015 at 10:10
  • You need to comment out ALL of the directives for Auth in each location you want to get rid of second logging. Sep 1, 2015 at 10:37
  • 1. I need logins for /nagios and /thruk. 2. The pasted config file was the state after the try 3. I found the issue by changing the "authnames" to different names. Then I saw that this was not the nagios.conf it was some the pnp4nagios which using some cgi module. I deleted all the authentications in this file and the 2nd login didn't show up again. The only problem is you can now just browse to the pnp4nagios webpage and you can see the content. I can not understand why the browser didn't accept the same AuthName as already logged-in. Sep 1, 2015 at 16:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .