2016-08-13 5 views
0

내 index.htm 파일의 이미지를 표시 할 수없는 문제가 있습니다. index.htm 파일의 내용은 다음과 같습니다 :apache 웹 서버에서 이미지를 볼 수 없습니다.

[[email protected]:/etc/httpd/conf]:cat /var/www/html/index.htm 
<!DOCTYPE html> 

<html> 
<head> 
<title>httpd server</title> 
</head> 

<body> 
<h1> 
First H1 Tag 
</h1> 
<p> My First para</p> 

<h1> Second H1 tag .</h1> 

<p>My Second Para</p> 

<a href="https://google.com.au">Google</a> 

<img src="http://192.168.1.6/lord_shiva_on_bull.jpg" alt="Shiva" width="200" height="200"> 
</body> 
</html> 
[[email protected]:/etc/httpd/conf]: 

구성에서 일부 발췌 :

ServerRoot "/etc/httpd" 
[[email protected]:/etc/httpd/conf]:ls -larth /var/www/html/lord_shiva_on_bull.jpg 
-rwxrwxrwx. 1 jim jim 165K Aug 13 11:54 /var/www/html/lord_shiva_on_bull.jpg 
[[email protected]:/etc/httpd/conf]:ls -larth /var/www/html/ 
total 172K 
-rwxrwxrwx. 1 jim jim 165K Aug 13 11:54 lord_shiva_on_bull.jpg 
drwxrwxrwx. 2 root root 6 Aug 13 12:21 src 
drwxr-xr-x. 4 root root 31 Aug 13 13:04 .. 
-rwxrwxrwx. 1 root root 323 Aug 13 13:08 index.htm 
drwxr-xr-x. 3 root root 61 Aug 13 13:08 . 
[[email protected]:/etc/httpd/conf]:ls -ld /var/www/html/ 
drwxr-xr-x. 3 root root 61 Aug 13 13:08 /var/www/html/ 
[[email protected]:/etc/httpd/conf]:id apache 
uid=48(apache) gid=48(apache) groups=48(apache) 
[[email protected]:/etc/httpd/conf]:grep "apache" httpd.conf 
# See <URL:http://httpd.apache.org/docs/2.4/> for detailed information. 
# <URL:http://httpd.apache.org/docs/2.4/mod/directives.html> 
User apache 
Group apache 
    # http://httpd.apache.org/docs/2.4/mod/core.html#options 
[[email protected]:/etc/httpd/conf]: 

나는 문제가 무엇인지에 완전히 혼란 스러워요? 크게 이러한

drwxr-XR-X와 같은 권한의 끝에서 배운 전문가의

+0

브라우저에서 이미지의 URL을 열면 어떤 오류가 발생합니까? – pistache

+0

금지됨 이 서버에서 /lord_shiva_on_bull.jpg에 액세스 할 수있는 권한이 없습니다. – learner

+0

Apache2 서버 오류 로그 ('error.log', 아마도'/ var/log/apache2')를보십시오. 또한 권한이 잘못되어 안전하지 않습니다 (다른 사람이 허용하지 않음). 파일 소유자는 동일하지 않습니다. – pistache

답변

0

도트 입력을 감사하겠습니다.

은 해당 경로가 SELinux의 관할하에 있음을 나타냅니다.

이미지 파일에 도달 할 때까지 Apache HTTPD 프로세스가 모든 경로에 대해 파일 검색 권한을 갖고 있는지 확인한 경우에도 권한 거부가 발생하면 운영 체제 로그를 검토하여 SELinux에 의한 액세스.

0

selinux 정책이 활성화되어 있는지 확인하십시오. 그렇다면 테스트를 위해 비활성화하고 테스트하십시오.

cmd : 'getenforce'를 사용하여 Linux에서 selinux의 상태를 가져올 수 있으며 'setenforce 0'을 사용하여 비활성화 할 수 있습니다.

관련 문제