본문 바로가기

단축키

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 25964
공지 System URL만 붙여넣으면 끝! 임베드 기능 2025.01.21 20464
41 그외 일본에서 가장 인기있는 검색 엔진이 무엇인지 알아보자 2021.12.31 495
40 그외 도메인주소 Google 검색에서 오래된 콘텐츠 게시물 삭제하는 방법 2021.12.25 78
39 그외 비전공자, 문과생, 지방대 3스택의 일반인이 30일동안 코딩을 배운다면? 얼마나 성장할 수 있을까요?? 2021.03.22 1511
38 그외 회사 로고 만들어주는 사이트 2021.01.22 49
» 그외 우분투 20.04.1 설치 후 apache 에러로그 (AH01630) 해결방법 2021.01.20 131
36 그외 우분투에서 네트워크 사용량 Network I/O 확인 2021.01.19 213
35 그외 [꿀팁] 유튜브(YouTube) 채널 RSS 주소 간편하게 찾는 방법 (채널 ID 활용) 2020.12.26 81
34 그외 MySQL에서 , 데이터베이스 사이즈 확인하는 방법 2020.12.24 63
33 그외 MySQL Parameter(my.cnf) 권장 값 2020.12.24 62
32 그외 CPU사용량 100% 시스템 유휴 시간 프로세스에 대해 알아보자 2020.12.18 321
31 그외 전세계 무료백신 TOP5 순위를 알아보자. 2020.12.14 110
30 그외 PC에서 1.1.1.1 warp사용하기 2020.12.13 1895
29 그외 유튜브 동영상 다운로드 프로그램 좋은거 찾음 2020.11.16 1302
28 그외 무료 바이러스 및 악성코드 제거 프로그램 TOP 5 2020.11.09 135
27 그외 가장 빠른 무료 VPN 프로그램 Top 4 1 2020.05.27 363
26 그외 adobe 프리미어프로, 에프티이펙트, 포토샵 2019~2020버전 논스톱 설치 관련정보 2 2020.05.03 519
25 그외 Website vulnerabilities that hackers can exploit (famous sites in Korea) 2020.02.18 2478
24 그외 2019 네이버 나눔손글씨 폰트 (109종) 1 2019.10.10 447
23 그외 만족 한미 마이크로닉스 as 다녀 왔습니다. 1 2019.10.09 338
22 그외 불만 와사비 망고 TV 구매후 정확히 2년후 고장(폐기) 1 2019.10.09 377
21 그외 윈도우10 느려졌을때 확인해봐야할것들 2019.07.26 442
20 그외 통합드라이버 설치 프로그램 이지드라이버팩 EasyDrv7 2019.07.22 1649
19 그외 웹서버 이미지 압축모듈 설치, 설정 (apache) 1 2019.06.08 277
18 그외 youtube 4K 비디오 다운로드 하는 방법 (무료프로그램임돠) 2019.04.28 242
17 그외 Redirect NWD 64bit 악성프로그램 삭제하기 2019.03.27 1065
16 그외 윈도우 업데이트 청소 툴 2016.07.14 2825
15 그외 DB서버와 DATA서버를 분리하는 방법 아시는분 2016.01.20 1049
14 그외 vpn 프로그램 괜찮은거 없나요? 1 2015.07.04 1417
13 그외 동영상 추출 어떻게 하나요? ㅠㅠ 1 2015.06.17 1579
12 그외 visual basic과 ms-sql 연동방법 1 2015.06.17 759
Board Pagination Prev 1 2 Next
/ 2