Enterprise Infrastructure Intelligence ● Certified engineers online · Fast response guaranteed
리눅스/OS

Ubuntu Apache 403 Forbidden 에러 완전 해결 가이드

Ubuntu 서버에서 Apache 403 Forbidden 에러가 발생하는 주요 원인 3가지와 각각의 해결 방법을 정리합니다. 디렉토리 권한, SELinux, .htaccess 설정 순서로 확인하세요.

2026.07.06  ·  46회  · 

403 Forbidden 에러란?

Apache가 요청한 파일이나 디렉토리에 접근할 권한이 없을 때 반환하는 HTTP 오류입니다. 파일은 존재하지만 읽기 권한이 없거나, 디렉토리 인덱싱이 비활성화된 경우 발생합니다.

원인 1 — 파일/디렉토리 권한 문제

가장 흔한 원인입니다. Apache 실행 계정(www-data 또는 apache)이 해당 파일을 읽을 수 없는 경우입니다.

# 권한 확인
ls -la /var/www/html/

# 디렉토리: 755, 파일: 644 로 설정
chmod -R 755 /var/www/html
chmod -R 644 /var/www/html/*.php

# 소유자 변경
chown -R www-data:www-data /var/www/html

원인 2 — SELinux 보안 컨텍스트 (CentOS/RHEL)

CentOS나 RHEL 계열에서는 SELinux가 활성화된 경우 파일 권한과 별개로 접근이 차단될 수 있습니다.

# SELinux 상태 확인
sestatus

# 웹 파일에 컨텍스트 적용
restorecon -Rv /var/www/html

# 또는 일시적으로 permissive 모드로 테스트
setenforce 0

원인 3 — Apache 디렉토리 설정

Apache 설정 파일에서 해당 디렉토리의 접근을 명시적으로 허용해야 합니다.

<Directory /var/www/html>
    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>

설정 변경 후 Apache를 재시작합니다.

systemctl restart apache2   # Ubuntu
systemctl restart httpd     # CentOS
참고 출처: Ubuntu Documentation
WIKIDATA WORKSTATION
AI·렌더링에 최적화된
전문가용 워크스테이션
NVIDIA RTX GPU · 최대 192GB 메모리 · ECC 지원