tags:

views:

58

answers:

4

I am now creating a html webpage under $HOME/public_html on a Linux server. I want to make some pictures show up in the webpage. These pictures are stored under some different directories than $HOME/public_html, e.g. $HOME/dir1, $HOME/dir2...

I write the full paths for these picture files in the webpage and change the permission for all the directories down to the files for all to read and execute, but cannot make the pictures available in the webpage browsing from outside. What am I missing?

Note: I don't want to make copies of the files to $HOME/public_html.

A: 

You need to modify your web server config so it will access the specific directories. You could also try simlinking from public_html/pic to home/dir1 use pic/pic1.jpg as the url, and modify your config to follow simlinks.

Jared
symlinks (symbolic links)
Devin Ceartas
A: 

you almost certainly want to edit the config file of whatever web server your utilizing. Web servers are very strict about the local directories outside users have access to.

ennuikiller
A: 

Since the root of your site - http://foo.com, let's say - points to the public html directory, you won't be able to directly reference files that live outside of that directory. You can accomplish what you're trying to do using PHP or similar, but vanilla HTML won't work unless you either copy the files into a directory under public_html or create symbolic links (and configure your server to allow symlinks to be followed).

inkedmn
A: 

If you have access to httpd.conf you can add those directories under another virtual directory. If you cant you have to stick to ~/public_html. You can use links in this case. try using

ln -s ~/public_html/dir1 ~/dir1 (syntax might be wrong try man ln)
Cem Kalyoncu