본문 바로가기

Shortcut

Prev이전 문서

Next다음 문서

Shortcut

Prev이전 문서

Next다음 문서

Extra Form

Apache 2.4 이상 버전에서 403 에러가 발생. error.log 를 보니 다음과 같은 에러가 있었다.

 

[Tue Dec 11 17:49:19.350384 2012] [authz_core:error] 
[pid 5308:tid 1576] [client 127.0.0.1:53603] AH01630: 
client denied by server configuration: /DOCUMENT_ROOT

 

 


아마도 우분투를 업그레이드하면서 (2.2에서 2.4로 업그레이드) 기존에쓰던 conf 파일 옵션값이 문제를 일으킨모양이다.

 

apache 2.2

<Directory /DOCUMENT_ROOT>

   ~~~

    Order allow,deny

    Allow from all

</Directory>

 

apache 2.4 최신

<Directory /DOCUMENT_ROOT>

    ~~~

    Require all granted

</Directory>

 

 

 

 

 

 

 

 

아래는 apache 공식사이트 설명문서다.

 

https://httpd.apache.org/docs/2.4/upgrading.html

 

 

 

 

2.2 configuration:

 Order deny,allow Deny from all 

2.4 configuration:

 Require all denied 

In this example, there is no authentication and all requests are allowed.

2.2 configuration:

 Order allow,deny Allow from all 

2.4 configuration:

 Require all granted 

In the following example, there is no authentication and all hosts in the example.org domain are allowed access; all other hosts are denied access.

2.2 configuration:

 Order Deny,Allow Deny from all Allow from example.org 

2.4 configuration:

 Require host example.org 

In the following example, mixing old and new directives leads to unexpected results.

Mixing old and new directives: NOT WORKING AS EXPECTED

 DocumentRoot "/var/www/html" <Directory "/"> AllowOverride None Order deny,allow Deny from all </Directory> <Location "/server-status"> SetHandler server-status Require local </Location> access.log - GET /server-status 403 127.0.0.1 error.log - AH01797: client denied by server configuration: /var/www/html/server-status 

Why httpd denies access to servers-status even if the configuration seems to allow it? Because mod_access_compat directives take precedence over the mod_authz_host one in this configuration merge scenario.

This example conversely works as expected:

Mixing old and new directives: WORKING AS EXPECTED

 DocumentRoot "/var/www/html" <Directory "/"> AllowOverride None Require all denied </Directory> <Location "/server-status"> SetHandler server-status Order deny,allow Deny from all Allow From 127.0.0.1 </Location> access.log - GET /server-status 200 127.0.0.1 

So even if mixing configuration is still possible, please try to avoid it when upgrading: either keep old directives and then migrate to the new ones on a later stage or just migrate everything in bulk.

In many configurations with authentication, where the value of the Satisfy was the default of ALL, snippets that simply disabled host-based access control are omitted:

2.2 configuration:

 # 2.2 config that disables host-based access control and uses only authentication Order Deny,Allow Allow from all AuthType Basic AuthBasicProvider file AuthUserFile /example.com/conf/users.passwd AuthName secure Require valid-user 

2.4 configuration:

 # No replacement of disabling host-based access control needed AuthType Basic AuthBasicProvider file AuthUserFile /example.com/conf/users.passwd AuthName secure Require valid-user 

In configurations where both authentication and access control were meaningfully combined, the access control directives should be migrated. This example allows requests meeting both criteria:

2.2 configuration:

 Order allow,deny Deny from all # Satisfy ALL is the default Satisfy ALL Allow from 127.0.0.1 AuthType Basic AuthBasicProvider file AuthUserFile /example.com/conf/users.passwd AuthName secure Require valid-user 

2.4 configuration:

 AuthType Basic AuthBasicProvider file AuthUserFile /example.com/conf/users.passwd AuthName secure <RequireAll> Require valid-user Require ip 127.0.0.1 </RequireAll> 

In configurations where both authentication and access control were meaningfully combined, the access control directives should be migrated. This example allows requests meeting either criteria:

