job/apache

Additionally, a 400 Bad Request error was encountered while trying to use an ErrorDocument to handle the request.

시스템엔지니어 2020. 3. 30. 21:11

Bad Request

Your browser sent a request that this server could not understand.

Additionally, a 400 Bad Request error was encountered while trying to use an ErrorDocument to handle the request.

 

증상

1.apache 2.2 / php 소스 / 가상호스트 설정되어 사용중에 위와같은 에러 발생
2.가상호스트에 설정된 ErrorLog나 CustomLog 에 찍히지 않고 기본 가상호스트(제일 최상단)에 설정된 customlog에 400 get 로그만 찍힘(에러로그에는 안찍힘)

확인해보니 도메인 네임에 "_" 언더바가 들어가면 에러가 나는것 같다. _ > - 로 바꿔서 해보니 잘 나온다.

 

https://ma.ttias.be/apache-httpd-2-2-15-60-underscores-hostnames-now-blocked/

 

Apache httpd 2.2.15-60: underscores in hostnames are now blocked

A minor update to the Apache httpd project on CentOS 6 had an unexpected consequence. The update from 2.

ma.ttias.be

 

내용 정리하자면 아파치 centos 6 버전에서 아파치 2.2.15 이상부터는 rfc1123 기반하여 도메인네임에 _ 언더바(외국어로는 언더스코어(underscore)로 표현하는듯)를 허용하지 않는다고 한다.
https://access.redhat.com/errata/RHSA-2017:1721

 

Red Hat Customer Portal

요약 Moderate: httpd security and bug fix update 유형/심각도 Security Advisory: Moderate 주제 An update for httpd is now available for Red Hat Enterprise Linux 6. Red Hat Product Security has rated this update as having a security impact of Moderate. A Common Vulne

access.redhat.com

처리방법으로는

아파치 2.2.14 버전쓰던가
도메인네임 바꿔야 할듯..