如何设置FollowSymLinks?
时间:2020-03-05 18:59:36 来源:igfitidea点击:
我试图让Apache遵循符号链接到RAID阵列服务器,该服务器将包含一些大数据文件。我试过修改httpd.conf以使其具有这样的条目
<Directory "/Users/imagine/Sites"> Options FollowSymLinks AllowOverride all Order allow,deny Allow from all </Directory>
让Apache跟随Sites文件夹中的任何符号链接。
我不断收到错误消息,似乎表明我没有访问文件的任何权限。错误是:
Forbidden You don't have permission to access /~imagine/imageLibraryTest/videoClips/imageLibraryVideos/imageLibraryVideos/Data13/0002RT-1.mov on this server.
sys链接文件是该行中的最后一个" imageLibraryVideos",其中Data13是包含该文件的服务器上的子目录。
0002RT-1.mov文件具有以下权限:
-rwxrwxrwx 1 imagine staff 1138757 Sep 15 17:01 0002RT-1.mov
并在以下路径中:
cd /Volumes/ImagineProducts-1/Users/imagine/Sites/imageLibraryVideos/Data13
链接指向:
lrwxr-xr-x 1 imagine staff 65 Sep 15 16:40 imageLibraryVideos -> /Volumes/ImagineProducts-1/Users/imagine/Sites/imageLibraryVideos
解决方案
回答
在所附目录中查找。它们必须至少为模式711. (drwx--x--x
)
另外,在" / var / log / apache2 / error_log"(或者" ServerRoot"和" ErrorLog"的串联来自" httpd.conf")中查找可能更详细的错误消息。
最后,确保在与httpd.conf
混淆之后重新启动apache。
回答
这是一个权限问题,其中Web服务器所运行的用户不具有对符号链接路径中必要目录的读取和/或者执行权限。快速简便的检查方法是" su web-user"(其中" web-user"是网络服务器正在其下运行的用户帐户),然后尝试进入路径并查看文件。当我们遇到没有输入权限的目录时,必须更改权限和/或者所有权才能使Web服务器用户帐户可以访问它。
回答
我们还应该查看绑定安装,而不是符号链接,它可以使我们在新点重新安装给定的路径。以下是一个示例:
mount --rbind /path/to/current/location/somewhere/else /new/mount/point
我们也可以编辑fstab
在启动时执行此操作:
/path/to/original /new/path bind defaults,bind 0 0