0

I'm trying to create my own little website on my local network. Everything works fine except for images. For some weird reason, my website can't load any images.

The root folder for HTML is /var/www/html.

/var/www/html/test.html:

<html>
<head>
  <title>test</title>
</head>
<body>
  <img src="sniky.png">
</body>
</html>

ls -l /var/www/html:

-rwxrwxrwx 1 root root   2155 Jun 18 08:57 bp.html
-rwxrwxrwx 1 root root   2296 Jun 17 23:12 filmy.html
-rwxrwxrwx 1 root root   1776 Jun 17 23:03 index.html
-rwxrwxrwx 1 root root   1886 Jun 17 23:11 info.html
-rwxrwxrwx 1 root root      1 Jun 17 22:18 serialy.html
-rwxrwxrwx 1 root root 897669 Jun 18 08:54 sniky.jpg
-rwxrwxrwx 1 root root     93 Jun 18 08:54 test.html

Apache2 config (/etc/apache2/apache2.conf):

<Directory />
        Options Indexes FollowSymLinks
        AllowOverride None
</Directory>
<Directory /var/www/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        Allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
        AllowOverride None
        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
        Order allow,deny
        Allow from all
</Directory>
2
  • Instead of ls /var/www/html could you do ls -l /var/www/html ?
    – Soren A
    Jun 18, 2018 at 9:40
  • @SorenA Edited with ls -l
    – user841570
    Jun 18, 2018 at 9:51

1 Answer 1

4

There is an error:
According to the files list given by ls, Your image file is a .jpg file, not a .png file
You may review your html code

<html>
<head>
<title>test</title>
</head>
<body>
<img src="sniky.jpg">
</body>
</html>
0

You must log in to answer this question.