Apache is not displaying images regardless of file type (jpg,png,gif). No entries in the error.log, access.log is showing no abnormalities. Permissions are correct, I am not getting "forbidden" message when trying to accessing the img url directly: "hostname.domain.domain/xxx.jpg" I just get nothing displayed, same on WINDOWS Client using multiple browsers and on Mac using multiple browsers. On local LAN the issue is the same as with remote internet connection accessing the site.
read about this similar issue for ubuntu 12.x with apache where disabling "EnableSendFile" fixes an issue similar to this but per Apache documentation this feature is disabled by default and can be enabled via the apache2.conf file.
Anyone else having this issue? This is not a production server, just wanted to learn more about web hosting on Linux/Apache platform.
I've applied the following command to just be sure its not permissions:
sudo chmod -R 755 /var
/var/www/html/ {web files hosted here}
drwxr-xr-x 13 root root 4096 Jun 11 12:06 var
drwxr-xr-x 3 root root 4096 Jun 11 12:02 www
drwxr-xr-x 3 root root 4096 Jun 11 21:50 html
user@domain:/$ ls -la /var/www/html
drwxr-xr-x 3 root root 4096 Jun 11 21:50 .
drwxr-xr-x 3 root root 4096 Jun 11 12:02 ..
-rwxr-xr-x 1 root root 70 Jun 11 21:50 1.jpg
-rwxr-xr-x 1 root root 135 Jun 10 16:25 cat.jpg
-rwxr-xr-x 1 root root 113 Jun 10 16:26 frog.jpg
-rwxr-xr-x 1 root root 5 Jun 10 16:51 frog.png
-rwxr-xr-x 1 root root 11510 Jun 9 21:10 index.html
-rwxr-xr-x 1 root root 574 Jun 11 23:34 index.php
index.php code: (Planning to add PHP code in the future)
< img src="frog.png" alt="FROG" >
Access Log:
12/Jun/2016:18:46:12 -0500] "GET /frog.png HTTP/1.1" 200 284 "http://hostname.domain/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.84 Safari/537.36"
Testing: hostname.domain/frog.png (frog.png is in /var/www/html; testing in web browser)
Error received on web browser when I remove that specific file "frog.png" from the html directory:
Not Found
The requested URL /frog.png was not found on this server.
tried the same test with frog.jpg with no success. when I put the file back in /var/www/html I no longer get the above error message, but the image does not appear either, I get a little box in the top left corner of the web page. Tested on Chrome, fireFox, IE and Safari all provided the same results.
sudo chmod -R 755 /var