
Ich habe versucht, die Authentifizierung in zu aktivieren apache
. Ich habe die folgenden Konfigurationselemente ausprobiert.
<Directory "/var/www/html/balancer-manager">
Order deny,allow
AuthName "Restricted area for authorised users only"
AuthType Basic
AuthUserFile /etc/httpd/conf/admin.users
Require valid-user
</Directory>
$ cat /etc/httpd/conf/admin.users
test:kWtP2lRnbgNaK31
Aber es werden keine Anmeldeinformationen abgefragt. Was übersehe ich?
Bitte suchen Sie nach dem Protokollinhalt, nachdem Sie den DEBUG-Modus aktiviert haben
[Fri Jan 18 10:48:34.663221 2019] [core:info] [pid 32043] AH00096: removed PID file /run/httpd/httpd.pid (pid=32043)
[Fri Jan 18 10:48:34.663282 2019] [mpm_prefork:notice] [pid 32043] AH00170: caught SIGWINCH, shutting down gracefully
[Fri Jan 18 10:48:35.725075 2019] [suexec:notice] [pid 29306] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Fri Jan 18 10:48:35.738035 2019] [auth_digest:notice] [pid 29306] AH01757: generating secret for digest authentication ...
[Fri Jan 18 10:48:35.738064 2019] [auth_digest:debug] [pid 29306] mod_auth_digest.c(250): AH01759: done
[Fri Jan 18 10:48:35.738672 2019] [slotmem_shm:debug] [pid 29306] mod_slotmem_shm.c(448): AH02301: attach looking for /run/httpd/slotmem-shm-mod_heartmonitor.shm
[Fri Jan 18 10:48:35.738688 2019] [lbmethod_heartbeat:notice] [pid 29306] AH02282: No slotmem from mod_heartmonitor
[Fri Jan 18 10:48:35.741178 2019] [proxy:debug] [pid 29308] proxy_util.c(1843): AH00925: initializing worker proxy:reverse shared
[Fri Jan 18 10:48:35.741214 2019] [proxy:debug] [pid 29308] proxy_util.c(1885): AH00927: initializing worker proxy:reverse local
[Fri Jan 18 10:48:35.741261 2019] [proxy:debug] [pid 29308] proxy_util.c(1936): AH00931: initialized single connection worker in child 29308 for (*)
[Fri Jan 18 10:48:35.741291 2019] [mpm_prefork:notice] [pid 29306] AH00163: Apache/2.4.6 (Red Hat Enterprise Linux) configured -- resuming normal operations
[Fri Jan 18 10:48:35.741310 2019] [mpm_prefork:info] [pid 29306] AH00164: Server built: Oct 3 2017 09:37:04
Antwort1
Bei mir funktioniert die Konfiguration hier folgendermaßen:
<Directory /var/www/html/balancer-manager>
AuthType Basic
AuthName "Restricted area for authorised users only"
AuthUserFile /etc/httpd/conf/admin.users
Require valid-user
</Directory>
Starten Sie dann Apache neu.
Antwort2
Funktioniert bei mir, wenn ich Directory
die Direktive mit Location
der Direktive ersetze. Nachfolgend der Ausschnitt
<Location "/balancer-manager">
AuthName "Restricted area for authorised users only"
AuthType Basic
AuthUserFile /etc/httpd/conf/admin.users
Require valid-user
</Location>