Apache Symbolic Link Error
Matthew Seaman
m.seaman at infracaninophile.co.uk
Thu Dec 30 05:25:04 PST 2004
Richard Collyer wrote:
> I'm trying to get apache to use users areas. If I use a dir named
> public_html in the users area then it works fine. If I try and use a sym
> link to link to another folder then it refuses to work. I get a "403
> Forbidden - You don't have permission to access /~richard/test.html on
> this server."
That's because although you've configured Apache to follow sym-links,
you haven't configured it to serve content from where you're linking
*too*. ie. Somewhere you need a
<Directory /home/httpd/vhosts/users/*/www>
...
</Directory>
section.
> I'm using the following /home/richard/public_html to point to
> /home/httpd/vhosts/users/richard/www/
>
> the sym link perms are: lrwxr-xr-x 1 richard www 37 Dec 29 19:39 public_html -> /home/httpd/vhosts/users/richard/www/
>
> the folder perms are: drwxrwx--- 2 richard www 512 Dec 29 19:10 www
>
> and the settings in my httpd.conf are:
>
> # Ive tried it with both FollowSymLinks and SymLinksIfOwnerMatch but
> both produce same response.
As others have mentioned, FollowSymLinks is not an Option you should
apply to user areas without due care and attention. In your case, if
all of your user areas are going to be under
/home/httpd/vhosts/users/${USER}/www, then configure /~user/ URLs to go
straight there:
UserDir /home/httpd/vhosts/users/*/www
See:
http://httpd.apache.org/docs/mod/mod_userdir.html#userdir
Note the importance of using
UserDir disabled root
(Or preferably disable it for all and then only enable for the specific
people that should have this capability).
Cheers,
Matthew
--
Dr Matthew J Seaman MA, D.Phil. 8 Dane Court Manor
School Rd
PGP: http://www.infracaninophile.co.uk/pgpkey Tilmanstone
Tel: +44 1304 617253 Kent, CT14 0JL UK
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 372 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20041230/e01ac980/signature.bin
More information about the freebsd-questions
mailing list