I have an Apache2 server running out of /var/www.
The following HTML code loads it perfectly:
Code: Select all
<img src="img/fox_dog.png">
The only difference is that it's being generated by the script, which shouldn't actually even matter because the script doesn't process the HTML in the slightest, and merely returns it as a string to the Apache2 server, which should then process it in exactly the same way as the quick test HTML file.
Things to note:
Everyone and their grandmothers have write permissions to /var/www and /var/www/img. I've been easily able to create, destroy, and manipulate content in these directories without a hitch.
While it has been discovered that the prime working directory that the CGI script uses is just root ( '/', without the 'var/www' part), just in case that matters in the slightest for some reason once the HTML is generated and processed by Apache2, the following variations have also failed:
Code: Select all
<img src="/var/www/img/fox_dog.png">
<img src="var/www/img/fox_dog.png">
Code: Select all
<img src="img/fox_dog.png">
<img src="./img/fox_dog.png">
<img src="/var/www/img/fox_dog.png">