trying (out of curiosity) to link a desktop image to html(Apache on Debian)
Hi.I'm trying to link a desktop image In html on a Debian machine running Apache.I can link to a copy of the image from within var/www (root folder for default website)with " <img src="Image.jpg"> but
" <img src="file:///home/username/Desktop/Image.jpg"> doesn't work.It's not a permission Issue. Is there some directive or configuration In apache that might be preventing me from linking to a directory other than /var/www ? I'm just curious as to why It's not working, I don't have a specific reason for using a directory other than var/www. |
When a user goes to a web address, they see
Code:
http://subdomain.domain/path_to_something When you stick a file:// directive, that sends them to: Code:
http://subdomain.domain/file:///home/username/Desktop/Image.jpg Code:
/var/www/file:///home/username/Desktop/Image.jpg Everything works on relative locations in Apache (or if it's absolute, it must be an absolute WEB address, not an absolute location on your filesystem). You could symlink the file into /var/www so that it will be accessible, but you can't go throwing arbitrary locations on your filesystem into html pages. If you could, it would be a MASSIVE security risk. If somebody could access Code:
http://subdomain.domain/file:///home/username/Desktop/Image.jpg Code:
http://subdomain.domain/file:///etc/passwd You can think of the Apache root like a chroot jail for web users. They can only access what's inside that directory. As far as they're concerned, that's the root of the filesystem, there are no higher level or sister directories, only files and subdirectories within /var/www/. |
That makes sense.Thanks for the Information !
|
All times are GMT -5. The time now is 09:02 AM. |