인증이 아파치에서 작동하지 않습니다

인증이 아파치에서 작동하지 않습니다

에서 인증을 활성화하려고 합니다 apache. 다음 구성 항목을 시도했습니다.

<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

하지만 자격 증명을 요구하지는 않습니다. 내가 무엇을 놓치고 있나요?

DEBUG 모드를 활성화하고 로그 내용을 검색하세요.

[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

답변1

내 구성은 다음과 같습니다.

<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>

그런 다음 Apache를 다시 시작하십시오.

답변2

Directorydirective 로 지시문을 변경했을 때 나를 위해 일했습니다 Location. 다음은 일부입니다.

  <Location "/balancer-manager">
   AuthName "Restricted area for authorised users only"
   AuthType Basic
   AuthUserFile /etc/httpd/conf/admin.users
   Require valid-user
  </Location>

관련 정보