Dev/Server

[Apache] 설정 파일의 주석 위치에 따른 Apache 응답 속도 저하

pu3vig 2022. 6. 28. 10:44
728x90
  • target:  Apache에서의 응답 속도 저하 원인 관련

 


  • method: 

https://httpd.apache.org/docs/2.2/mod/mod_authz_host.html

 

mod_authz_host - Apache HTTP Server Version 2.2

 

httpd.apache.org

※ Apache의 mod_authz_host 모듈 설명 문서 발췌


호스트명 (일부)

예제:
Allow from apache.org

호스트명이 이 문자열과 같거나 이 문자열로 끝나면 접근을 허용한다. 그래서 이 경우 foo.apache.org는 해당되고, fooapache.org는 해당되지 않는다. 이 설정을 사용하면 아파치는 HostnameLookups 지시어 설정과 관계없이 클라이언트 IP 주소를 가지고 중복-역 DNS 검색을 한다. 즉, 호스트명을 찾기위해 IP 주소를 역DNS 검색을 한 후, 다시 호스트명으로 검색하여 원래 IP 주소와 일치하는지 확인한다. 결과가 같고 호스트명이 설정값에 해당하면, 접근을 허용한다.


<Location> 또는 <Locationmatch>에서 Allow from / Deny from 과 같은 라인데 주석을 사용 시, Apache에서는 주석 부분을 도메인으로 인식하는 듯 함

# 이슈 전
<Location />
    Order deny,allow
    Allow from sample.co.kr				# sample site
</Location>


# 처리안
<Location />
    Order deny,allow
    # sample site
    Allow from sample.co.kr
</Location>

※ 따라서 주석과 모듈 설정 부분은 별도 라인으로 구분해서 처리 필요

 


  • desc: 

- Apache와 Tomcat 연동 이후, '*.sample.co.kr'과 같은 특정 도메인의 경우 DNS Lookup 실행에서 발생

- mod_jk, mod_proxy, mod_proxy_ajp 모두에서 발생할 수 있음

 


  • warning: 

- 위 응답 속도 저하 현상에 대한 처리 방안은 다양한 원인에 대한 처리 방안들 중 하나

 


  • source:

https://d2.naver.com/helloworld/4744401

 

728x90