본문 바로가기

단축키

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 유머     [이벤트] 증권플러스에서 공짜 비트코인 받기 file 2024.10.17 519
378943 유머     [이벤트] 증권플러스에서 공짜 비트코인 받기 file 2024.10.17 1686
378942 SNS   왕이보는 새로운 장을 탐험하기 위해 동굴 속으로 들어갑니다 2024.09.19 71
378941 ​ 지금은 지수예측이 무의미한 시기인듯.... ​ 시장은 강하다~~~!! ​ 2023.06.16 339
378940 유머  [이벤트] 증권플러스에서 공짜 비트코인 받기 file 2024.10.14 73
378939 Video📽  [입덕직캠] TXT 연준 직캠 4K 'Chasing That Feeling' (TXT YEONJUN FanCam 2023.10.19 file 2023.10.22 2323
378938  "남자 나이 33살이면 아저씨인가요?" 여초 반응 file 2024.02.09 273
378937  "외국인이죠?" 물어 보는 일본 식당 file 2024.05.12 32
378936 데이터  #슈퍼그럼요 응원법 💖 #우정! 힘들땐 어깨를 빌려줄게💖 2022.01.08 250
378935 사진  230504 MCD 공트 file 2023.05.05 365
378934  50년만에 국내 판매 중단되는 음료수. file 2022.06.17 831
378933 정보  NCT 해찬, 튀르키예·시리아 지진 복구 1억원 기부 "마음 아팠다"[공식] 2023.02.17 1783
378932 잡담  우리 영원한 막둥이 지헌아,헌이가 항상 플로버에게 보여주는 밝고 예쁜 모습들 file 2024.04.17 302
378931  이선균, 드리워진 어둠의 그림자 file 2023.10.28 1782
378930  인도네시아에서 인기라는 결혼식 file 2021.04.20 39
378929 `똥꼬빤다`의 유래 ㄷ..JPG file 2023.10.31 965
378928 `똥꼬빤다`의 유래.JPG file 2023.10.31 750
378927 잡담 `보안` 차별성 강조하는 애플…이번엔 M1 맥에 보안 최강 - 매일경제 - 매일경제 2023.03.27 80
378926 정보 `보안` 차별성 강조하는 애플…이번엔 M1 맥에 보안 최강 - 매일경제 - 매일경제 2021.02.21 726
378925 `여친, 부인 유흥업소 경력 확인해준다`...`X녀탐정` 다시 성행 file 2022.08.03 1081
378924 `원정유흥`다니는 2030... ??? file 2021.07.14 43
378923 `진짜`들의 단톡방에 들어간 평범한 오타쿠.jpg file 2022.04.07 356
378922 `청소` 남자 직원만 하는 건 부당해` vs `오랜 관행인데 어쩌라고` file 2023.08.26 542
378921 SNS ^^ 2023.07.31 332
378920 ^^ 1 2022.08.04 818
378919 잡담 ^^ 2022.01.19 38
378918 잡담 ^^7 file 2021.10.17 137
378917 ^_______^ 2023.07.08 23
378916 ^_______^ 2023.07.08 106
378915 데이터 ^웃음 히어로^ 'YENA(최예나)'의 'SMILEY (Feat. BIBI)' @220127 엠카운트다운 2022.01.27 41
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 12632 Next
/ 12632