본문 바로가기
조회 수 31 추천 수 0 댓글 0

단축키

Prev이전 문서

Next다음 문서

단축키

Prev이전 문서

Next다음 문서

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
번호 분류 제목 글쓴이 조회 수 날짜
공지 덕질 공통 이용규칙 및 안내 (업데이트중+ 2024-04-13) 😀컴덕824 5330 2024.04.14
공지 1000P를 모으면 다이소 상품권 1000원을 신청할 수 있습니다. file Private 5307 2024.02.14
4773 일반 비상장 주식 몇 종목 샀는데 5 😀컴덕272 881 2016.04.16
4772 일반 형님들 도와주십쇼 (컴퓨터) 5 😀컴덕297 43 2019.02.07
4771 일반 19) 여잔데 요즘 성욕 미침 4 😀컴덕265 128 2019.02.07
4770 일반 공유기 좋은걸로 바꾸면 방이 멀어져도 잘 잡힐까? 4 😀47850325 491 2022.05.19
4769 일반 시디게임 주로 하는데 2600x vs 2700 3 😀컴덕188 34 2019.01.22
4768 일반 B450보드 라이젠 2600x업데이트 관련 3 😀컴덕193 35 2019.01.22
4767 일반 usb 메모리 수명 관련 질문입니다 3 😀익명510 4133 2023.01.24
4766 일반 파워 질문있습니다 3 😀컴덕069 26 2019.01.22
4765 일반 크롬에서 매번 각종 Active를 새로 설치하는건 해결 못하나요? 3 😀컴덕657 31 2019.01.22
4764 일반 나 혹시 사이코패스냐 3 😀컴덕042 33 2019.02.07
4763 일반 알더레이크-N N100 미니PC 베어본 가격/리뷰 떴습니다 2 file 😀익명950 1470 2023.04.04
4762 일반 노트북 CPU i5-1235U vs i5-1240P 차이 있을까요? 2 😀익명617 2935 2023.02.16
4761 일반 1070 쓰고 있는데 3dMark 점수 정상적인가요? 2 😀컴덕863 30 2019.01.22
4760 일반 컴고수님들께 질문 2 😀컴덕321 692 2024.03.15
4759 일반 갤럭시퀀텀2 누끼따기 어떻게하나요? 2 file 😀컴덕465 624 2024.01.15
4758 일반 그래픽 카드 회사 2 😀컴덕677 28 2019.01.22
4757 일반 ssd 삼성전자 vs 마이크론 2 😀컴덕112 38 2019.01.22
4756 일반 8700 vs 9700 K 질문 2 😀컴덕960 32 2019.01.22
4755 일반 제 pc가 usb 3.0 지원되는건지 알고 싶습니다 ㅠㅠ 2 😀컴덕741 25 2019.01.22
4754 일반 컴퓨터 부팅 안될때 ( 자가 테스트 방법 ) 2 😀컴덕300 31 2019.01.22
목록
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 239 Next
/ 239