apache 403 에러날때 > 리눅스

본문 바로가기

회원로그인

회원가입

리눅스

레드햇 apache 403 에러날때

페이지 정보

profile_image
작성자 최고관리자
댓글 0건 조회 70회 작성일 20-09-01 12:02

본문



Apache Httpd의 DocumentRoot를 기본 설정에서 변경할 경우 소유자 및 접근 권한이 적절함에도 다음과 같은 접근에러가 발생할 경우가 있다


"403 Forbidden You don't have permission to access / on this server."



경우에 따라서는 SELinux가 security context 문제로 접근을 차단해서 발생한 것일 수 있다. 


이 경우 chcon 명령을 사용해서 

새로 변경한 DocumentRoot의 하위 디렉토리 및 파일을 

Apache Httpd의 SELinux security context와 일치시켜 문제를 해결할 수 있다


> cd /var/www

[root@localhost www]# ls -alZ

합계 4

drwxr-xr-x.  4 root root system_u:object_r:httpd_sys_content_t:s0       33  8월 28 16:53 .

drwxr-xr-x. 22 root root system_u:object_r:var_t:s0                   4096  8월 28 16:53 ..

drwxr-xr-x.  2 root root system_u:object_r:httpd_sys_script_exec_t:s0    6  6월  9 05:16 cgi-bin

drwxr-xr-x.  2 root root system_u:object_r:httpd_sys_content_t:s0        6  8월 28 17:10 html


> chcon -Rv --type=httpd_sys_content_t /data/www[해당폴더]


[이 게시물은 최고관리자님에 의해 2020-09-04 15:42:15 서버에서 이동 됨]

댓글목록

등록된 댓글이 없습니다.