views:

567

answers:

4

I am trying to have Apache follow a symlink to a raid array server that will contain some large data files. I have tried modifying httpd.conf to have an entry like this

Options FollowSymLinks AllowOverride all Order allow,deny Allow from all

to have Apache follow any sym link in the Sites folder.

I keep getting an error return that seems to indicate I don't have any permissions to access the files. The error is: Forbidden

You don't have permission to access /~imagine/imageLibraryTest/videoClips/imageLibraryVideos/imageLibraryVideos/Data13/0002RT-1.mov on this server.

the sys link file is the last "imageLibraryVideos" in the line with the Data13 being the sub dir on the server containing the file.

The 0002RT-1.mov file hase these permissions: -rwxrwxrwx 1 imagine staff 1138757 Sep 15 17:01 0002RT-1.mov and is in this path: cd /Volumes/ImagineProducts-1/Users/imagine/Sites/imageLibraryVideos/Data13

the link points to: lrwxr-xr-x 1 imagine staff 65 Sep 15 16:40 imageLibraryVideos -> /Volumes/ImagineProducts-1/Users/imagine/Sites/imageLibraryVideos

+1  A: 

Look in the enclosing directories. They need to be at least mode 711. (drwx--x--x)

Also, look in /var/log/apache2/error_log (Or whatever the concatenation of ServerRoot and ErrorLog is from the httpd.conf) for a possibly more-detailed error message.

Finally, ensure you restart apache after messing with httpd.conf.

Pi
A: 

This is a permissions problem where the user that your web server is running under does not have read and/or execute permissions to the necessary directories in the symbolic link path. The quick and easy way to check is to su - web-user (where web-user is the user account that the web server is running under) and then try to cd into the path and view the file. When you come across a directory that you don't have permission to enter, you'll have to change the permissions and/or ownership to make it accessible by the web server user account.

Michael Ridley
OK, I'll try that. My web-user account is www.
A: 

Thanks,

I've set the permissions to all the enclosing directories to 755
but Apache cstill cannot access the file.

+1  A: 

You should also look at bind mounts rather than symlinks - that would allow you to remount a given path at a new point. The following is an example:

mount --rbind /path/to/current/location/somewhere/else /new/mount/point

You can also edit your fstab to do this at boot:

/path/to/original /new/path bind defaults,bind 0 0
warren