Problem getting Apache to follow SymLinks...

I've got a problem getting the Apache server on my Powermac to follow symbolic links. I wonder if anyone can help work out where the problem is.

On another computer (intel Mac Mini running 10.5.6) I've successfully put a symlink called "myfolder" in the /Library/Webserver/Documents folder that points to a folder on an external (FW connected) drive. The pages in the folder show up perfectly when browse to http://xxx.com/myfolder/

I've tried to do a similar thing on my Powermac. But Apache simply refuses to follow any symlinks at all. AFAIK there is nothing different on this computer to the Mac Mini (both running OS X 10.5.6). Both have default httpd.conf files (as in I've done nothing to either). And I've checked on the Powermac that the httpd.conf file contains the FollowSymLinks option in the appropriate place. And I've restarted the web server (via System Prefs / Sharing panel) several times.

Any ideas what might be stopping symlinks from being followed? I'm at wits end ... !

Thanks in advance for help.

Powermac G5 2.3 Dual, Mac OS X (10.5.6), 4.5Gbytes

Posted on Jan 27, 2009 2:50 PM

Reply
4 replies

Jan 27, 2009 3:53 PM in response to Gavin Lawrie

I've tried to do a similar thing on my Powermac. But Apache simply refuses to follow any symlinks at all


That's correct. It's the normal behavior since following symlinks can be considered a security risk.

What you need to do is add a directive to your site's configuration (in /etc/apache2/sites/) telling Apache that it should follow symlinks within a specific directory. That directive would look something like:

<Directory /path/to/your/dir>
Options +FollowSymlinks
</Directory>


This tells Apache that it's OK to follow symlinks that are in the /path/to/your/dir directory.

Jan 27, 2009 4:51 PM in response to Camelot

Thanks for the suggestion.

I understand what you are suggesting, but if you look (and read) about OS X default configuration, you'll see that the 'root' directory (normally /Library/Webserver/Documents) is set up to allow the following of symbolic links (where as user directories are not I think).

On the Mac Mini, all I did was add a symbolic link to the root of the site in the /Library/Webserver/Documents folder, and the server picked up the files in the linked directory OK. I'm just trying to do the same on the Powermac. As per original note, I've checked the httpd.conf file and it has FollowSymLinks in the options for root directory. If I add them for the user directory, Apache still won't follow symbolic links. Most perplexing!

So what is not clear is why (when the httpd.conf, and user.conf files are the same (i.e. default) on the Powermac why it is not allowing the following of symbolic links...

Any thoughts about what might cause this behaviour?

Jan 27, 2009 5:49 PM in response to Gavin Lawrie

What group is the user you are trying to symlink to on the Powermac? Perhaps the server doesnt have execute permissions. If on one computer the account is admin that would work because www is part of the admin group... on the other if its a standard account that may not work because the perms are probably username:staff. Try adding an acl to allow Administrators or chgrp it to the admin group.

Also the Userdirs as well as the Document root dont allow override so unless youre making the FollowSymlinks changes in virtualhost configurations as opposed to .htaccess they wont carry through.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Problem getting Apache to follow SymLinks...

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.