
서버가 RHEL 7 및 Apache 2.4.6을 실행 중입니다. 이것은 꽤 새로운(약 일주일 전) 문제입니다. 우리 부서 인트라넷은 대학의 Active Directory 환경에 대한 인증을 사용하며 최종 사용자에 대한 인증에는 30초 이상이 소요됩니다. 후속 페이지 로드는 거의 즉각적이며 일정 시간(시간 초과라고 가정) 후에 문제가 다시 발생합니다.
<Directory /var/www/html/intranet>
AuthType Basic
AuthName "Restricted files"
AuthBasicProvider ldap
AuthLDAPBindDN CN=dept-binder,OU=Generic-Logon,OU=Generic,DC=example,DC=edu
AuthLDAPBindPassword lamepassword
AuthLDAPURL ldaps://ldap-ad.example.edu:636/dc=example,dc=edu?sAMAccountName?sub
<RequireAny>
require ldap-group CN=ug-dept-intranet,OU=Deoartment,OU=Dept-Groups,DC=example,DC=edu
</RequireAny>
</Directory>
error_log의 관련 행은 다음과 같습니다.
AH02034: Initial (No.1) HTTPS request received for child 36 (server dept.example.edu:443)
AH01626: authorization result of Require ldap-group CN=ug-psy-employees,OU=Dynamic,OU=Psychology,OU=FSU-Dept-Groups,DC=fsu,DC=edu: denied (no authenticated user yet)
AH01626: authorization result of Require ldap-group CN=ug-dept-intranet,OU=Dept,OU=Dept-Groups,DC=example,DC=edu: denied (no authenticated user yet)
AH01691: auth_ldap authenticate: using URL ldaps://ldap-ad.example.edu:636/dc=example,dc=edu?sAMAccountName?sub
AH02001: Connection closed to child 11 with standard shutdown (server dept.example.edu:443)
# 37 seconds pass
AH01697: auth_ldap authenticate: accepting jsmith
AH01713: auth_ldap authorize: require group: testing for group membership in "CN=ug-dept-intranet,OU=Department,OU=Dept-Groups,DC=example,DC=edu"
AH01714: auth_ldap authorize: require group: testing for member: CN=jsmith,OU=PEOPLE,DC=example,DC=edu (CN=ug-dept-intranet,OU=Department,OU=Dept-Groups,DC=example,DC=edu)
AH01715: auth_ldap authorize: require group: authorization successful (attribute member) [Comparison true (adding to cache)][6 - Compare True]
답변1
Apache 2.4가 설치된 Fedora 33에서 정확히 동일한 문제가 발생했으며 다음을 추가하여 해결했습니다.
LDAPConnectionTimeout 1
Apache 전역 구성에: https://httpd.apache.org/docs/2.4/mod/mod_ldap.html
위 매개변수는 LDAP 연결 시간 제한을 1초로 설정합니다.
저는 TLS와 함께 LDAPS를 사용하고 있으며 Apache가 이름을 확인하거나 Active Directory/DC 비적격(자체 등록) 인증서를 확인하려고 하여 지연이 발생한 것으로 의심됩니다.
답변2
디렉터리가 크면(대학일 수도 있음) 기본적으로 쿼리가 느려질 수 있습니다. 당신은 그들을 조정할 필요가 있습니다. 묘책은 없지만 몇 가지 지침은 다음과 같습니다.
- 색인화된 속성 필터링
- 속성이 복제된 글로벌 카탈로그로 나열되면 글로벌 카탈로그 포트를 사용해 보십시오.
- (가능한 경우) 하위 범위 검색을 피하세요. 이는 분명히 항상 가능한 것은 아니지만 종종 가능합니다.
여기에 더 많은 항목이 나열되어 있습니다.마이크로소프트 문서.
당신은 시도 할 수 있습니다mod_ldap 디버깅, 어쩌면 그런 식으로 몇 가지 명백한 문제를 발견할 수 있습니다. 디버그 로그에 자격 증명이 나타날 수 있다는 점에 유의하세요.