본문 바로가기

단축키

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 updatefile 2024.11.04 25976
공지 System URL만 붙여넣으면 끝! 임베드 기능 2025.01.21 20464
378703 이슈 무대 나오면 이글루 처럼 떡상할거 같은 키오프 수록곡 newfile 2025.06.12 1
378702 이슈 무대보면 볼수록 계속 빠져드는 아이돌.jpg newfile 2025.06.12 2
378701 메종21g 성수동에서 팝업열리네? newfile 2025.06.12 7
378700 잡담 돈안갚는 사람 심리 뭐야??? new 2025.06.12 19
378699 유머 담배 피는거로 오해 많이 받았다는 소녀시대 효연 newfile 2025.06.12 9
378698 화장품 11번가) 헤라 6월 써머 베스트 상품 기획전 33,340원~ newfile 2025.06.12 62
378697 화장품 [11번가] 미샤 썸머 페스티벌 newfile 2025.06.12 25
378696 잡담 약산성 그런건 언제쓰는거야? 1 new 2025.06.12 32
378695 피부껍데기 뜯는거 못참아 2 new 2025.06.12 27
378694 먹거리 11번가) 산루카스 아보카도 오일 1L 22,740원 newfile 2025.06.12 79
378693 잡담 에렌뒤에 초대형거인 얼굴보임😱 newfile 2025.06.12 29
378692 이제 진짜 덥다.. 1 new 2025.06.12 28
378691 유머 신나는 여고 교생 실습 첫날 newfile 2025.06.12 32
378690 유머 현재까지 멤버 4명중 3명이 리무진 서비스 출연한 키스오브라이프 2 newfile 2025.06.12 61
378689 유머 50대 동안유지 나이트루틴 공개한 김준희.jpg newfile 2025.06.12 59
378688 유머 지구촌 얼척없이 웃긴 새소리 모음ㅋㅋ newfile 2025.06.12 96
378687 생활용품 [롯데온] 네파 남녀 아르테 롱 다운자켓 (208,040원/무료) file 2025.06.12 891
378686 밤인데 잠이안온다 2025.06.12 185
378685 잡담 주술회전 애니 후기 2 2025.06.11 236
378684 이슈 솔로가수 규빈(GYUBIN) 인스타그램 업데이트 file 2025.06.11 216
378683 이슈 X:IN(엑신) - Attention seeker | 쇼챔피언 2025.06.11 256
378682 화장품 뽑아쓰는 콜라겐 마스크팩 30매 1+1 장당 352원 file 2025.06.11 1759
378681 운동 갈까말까 1 2025.06.11 245
378680 유머 시키짱, 나니가 스키?? 아나따 file 2025.06.11 274
378679 생활용품 글로우 업 틴트 6colors file 2025.06.11 303
378678 야식 뭐먹지 2025.06.11 261
378677 주말 언제와 2025.06.11 263
378676 오늘도 야근이다 1 2025.06.11 263
378675 의류 [네이버] 기능성 카라 반팔 티셔츠 8,000원 배송비 3,000원 file 2025.06.11 270
378674 와..adhd 검사받았는데 2 2025.06.11 298
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 12624 Next
/ 12624