1

Like the title said, for some reason I am getting a 403 when apache tries to follow a symlink created by the root user. For example:

This works

lrwxrwxrwx  1 repxadmin psacln    15 Jan 25 02:09 httpdocs -> assets/app/web

But this doesn't

lrwxrwxrwx  1 root root    15 Jan 25 02:09 httpdocs -> assets/app/web

Same exact files on the receiving end. Is this expected behavior or is there something I can change in my server configuration to let apache follow a "root" created symlink?

If it matters the site is on centos and running plesk.

Steven
  • 113
  • 5

2 Answers2

1

You need to look at the permissions of the target; symlink permissions are always 777.

Also check your settings for Options FollowSymlinks in those locations - perhaps the physical directories are simply configured differently.

adaptr
  • 16,479
  • 21
  • 33
  • I am linking to the same exact file so that could not be an issue, the only difference between links is the owner of the link. – Steven Jan 25 '12 at 17:57
1

This behaviour is almost certainly the result of the SymLinksIfOwnerMatch setting.

Your log will tell you. Always read server logs before posting questions.

Further reading

JdeBP
  • 3,970
  • 17
  • 17
  • It's much more likely that the target directory only allows owner or group access, which means root:root ownership denies others (including apache) read access. SymlinksIfOwnerMatch will not solve this - in fact, it will make it less likely to work ;) – adaptr Jan 25 '12 at 17:05
  • I tried adding "Options -SymLinksIfOwnerMatch" to the directory in the configuration however the error message I recive has not changed. Without that and with it the error in the logs is: Symbolic link not allowed or link target not accessible – Steven Jan 25 '12 at 18:09
  • @Steven Is there potentially another `Options` directive applying to the request? A `Location` block or an `.htaccess` file, perhaps? – Shane Madden Jan 25 '12 at 18:18