본문 바로가기

컴퓨터/노트북/인터넷

IT 컴퓨터 기기를 좋아하는 사람들의 모임방

단축키

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

컴퓨터/노트북/인터넷

IT 컴퓨터 기기를 좋아하는 사람들의 모임방

List of Articles
번호 분류 제목 조회 수 날짜
공지 뉴스 구글 최신 뉴스 file 1384 2024.12.12
공지 사랑LOVE 포인트 만렙! 도전 4606 2025.03.19
공지 🚨(뉴비필독) 전체공지 & 포인트안내 2 25843 2024.11.04
공지 URL만 붙여넣으면 끝! 임베드 기능 20425 2025.01.21
10639 일반 "갤럭시S6엣지 플러스, 3000mAh 대용량 배터리 탑재"… 왜? 1082 2015.07.20
10638 정보 # TAKIS 서버용 my.cnf... 830 2023.11.06
10637 ' 크래시 밴디쿳 4: 이츠 어바웃 타임', PS5, Xbox Series X, Switch판의 발매가 3월 12일로 결정. PC판은 금년 후반을 예정. 51 2021.02.11
10636 일반 ' 크래시 밴디쿳 4: 이츠 어바웃 타임', PS5, Xbox Series X, Switch판의 발매가 3월 12일로 결정. PC판은 금년 후반을 예정. 497 2023.03.27
10635 일반 '10배 빠른' 5G 지하철 와이파이…다음달부터 중단 1245 2023.11.24
10634 정보 '11시간 쓸 수 있다' 광고한 300만 원대 맥북 배터리 5시간이면 '아웃'...6개월째 수리도 못받아 - 소비자가 만드는 신문 786 2021.02.21
10633 정보 '5G 아이폰12'는 4종으로…애플, 제품군 다변화 나섰다 - 한겨레 749 2021.02.21
10632 일반 'LG G8 씽큐' 배터리 수명 늘어날까…3400~3500mAh 배터리 탑재 전망 191 2019.02.08
10631 일반 'LG G8 씽큐' 배터리 수명 늘어날까…3400~3500mAh 배터리 탑재 전망 1784 2023.03.27
10630 정보 'LG 롤러블폰 개발 중단 우려' 中BOE, 아이폰13 물량 공략 - 이데일리 694 2021.02.24
10629 정보 'M1 맥북 에어 vs. M1 맥북 프로' 어떤 제품을 어떤 구성으로 구매해야 할까 - ITWorld Korea 735 2021.03.06
10628 정보 'M자 탈모' 사라지는 아이폰… "갤럭시 닮아간다" - 머니S - Money S 747 2021.03.06
10627 정보 '美-中 대립' 최고조에도...中서 애플 아이폰만 유일한 성장 - 뉴데일리경제 771 2021.02.21
10626 정보 '갤럭시 vs 아이폰' 12만 LG 임직원 선택은 - IT조선 777 2021.02.21
10625 정보 '갤럭시S21 울트라' 국내모델 엑시노스2100·12GB램 탑재 69 2020.12.26
10624 정보 '국대폰' 갤럭시S21 및 아이폰12 미니 포함한 기존 기종 프로모션 진행 - 잡포스트 763 2021.02.21
10623 정보 '국대폰' 아이폰12 미니· 갤럭시S21 특가 판매 및 무료 나눔 이벤트 진행 - 에너지경제신문 751 2021.02.24
10622 정보 '국대폰' 최신 스마트폰 갤럭시S21 및 아이폰12 미니 특가 판매 프로모션 진행 - ITBizNews 775 2021.02.22
10621 정보 '국대폰', 갤럭시S21·아이폰12 특가 판매 진행 - 이투뉴스 768 2021.03.06
10620 정보 '극딜나라' 갤럭시S20, 아이폰12 PRO 35만원 이상 할인 - 아이티비즈 767 2021.03.01
10619 일반 '눈에 띄게 얇아진' Apple Watch Series 10, 결국 수면 무호흡증 감지 기능 탑재 file 137 2024.09.06
10618 일반 '모토로라폰’ LG헬로비전 통해 재상륙 544 2022.12.31
10617 일반 '모토로라폰’ LG헬로비전 통해 재상륙 1795 2023.03.27
10616 '미르4' 희귀 강화석 어디서 얻어요? 86 2021.02.03
10615 일반 '미르4' 희귀 강화석 어디서 얻어요? 404 2023.03.27
10614 정보 '배신자 삼성 무너뜨리는게 목표'…혐한에 빠진 세계 최대 제조대행 [뉴스人사이드] - 아시아경제 782 2021.03.01
10613 정보 '비트코인 인기 상당하네'...업비트, 구글·애플 앱마켓 1위 석권 734 2021.02.22
10612 정보 '빨간색이 주황색으로'…아이폰12서 '색빠짐 현상' 나타나 - 이데일리 783 2021.03.17
10611 정보 '빵집폰' 갤럭시노트10 및 갤럭시S10 5G, LG V50s ThinQ 재고정리 - 아이티비즈 718 2021.03.06
10610 일반 '신학기 시즌 시작'…유통업계 할인 大戰 - 아시아경제 53 2023.03.27
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 355 Next
/ 355