본문 바로가기
조회 수 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 5377 2024.04.14
공지 1000P를 모으면 다이소 상품권 1000원을 신청할 수 있습니다. file Private 5367 2024.02.14
4779 일반 ? 페어폰? file 😀16675494 33 2022.03.03
4778 일반 ???: 핫딜 올려봐~~~ 😀컴덕205 70 2022.02.09
4777 일반 .exe 파일을 추출 하는 프로그램 😀컴덕436 466 2023.03.27
4776 일반 ‘테라’ 권도형 “싱가포르 있다”더니…현지 사무실 폐쇄 😀익명353 538 2022.12.31
4775 일반 “넷플릭스보다 디즈니+” 냉정한 美 월가, 디즈니 손든 이유 😀익명650 37 2023.03.27
4774 일반 “몸값 시한 지나면 자동 삭제”··· 랜섬웨어 ‘로키로커’가 당신을 노린다 😀익명191 507 2022.12.31
4773 일반 “몸값 시한 지나면 자동 삭제”··· 랜섬웨어 ‘로키로커’가 당신을 노린다 😀컴덕후786 37 2023.03.27
4772 일반 ㈜아이티스노우볼, 투자용 신용평가서 최상위급 'Ti-2' 등급 획득 😀컴덕후910 89 2023.03.27
4771 일반 (개발자분들을 위한 익스 호환성 태그) X-UA-Compatible Meta Tag Description and Uses: 😀컴덕435 44 2023.03.27
4770 일반 (꿀팁) 현재 핸드폰(스마트폰) 배터리수명을 체크하는 방법 😀컴덕753 1103 2023.03.27
4769 일반 (루머) 구글 픽셀 4 디자인 유출 😀익명792 1076 2023.03.27
4768 일반 (루머) 아이패드 7세대 & 아이패드 미니5 주요 스펙 😀익명827 966 2023.03.27
4767 일반 (루머)인텔 신규 제온 24C CPU는 AMD 쓰레드리퍼 24C보다 느려 file 😀익명926 1816 2023.02.07
4766 일반 (리눅스) 네트워크 경로 추적, DNS 네임서버 추적 😀컴덕147 53 2023.03.27
4765 일반 (밑에서 이어짐) 병원 실려갔음 😀컴덕후454 43 2022.02.14
4764 일반 (생방)네이버 라이브 쇼핑 준비중- 잠시 후 아래 링크에서 WD_BLACK 특판 시작합니다 σ(^○^) file 😀컴덕후307 41 2023.03.27
4763 일반 (생방으로 컴수리) 램이 귀신이 씌인거 같았요. 16기가 램이 8기가 램이랑 안붙어요 o(〒﹏〒)o file 😀컴덕042 40 2023.03.27
4762 일반 (수정)i5 11500, i7 11700K 게임 벤치마크 유출 😀컴덕후669 74 2023.03.27
4761 일반 (컴알못/모니터 관련 질문많음..) 조립pc랑 모니터 따로 사도 돼?? 😀컴덕094 33 2020.12.28
4760 일반 (타갤이벤트) 츄또갤 이벤트 홍보 와씀니다 file 😀09371661 471 2022.04.12
목록
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 239 Next
/ 239