본문 바로가기

단축키

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
번호 분류 제목 날짜 조회 수
공지 유머 🚨(뉴비필독) 전체공지 & 포인트안내 10 2024.11.04 26372
공지 이슈 URL만 붙여넣으면 끝! 임베드 기능 2025.01.21 20789
379876 이슈 육성재 '이제야' M/V Teaser #2 new 2025.06.19 1
379875 코미액 들어가는 덕후냥이들 이것도 한번 해봐 newfile 2025.06.19 3
379874 생활용품 1+3 체압분산 바른아치 아치패드 5,900원 무료배송 newfile 2025.06.19 17
379873 유머 7월 일본 대 지진설 newfile 2025.06.19 11
379872 아침부터 덥네 25도 new 2025.06.19 21
379871 먹거리 정관장 에브리타임 망고 플레이버 10ml 20포 (29,400원/무료) newfile 2025.06.19 26
379870 배고파ㅠㅠ new 2025.06.19 30
379869 먹거리 치즈 쫀득하게 터지는 더블치즈떡 240g 4가지맛 6팩 newfile 2025.06.19 927
379868 다른거 참아도 무진장 참기가 왜캐 어렵냐 ㅠㅠ new 2025.06.19 30
379867 유머 제과제빵이 빡치는 이유 newfile 2025.06.19 96
379866 유머 성매수남 400만명 명단 확보. newfile 2025.06.19 91
379865 유머 호주가 한해에만 실종자가 3만명인 이유... newfile 2025.06.19 88
379864 유머 성매매와 스폰의 차이점 newfile 2025.06.19 102
379863 유머 도둑은 대충 겁주면 도망감 newfile 2025.06.19 89
379862 유머 68억짜리 미 영주권 도람푸 카드 근황 newfile 2025.06.19 105
379861 유머 불판 장인 고세구님 실물 모습 newfile 2025.06.19 83
379860 유머 속보) 이스라엘, 이란 최고지도자 하메네이 지하시설 공격 개시 newfile 2025.06.19 92
379859 유머 주한미군 신병 아쎄이들에게 먹인다는 한국음식 newfile 2025.06.19 96
379858 유머 이스라엘이 계속 조르고 있다는 미국의 그것 newfile 2025.06.19 89
379857 유머 <루머> 이스라엘, 이란 가상화폐거래소 해킹 newfile 2025.06.19 93
379856 유머 속보) 미국, 이란과 48시간내 외교적 해결 성과 없다면 군사 대응 검토중 newfile 2025.06.19 80
379855 유머 남자 왁싱사한테 왁싱 받은 후기 newfile 2025.06.19 90
379854 유머 이란 테헤란 모습 newfile 2025.06.19 105
379853 유머 헬기타고 휴가간 전설의 이등병 newfile 2025.06.19 96
379852 유머 또 아시안 배우 통편집시킨 영화 감독 newfile 2025.06.19 92
379851 유머 실시간 이란 어....? 아니지....? newfile 2025.06.19 90
379850 유머 미국 공화당 "당원 83%는 이스라엘의 이란 공격을 지지한다" new 2025.06.19 87
379849 유머 [단독] '황병장' 신승호, 군 면제 확정…4년 전 십자인대 부상 newfile 2025.06.19 99
379848 유머 드디어 진실을 깨달은 중국인 newfile 2025.06.19 84
379847 유머 뉴진스 하니 아일릿에 인사 무시해 사건 판결문 newfile 2025.06.19 84
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 12663 Next
/ 12663