본문 바로가기
조회 수 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 5402 2024.04.14
공지 1000P를 모으면 다이소 상품권 1000원을 신청할 수 있습니다. file Private 5386 2024.02.14
4779 일반 윈도우11 더 많은 옵션 항상사용하는 방법 😀익명584 548 2022.12.31
4778 일반 티프리카 토렌트사이트 추천한다 주소올림 😀컴덕488 261 2023.03.27
4777 일반 인터넷 창 실수로 끈거 복구하기 😀컴덕803 770 2019.02.09
4776 일반 밑에 견적문의글 file 😀컴덕306 31 2022.01.04
4775 일반 AMD가 FSR 2.0을 3월 17일에 발표? 😀익명393 209 2022.12.31
4774 일반 코로나 후유증 😀익명086 511 2022.12.31
4773 일반 주식투자와 관련된 주식명언 😀익명023 915 2016.02.22
4772 일반 결론은 이거지? 😀컴덕960 33 2022.01.08
4771 일반 스마일게이트 '테일즈런너', 새로운 승부가 시작된다..'언더월드 리그' 실시 😀컴덕후502 74 2023.03.27
4770 일반 레이드몹의 신작 RPG '루디엘' 영상 😀컴덕후989 40 2023.03.27
4769 일반 윈도우 10 ‘블랙 스크린’ 문제 해결하기 😀컴덕308 50 2023.03.27
4768 일반 윈도우 11 디펜더(Windows 보안) 비활성화 먹통 문제 해결 😀컴덕886 43 2023.03.27
4767 일반 까다롭고 예민한 코골이에게💤AI 베개 제레마 프리뷰 [4K] file 😀컴덕443 45 2023.03.27
4766 일반 이정도는 돼야 카피캣이지 😀익명641 1084 2023.03.27
4765 일반 1년반만에 포맷했습니다 😀05584658 348 2022.04.02
4764 일반 블루스크린 오류코드 해석방법 😀컴덕326 571 2023.08.31
4763 일반 맥과 윈도우를 고민하는 사람들에게 알맞는 조언 file 😀무명의컴덕475 431 2023.09.06
4762 일반 자자 선생님들 😀77511180 460 2022.05.12
4761 일반 RARBG TORRENT 운영진 투표로 셧다운. 😀익명710 409 2023.06.02
4760 일반 AMD Ryzen 5 8600G 내장그래 벤치마크 😀컴덕572 286 2024.02.07
목록
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 239 Next
/ 239