본문 바로가기
조회 수 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 일반 울트라 산 덬들아 용량이랑 색깔 뭐샀어? 😀컴덕793 4 2024.07.04
4778 일반 갤s23 산덬들 케이스 모샀오 😀컴덕735 5 2024.07.04
4777 일반 그럼 울트라 산 덬들은 무슨색삼?? 😀컴덕428 5 2024.07.04
4776 일반 구매한 덬들아 울트라 512(256업글)샀어? 1테라샀어..? 😀컴덕100 5 2024.07.04
4775 일반 이번에 갤23 바꾸는 덬들 원래 폰기종 뭐야? 😀컴덕697 5 2024.07.04
4774 일반 다들 헤드폰 뭐써? 😀컴덕813 5 2024.07.04
4773 일반 엔비디아는 RTX4천세대를 보호하기 위해 수십억 유로를 지불함. file 😀컴덕036 5 2022.01.01
4772 일반 에픽게임즈) 툼레이더 트릴로지 무료배포 ~ 1/7 01시까지 😀컴덕557 5 2022.01.01
4771 일반 새해가 밝았으니 😀컴덕181 5 2022.01.02
4770 일반 슬프다 연말인데.. 😀컴덕688 6 2022.01.01
4769 일반 새해복 많이 받으십시오~~~ 😀컴덕091 6 2022.01.02
4768 일반 아 글구 맥 무선마우스 잘됨 😀컴덕553 7 2022.01.03
4767 일반 윈도우 10 home fpp 질문입니다 😀컴덕582 7 2022.01.03
4766 일반 마우스 싼마이로 로지텍 G304 무선 괜찮나요? 😀컴덕385 7 2022.01.03
4765 일반 ddr4 시금치 램 8기가(2666) 1개 구해봅니다 😀컴덕247 7 2022.01.03
4764 일반 nvme ssd 1tb 구매희망합니다. 😀컴덕759 7 2022.01.01
4763 일반 PCIe 3.0 지원 메인보드에선 gen4 ssd 필요없겠죠? 😀컴덕024 7 2022.01.01
4762 일반 요번 컴터 업글 쓰면서 3열 짭수 첨 써봤는데 😀컴덕619 7 2022.01.01
4761 일반 코인하는 애들 내꺼 3080 안 사주노 😀컴덕841 7 2022.01.01
4760 일반 새해복 많이 받으세요 😀컴덕411 7 2022.01.01
목록
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 239 Next
/ 239