2.2 configuration:

 Order allow,deny Deny from all Satisfy any Allow from 127.0.0.1 AuthType Basic AuthBasicProvider file AuthUserFile /example.com/conf/users.passwd AuthName secure Require valid-user 

2.4 configuration:

 AuthType Basic AuthBasicProvider file AuthUserFile /example.com/conf/users.passwd AuthName secure # Implicitly <RequireAny> Require valid-user Require ip 127.0.0.1 

List of Articles
번호 분류 제목 날짜 조회 수 추천 수
공지 뉴스 구글 최신 뉴스 file 2024.12.12 2212 0
공지 🚨 “뉴비 필독! 커뮤니티 사이트 안내 & 덕질 가이드 191 2025.10.18 18709 116
공지 📢 [공모] "우리 커뮤니티 사이트, 뭐라고 부를까요?" 정체성을 찾아주세요! (1만P) 15 2026.01.17 13123 29
10679 일반 카페베네 상장 난항에 투자자 눈물 2016.02.15 818 0
10678 일반 주식, 욕심은 화를 부르고. 그 화는 고스란히 가족들에게 짜증을 부릴겁니다 2016.02.22 829 0
10677 일반 원익IPS 추천합니다 2016.02.22 708 0
10676 일반 장이 너무 안좋네요 ㅜㅜ 2016.02.22 746 0
10675 일반 주식투자와 관련된 주식명언 2016.02.22 1031 0
10674 일반 i5-6600 i5-6500 비교 1 2016.02.22 1473 0
10673 일반 크라운제과 어떻게 보시나요? 2016.02.28 480 0
10672 일반 흑자예상하며 기다린보람이 있군 2016.02.28 514 0
10671 일반 세계 주식 주요 지수 보는곳 입니다.모르시는분들을 위해 2016.02.28 668 0
10670 일반 한 2월 말쯤 총선테마가 시작될걸로 예상합니다. 2016.02.28 595 0
10669 일반 대중관계 악화로 중국에서 돈버는 기업들 급락이네요 2016.02.28 704 0
10668 일반 주식 생초보인데 알려주실수 있으신가요? 2016.02.28 532 0
10667 일반 11시정도만 잘 넘기면 될거같은데.. 2016.02.28 503 0
10666 일반 요즘 한종목에 꽂혀서 분할매수하는데요. 2016.02.28 585 0
10665 일반 본인 명의로 핸드폰 두개 개설 하면 문제 생기나요? 1 2016.03.01 1194 0
10664 일반 단말기대금 일시불납 가능한가요? 1 2016.03.05 793 0
10663 일반 노트4 배터리 공유?? 1 2016.03.05 1761 0
10662 일반 금호타이어 어떻게 보시나요? 2016.03.05 660 0
10661 일반 G5 vs S7 1 2016.03.18 645 0
10660 일반 스피커를 항상 켜 놓는데요. 노이즈??? 소리가 납니다. 1 2016.03.19 872 0
10659 일반 M2 메모리 추천 1 2016.03.19 934 0
10658 일반 모니터 단자 HDMI, DP & 오디오 관련 문의 1 2016.03.19 889 0
10657 일반 OS X El Capitan 10.11.4 다수의 취약점을 수정, Yosemite / Mavericks 용 보안 패치 2016.03.23 752 0
10656 일반 오늘 레바논전 축구중계 네이버에서 해주나요?? 2016.03.25 668 0
10655 일반 축구협회 스폰서 쉽이 유니폼 디자인보고 결정하는건가요? 2016.03.25 565 0
10654 일반 축구보는데... 2016.03.25 777 0
10653 일반 오늘 저녁 8시 한국 레바논 축구 2016.03.25 521 0
10652 일반 야구 오늘 개막하네요 ㅎㅎ 2016.04.01 554 0
10651 일반 비상장 주식 몇 종목 샀는데 5 2016.04.16 993 0
10650 일반 가장 간단한 부팅불팁 1 2016.04.18 785 0
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 356 Next
/ 356