[에러] (13)Permission denied: [client ...] AH00035: access to ... denied ... because search permissions are missing on a component of the path

리눅스/APACHE|2021. 11. 8. 16:23
반응형

아파치 에러 로그

[Mon Nov 08 16:04:03.287735 2021] [core:error] [pid 7206] (13)Permission denied: [client 192.168.220.104:41978] AH00035: access to /test.php denied (filesystem path '/RESTAPI/html/test.php') because search permissions are missing on a component of the path

 

디렉토리와 파일 접근 권한은 있는데 위와 같이 에러로그가 남을 경우 해결 방법입니다.

 

 

점검

/var/log/audit/audit.log 로그 파일을 열어 아래 내용이 출력되었는지 살펴봅니다.

 

type=AVC msg=audit(1636355741.333:1432): avc:  denied  { getattr } for  pid=8010 comm="httpd" path="/RESTAPI/logs/test.php" dev="sda2" ino=9568262 scontext=system_u:system_r:httpd_t:s0 tcontext=unconfined_u:object_r:default_t:s0 tclass=file permissive=0
type=SYSCALL msg=audit(1636355741.333:1432): arch=c000003e syscall=6 success=no exit=-13 a0=7ffe0fa1c170 a1=7ffe0fa1c050 a2=7ffe0fa1c050 a3=ffffff00 items=0 ppid=8007 pid=8010 auid=4294967295 uid=48 gid=48 euid=48 suid=48 fsuid=48 egid=48 sgid=48 fsgid=48 tty=(none) ses=4294967295 comm="httpd" exe="/usr/sbin/httpd" subj=system_u:system_r:httpd_t:s0 key=(null)
type=PROCTITLE msg=audit(1636355741.333:1432): proctitle=2F7573722F7362696E2F6874747064002D44464F524547524F554E44

 

 

해결

# chcon -R -t httpd_sys_content_t /RESTAPI/html

 

반응형

댓글()