Koozali.org: home of the SME Server

Symbolic links in web folder?

big_gie

Symbolic links in web folder?
« on: October 21, 2004, 04:34:07 PM »
Hi,

I'd like to put a symbolic link accessible from the web that points somewhere else on the hd.

For example, in this directory, publicly avaible:
/home/e-smith/files/ibays/<ibai name>/html/<folder>/
I'd like to put a symbolic link subfolder so:
/home/e-smith/files/ibays/<ibai name>/html/<folder>/<subfolder> points to /home/e-smith/files/users/<user>/<subfolder>/

I've created the symbolic link like this:
ln -s /home/e-smith/files/users/<user>/<subfolder>/ /home/e-smith/files/ibays/<ibai name>/html/<folder>/<subfolder>

But when accessing the site, I can see the <subfolder> but when clicking on it apache tells me:
Forbidden
You don't have permission to access /<name>/<symbolic name> on this server.

Is it possible to do this?

Thank you.

Buddha_Joe

Symbolic links in web folder?
« Reply #1 on: October 24, 2004, 04:54:38 AM »
I want to warn you now I'm new to linux and SME.

Have you checked the permissions on the link and target directory in question?

I know that httpd is running as user www. You may need to adjust the file permissions so that the www user has access to the target folder in question. Just a shot in the dark.. hope it helps

Offline NickR

  • *
  • 283
  • +0/-0
    • http://www.witzendcs.co.uk/
Symbolic links in web folder?
« Reply #2 on: October 24, 2004, 10:06:23 AM »
It is possible to do it, but not recommended as it compromises security. Be aware of this before proceeding! You'll need to create a custom httpd.conf template fragment in the appropriate place - I would suggest only doing it in a directory that absolutely needs it.

The directive you need goes in the options section & is

FollowSymLinks

There is also

SymLinksIfOwnerMatch

which will require the owner of the file to be admin/root
--
Nick......

big_gie

Symbolic links in web folder?
« Reply #3 on: October 25, 2004, 11:50:25 AM »
Thanx.

When you say "put a template in the right directory", what is this right directory?

thanx

Offline NickR

  • *
  • 283
  • +0/-0
    • http://www.witzendcs.co.uk/
Symbolic links in web folder?
« Reply #4 on: October 25, 2004, 12:06:20 PM »
Have a read of the template howto  http://www.e-smith.org/docs/papers/templates.html
--
Nick......