Canedje
Posts: 265
Joined: Thu Mar 26, 2015 7:18 am

Unable to show .png from other directory then /var/www

Fri Apr 03, 2015 7:53 pm

I do have two raspberri's connected by a Mount
The mount directory is: /mnt/PI
I did make a subdirectory : rrdtemp
So the total directory will be /mnt/PI/rrdtemp

In shell I can read and approach or copy files from the directory mentioned above to a local dir

I try to show the pictures from this directory on a website.
I'm not able to do so.
I'm using this HTML command

Code: Select all

    <img src="/mnt/PI/rrdtemp/tmonthly.png" />n
I also tried:

Code: Select all

<img src="../../mnt/PI/rrdtemp/tmonthly.png" />
No result

If I move the directory manually to the local /var/www/rrtemp by shell
and change the HTML code in:

Code: Select all

   <img src="/rrdtemp/tmonthly.png" />
The picture is showing

So I can only show pictures from the directory /var/www and lower.
Not from a directory anywhere else
How can I read the pictures straight from the mount or other directory in the html code?

User avatar
rpdom
Posts: 17173
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Unable to show .png from other directory then /var/www

Fri Apr 03, 2015 8:21 pm

Links are relative to the DocumentRoot, not the filesystem of the computer,

You can add other locations. Assuming you are using apache you can add an alias statement to the apache config file

Code: Select all

Alias /rrdtemp /mnt/PI/rrdtemp
then restart/reload apache and use

Code: Select all

<img src="/rrdtemp/tmonthly.png" />
Now /mnt/PI/rrdtemp will appear as /rrdtemp on your website.

Canedje
Posts: 265
Joined: Thu Mar 26, 2015 7:18 am

Re: Unable to show .png from other directory then /var/www

Fri Apr 03, 2015 8:59 pm

Thanks a lot
It worked!

Return to “Troubleshooting”