조회 수 131 추천 수 0 댓글 0

단축키

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

0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0
List of Articles
번호 분류 제목 글쓴이 조회 수 날짜
공지 뉴스 구글 최신 뉴스 file 덕후냥이 1452 2024.12.12
공지 일반 샤오미 BE6500 라우터 실사용 후기 (Wi-Fi 7 + 2.5G 스위치 기능까지 ㄷㄷ) 4 덕후냥이 1011 2025.06.28
공지 🚨(뉴비필독) 전체공지 & 포인트안내 20 무명의덕질 28572 2024.11.04
공지 URL만 붙여넣으면 끝! 임베드 기능 무명의덕질 22689 2025.01.21
10641 정보 `보안` 차별성 강조하는 애플…이번엔 M1 맥에 보안 최강 - 매일경제 - 매일경제 뉴스봇 726 2021.02.21
10640 일반 ? 페어폰? file 덕후냥이 63 2022.03.03
10639 일반 ???: RTX 50이 전작보다 전기를 더먹는다고..? file 덕후냥이 73 2024.09.07
10638 일반 ???: 핫딜 올려봐~~~ 덕후냥이 108 2022.02.09
10637 .2Ghz에 도달한 AMD Ryzen 7 2700X 샘플 포착 회원_88687819 126 2018.04.02
10636 일반 .Android 8.0 오레오의 신기술은 어떤것이 있을까 김말이님 81 2017.08.24
10635 일반 .Android 8.0 오레오의 신기술은 어떤것이 있을까 김말이님 94 2017.08.24
10634 .exe 파일을 추출 하는 프로그램 2 유저_58365105 487 2019.01.25
10633 일반 .exe 파일을 추출 하는 프로그램 덕후냥이 495 2023.03.27
10632 정보 'LG V30' 출시 색상 암시? LG전자, 새로운 티저 공개(영상) 잭팟 99 2017.08.23
10631 일반 '지원 종료' 윈도 서버 2003 사용 기업을 위한 2가지 조언 라이너스~ 747 2015.07.20
10630 정보 ‘180억 매출’ 용산 전자업체 (컴퓨리) 파산 file 덕후냥이 215 2024.10.21
10629 일반 ‘30TB 벽’ 깬 32TB 하드 등장…소비자용 디스크 시대 저무는 이유 덕후냥이 206 2024.10.21
10628 정보 ‘갤럭시S21’을 3만원에?…통신3사, 최대 61만원 불법 지원 - 조선비즈 뉴스봇 749 2021.03.01
10627 정보 ‘굿바이 인텔’, 애플 자체 칩셋 탑재 맥북 첫 선 - 국민일보 뉴스봇 773 2021.02.21
10626 정보 ‘도둑 시청’ 새 누누티비 문 열었다…OTT 업계 &#039;한숨&#039; 덕후냥이 445 2023.06.24
10625 정보 ‘삼성폰 언박싱’ 유튜버의 한탄 “정말 열심히 만들었는데…” [IT선빵!] - 헤럴드경제 뉴... 뉴스봇 1036 2021.03.17
10624 정보 ‘아이폰 위탁생산’ 대만 폭스콘, 전기차 생산 추진 - 동아일보 뉴스봇 735 2021.02.22
10623 정보 ‘아이폰12 15만원→갤S21 17만원’ 구매 가격 낮아진다 [IT선빵!] - 헤럴드경제 뉴스 - ... 뉴스봇 771 2021.03.17
10622 정보 ‘아이폰12’ 8천만대 공급한다는 애플... 中 만리장성 무사히 넘을까 - 조선비즈 뉴스봇 775 2021.02.21
Board Pagination Prev 1 2 3 4 5 ... 533 Next
/ 533