본문 바로가기
공부방/IT기타

apache Permission denied: access to error log

by 빵끗미 2022. 8. 31.
반응형

안녕하세요 빵끗미에요

 

apache 실행하였는데도 계속해서 오류 페이지인 apache 2 test page 만 호출되고 있습니다.

원인을 파악하고자 error.log를 확인 결과 아래와 같이 오류 내용들이 보이네요

 

 

 

■오류 내용

[Wed Aug 31 15:47:02 2022] [error] [client ----------] Directory index forbidden by Options directive: 
[Wed Aug 31 15:52:54 2022] [error] [client ----------] (13) Permission denied: access to :

 

오류의 원인은 많지만 정확한 원인을 찾지 못했어요

그러던중 아래와 같은 방법을 사용하니 정상적인 페이지 호출 되는 것을 확인 하였어요

 

 

 

■오류 해결

httpd_sys_content_t 으로 설정 할 경우 HTTP 웹서버에 접근 가능하게 설정
chcon -Rv -t httpd_sys_content_t /var/www/html/web

httpd_sys_rw_content_t으로 설정 할 경우  HTTP 웹서버가 파일 저장 디렉토리 읽기 쓰기 가 가능하게 설정

chcon -Rv -t httpd_sys_rw_content_t /var/www/html/web

 

 

 

web 폴더 액세스를 거부하는 SELinux의 일반적인 원인이라고 하네요

참조 사이트에서 더 정확한 내용을 확인할 수 있어요

 

 

 

오류 해결한다고 두 시간 동안 삽질했네요ㅠ

여러분들은 삽질하지 말라고 글 올립니다

 

 

 

참조 : https://access.redhat.com/documentation/ko-kr/red_hat_enterprise_linux/7/html/selinux_users_and_administrators_guide/sect-security-enhanced_linux-working_with_selinux-selinux_contexts_labeling_files

 

4.7. SELinux 컨텍스트 - 파일 레이블 지정 Red Hat Enterprise Linux 7 | Red Hat Customer Portal

Access Red Hat’s knowledge, guidance, and support through your subscription.

access.redhat.com

 

반응형

댓글