웹마스터 팁

Some work I've been doing recently has involved debugging a Mambo installation. The website had developed the curious ability to block the editing of certain articles, but allowed other ones through. These blocked attempts to save articles were resulting in a '406 Not Acceptable' error.

According to the W3 specification, this means:

The resource identified by the request is only capable of generating response entities which have content characteristics not acceptable according to the accept headers sent in the request.

Say what?

After a lot of hair-pulling I tracked the problem down to a few words, such as '<script' and '&amp;', which when included caused the error. This made me very suspicious - why would Mambo only block this HTML code? I explored further by inserting debug code into Mambo and then waited for the result... nothing. Mambo wasn't even being called.

This meant the problem must be before Mambo, and there was only one thing that could be responsible: Apache.

Some Googling later and I found information about an optional Apache module called mod_security. This is a very nice module that acts as an Apache firewall - it blocks a lot of the usual routes that people use to hack websites. In particular it scans POST requests (sent when you 'save' something on a website'), and displays a 406 error for anything controversial. Bingo!

The reason I'm documenting these frustrating few hours of my life is in the hope that it may prove useful to someone else. It appears that mod_security, if configured aggressively, can cause a lot of problems and these may manifest themselves in Mambo, WordPress, or any piece of web software.

The solution was very simple. The following lines were added to the .htaccess file to disable mod_security:

20080205.JPG

<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>

Naturally you loose any benefits that mod_security might bring, but that's better than a non-functioning website, and you can always ask for the security configuration to be toned down to a more acceptable level.


외국사이트에서 보구 해결한겁니다.
내용에대한설명은 접구 결론은 저 모드에 대한 보안은 없어지지만 사이트가 더 잘돌아가는게 낫지 않겠냐하는 말입니다.

.htaccess 에 아래문구를 집어넣으면 해결입니다.

<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>

부디 도움이되시길....

태그 연관 글
  1. [2019/04/21] 웹마스터 팁 1.11.3 업로드 패치 이후 업로드 오류 관련 by 우소푸
  2. [2018/12/12] 묻고답하기 관리자 로그인 페이지 406 Not Acceptable 에러 by 절대불가 *1
  3. [2017/10/21] 포럼 Transfer-encoding: chunked 대용량 파일 첨부 시 에러 문제 by diomin *2
  4. [2017/07/22] 묻고답하기 닷홈게시판 Wix홈페이지 연결오류 by 한우 *1
  5. [2016/10/17] 묻고답하기 https 관련 질문입니다 ㅠㅠ by 쿠닌 *1
제목 글쓴이 날짜
웹서버 php에서 한글언어 깨지거나 오류날때 방법@ 뭘봐첨봐 2015.01.19
사이트 종합해서 접속자 아이피 검색 file StyleRoot 2015.01.19
kin 모듈 게시물 -> board로 게시물 옮기기 편법 file 꾸링 2015.01.20
누리고 쇼핑몰 상품취소 혹은 반품시 마일리지 자동회복하기 [6] garnecia 2015.01.21
익명게시판에서 임시저장된 글을 불러와 등록하면 익명처리되지 않고 글쓴이 정보가 기록되는 버그 수정 [1] sejin7940 2015.01.23
사용자 매뉴에 회원정보와 포인트설정 바로가기 기능 삽입 [1] file 간장게장같은남자 2015.01.23
사용자정의 중 전화번호 형식을 쓰는경우 - 사이에 한칸씩 여백이 생기는 걸 없애는방법 [1] sejin7940 2015.01.23
게시판에서 태그 기준으로 검색하면 임시저장글들도 노출되는 버그 수정 sejin7940 2015.01.23
DB LOCK으로 인한 사이트 마비와 사례, 조치 [2] onTrust 2015.01.24
부트스트랩 관련 버튼안에 체크박스 돼지코구뇽 2015.01.25
xe 폰갭 제작시 admob 광고 글쓰기 방해 하지 않으려면 한꼬마 2015.01.26
템플릿등에서 PHP 제어 구조(if, for, foreach)의 대체 문법 적용 [3] 총모아 2015.01.30
누리고 쇼핑몰 - 배송비가 표시 안되는 경우에 [7] garnecia 2015.01.31
회원가입후 24시간 이후 글작성 가능하기 [2] 샵사이드 2015.02.09
카카오 API로 로그인창 만들어 봤어요~~ ^^ [6] file 컴박살 2015.02.12
300기가 Zboard4->XE 이전기 [14] file forest535 2015.02.13
snoop가 안될때 curl 로 가져오기 [3] 한꼬마 2015.02.13
데이타 이전 시 xml 파일 임포트 속도 높이기 ^^ forest535 2015.02.17
xe core 설치 화면 오류 있습니다. 이렇게 바꿔주세요. [2] 한꼬마 2015.02.18
스케치북 최신버전에서 미리 덧글 입력해두기 [5] file LI-NA 2015.02.18