본문 바로가기

단축키

Prev이전 문서

Next다음 문서

수정 삭제

단축키

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
번호 분류 제목 날짜 조회 수
공지 안내 🚨(뉴비필독) 전체공지 & 포인트안내 8 file 2024.11.04 25984
공지 System URL만 붙여넣으면 끝! 임베드 기능 2025.01.21 20464
378944 [인케이스백팩]나는 인케이스 백팩이 탐난다. 2011.04.02 602
378943 [인케이스백팩]나는 인케이스 백팩이 탐난다. 2011.04.02 285
378942 잡담 이쁜 얼굴 만드는 미용 비법 53가지 - 얼굴 예뻐지는 법 - [피부 관리] 3 2011.04.23 612
378941 잡담 이쁜 얼굴 만드는 미용 비법 53가지 - 얼굴 예뻐지는 법 - [피부 관리] 3 2011.04.23 379
378940 유이-애프터스쿨 유이 사진모음-[유이 애프터스쿨] 2011.04.29 506
378939 유이-애프터스쿨 유이 사진모음-[유이 애프터스쿨] 2011.04.29 300
378938 컵라면 나트륨 위험-컵라면, 하루치 나트륨 권장량 훌쩍 넘겼다-[라면 나트륨] 2011.05.11 554
378937 컵라면 나트륨 위험-컵라면, 하루치 나트륨 권장량 훌쩍 넘겼다-[라면 나트륨] 2011.05.11 283
378936 잡담 줄넘기로 만성 비만에서 해방되다-출산 후 높아진 체지방률, 줄넘기로 내리다-[야간 줄넘기로 불면증 고통에서 탈출] 2011.05.15 769
378935 잡담 줄넘기로 만성 비만에서 해방되다-출산 후 높아진 체지방률, 줄넘기로 내리다-[야간 줄넘기로 불면증 고통에서 탈출] 2011.05.15 373
378934 잡담 할리우드 패셔니스타 아빠들의 스타일은? 2011.06.03 494
378933 잡담 할리우드 패셔니스타 아빠들의 스타일은? 2011.06.03 464
378932 잡담 남자들이 반하는 여자의 행동(외모 관계 거의 없음) 2011.06.14 692
378931 잡담 남자들이 반하는 여자의 행동(외모 관계 거의 없음) 2011.06.14 485
378930 잡담 [남여심리]-25세 전과 후, 여자 마음이 바뀐다 2011.07.16 473
378929 잡담 [남여심리]-25세 전과 후, 여자 마음이 바뀐다 2011.07.16 294
378928 [심리테스트]부모님 혈액형에 따른 나의 성격 "남녀 심리테스트" 1 2011.07.16 542
378927 [심리테스트]부모님 혈액형에 따른 나의 성격 "남녀 심리테스트" 1 2011.07.16 350
378926 [심리테스트] 점의 위치로 보는 성격 사주보기 2011.07.16 655
378925 [심리테스트] 점의 위치로 보는 성격 사주보기 2011.07.16 297
378924 잡담 [심리테스트]-나는 공주병일까??? 2011.07.16 332
378923 잡담 [심리테스트]-나는 공주병일까??? 2011.07.16 238
378922 잡담 [심리테스트]- 나는 공주병일까? '성격 심리테스트' 2011.07.24 779
378921 잡담 [심리테스트]- 나는 공주병일까? '성격 심리테스트' 2011.07.24 499
378920 잡담 싸이코심리테스트-소름 끼치는 싸이코패스 테스트2-[심리모음] 2011.08.04 509
378919 잡담 싸이코심리테스트-소름 끼치는 싸이코패스 테스트2-[심리모음] 2011.08.04 434
378918 잡담 ★★★★★★나도써봄 남여 문자 남남문자★★★★★★ 2011.08.06 409
378917 잡담 ★★★★★★나도써봄 남여 문자 남남문자★★★★★★ 2011.08.06 339
378916 잡담 고교생 장난... 이라는 동영상을 봤습니다... 2011.09.05 305
378915 잡담 고교생 장난... 이라는 동영상을 봤습니다... 2011.09.05 506
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 12632 Next
/ 12632