.png)
Apache 기본 인증을 사용하는 데 문제가 있습니다. AWS 탄력적 로드 밸런서와 CloudFront 뒤에 단일 EC2 서버가 있습니다. 컴퓨터에서 여러 도메인을 실행합니다. 특정 영역에 액세스하기 위해 Apache 기본 인증을 사용하지만 모두 동일한 htpassd 및 htgroups 파일을 사용합니다. 한 도메인에서는 제대로 작동하여 전체 하위 도메인에 대한 액세스를 제한하지만 다른 도메인에서는 위치에 대한 액세스를 제한하는 데 작동하지 않습니다(또는 너무 잘 작동합니다. 액세스할 수 없습니다).
환경: Apache 2.4.43 OpenSSL 1.0.2k-fips SVN 1.14.0 PHP 7.4.5
location
실패 모드는 conf.d/subversion.conf에 정의된 Apache에 대한 것입니다 :
<Location /repos>
DAV svn
SVNParentPath /var/svn/
SVNListParentPath On
LogLevel debug
Options All
AllowOverride All Options
AuthType Basic
AuthName "Subversion Repository"
AuthUserFile /mnt/data/etc/htpasswd
AuthGroupFile /mnt/data/etc/htgroups
Require group subversion
그리고 오류 파일이 표시됩니다.
[Mon Aug 17 00:04:47.658169 2020] [authz_core:debug] [pid 30612] mod_authz_core.c(818): [client 10.0.200.51:11378] AH01626: authorization result of Require group subversion: denied (no authenticated user yet)
[Mon Aug 17 00:04:47.658511 2020] [authz_core:debug] [pid 30612] mod_authz_core.c(818): [client 10.0.200.51:11378] AH01626: authorization result of <RequireAny>: denied (no authenticated user yet)
[Mon Aug 17 00:04:54.816887 2020] [authz_core:debug] [pid 30548] mod_authz_core.c(818): [client 10.0.200.51:11382] AH01626: authorization result of Require group subversion: denied (no authenticated user yet)
[Mon Aug 17 00:04:54.817233 2020] [authz_core:debug] [pid 30548] mod_authz_core.c(818): [client 10.0.200.51:11382] AH01626: authorization result of <RequireAny>: denied (no authenticated user yet)
www.myhost.com
위의 SVN 구성을 사용하여 연결하려는 conf.d/vhost.conf 파일에는 www.myhost.com/repos
다음도 있습니다.
<Directory />
Options All
#Allow from All
#Order Allow,Deny
Require all granted
AllowOverride All Options
...
동일한 EC2 호스트와 Apache 인스턴스에서 다른 시나리오에 대해 동일한 인증 메커니즘을 사용하고 있다는 것을 기억하고 확인하기 전에 다양한 쥐구멍을 조사하는 데 오랜 시간을 보냈습니다. 이것은 vhost.conf에서 잘 작동합니다:
ServerName dev.anotherdomain.com
<Directory />
Options All
#Allow from All
#Order Allow,Deny
AllowOverride All Options
# AuthType Digest
AuthType Basic
AuthName "DevAndTest"
AuthUserFile /mnt/data/etc/htpasswd
AuthGroupFile /mnt/data/etc/htgroups
Require group adifferentgroup
이것은 잘 작동하는 것 같아서 약간 당황했습니다 :(
답변1
문제는 Authorization
Cloudfront 배포에서 헤더를 화이트리스트에 추가하는 데 필요하다는 것이 밝혀졌습니다. 원래 질문의 하위 도메인 사례는 Cloudfront 뒤에 있지 않았기 때문에 작동했습니다.