레드햇 apache 403 에러날때
페이지 정보

본문
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[해당폴더]
- 이전글쉘스크립트 강좌 20.10.28
- 다음글firewall-cmd 기본명령어 20.09.01
댓글목록
등록된 댓글이 없습니다.