centos:无法写入whoosh索引

在这里遇到了问题。 在我的开发服务器中,当我尝试使用django / haystackwhoosh后端引擎进行search时,遇到了一个问题。

 The path to your Whoosh index '/home/foo/bar/whoosh/index' is not writable for the current user/group. 

嗯,这似乎是一个明显的权限问题,但是当我检查我的文件夹

 drwxrwxr-x 2 foodball django 4096 Apr 27 03:17 index 

这似乎是正确的,因为用户apache被添加到组django 。 我可以知道什么似乎是问题,是apache不是用户进程正在运行?

如果启用SELinux,可能会导致错误。 如果你不需要SELinux或者只是想快速testing一下是否是这个原因,试试setenforce 0 ,看看是否有帮助。 SELinux可以通过在/etc/selinux/config中将其设置为disabled来永久禁用。