too long

I have some graphics files that exist within a directory that a web server is hosted from. I want to re-use those graphics files for another webservice.

I created a symbolic link as follows:

lrwxrwxrwx  1 root    root      51 Jun 30 03:47 gifs -> /var/www/vhosts/webservice/httpdocs/gifs

The gifs folder in question has the following permissions:

drwxr-xr-x  6 user2 psacln    4096 Jun  1 07:02 gifs

and a test file in there has this permission

-rw-r--r--  1 user1   psacln    1663 Jun 10 09:27 noimage.gif

So from the webservice I can view the file fine using http://www.windowsmobilesoft.net/gifs/noimage.gif

but if I use the webserver where the symbolic link is created I get a permission error

http://www.pocketpcsoft.net/gifs/noimage.gif

Forbidden

You don't have permission to access /gifs/noimage.gif on this server.

Apache/2.2.3 (CentOS) Server at www.pocketpcsoft.net Port 80

I added apache to the psacln group but this has not made any difference.

I suspect it's something really simple that I need to do, but I cannot think what that is, can anyone help?

Thanks,

Greg

Its more likely that your apache instance is configured not to follow symbolic links than you have a permissions problem.

See options +symlinks

Note that allowing apache to read symlinks may introduce vulnerabilities in your application - better solutions are:

  • use hard links (if the vhost doc roots will stay on the same filesystem)
  • use rewrite rules to map the image URL to the file
  • use alias to map the image URL to the file
  • just copy the damn files!

go into the gifs folder on putty, and type: chmod 0755 noimage.gif

edit: go on the folder that contains gifs folder on putty and type: chmod 0755 gifs

then go into the folder and type: chmod 0755 noimage.gif