上传/文件权限
我遇到了三个较旧的 Drupal 6 站点的问题,我似乎无法修复。
每当管理员上传或编辑文件时,他们都会收到文件权限错误。我尝试将文件夹设置为 777 -Rf。问题似乎源于这样一个事实:文件是作为 apache 而不是虚拟主机用户(我们使用 VirtualMin)创建的。
将文件文件夹 chown 和 chgrp 到虚拟主机用户后,一切正常。然后,下次上传文件时,该文件将被设置为 644 权限并归 apache 所有。
是否需要配置或指令来告诉它以具有完全权限的用户而不是 644 apache 设置文件?
用于上传的模块是核心Upload、FileField、ImageField、Imagecache和ImageAPI。 GD2用于处理图像。
I am having an issue with three older Drupal 6 sites that I can't seem to fix.
Whenever an admin uploads or edits a file, they get file permissions error. I tried setting the files folder to 777 -Rf. The problem seems to stem from the fact that files are getting created as apache instead of the virtualhost user (we use VirtualMin).
After chown and chgrp the files folder to the virtualhost user, everything works fine. Then, the next time a file is uploaded, that file is set to 644 permission and owned by apache.
Is there a configuration or directive needed to tell it to set files as the user with full permissions and not 644 apache?
The modules used to upload are the core Upload, FileField, ImageField, Imagecache and ImageAPI. GD2 is used to handle images.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将virtualhost用户和apache都添加到www-data组,并将files目录下的所有文件都放到www-data组怎么样?然后你可以将目录的权限设置为775,这样文件就可以根据需要读取。
How about adding both the virtualhost user and apache to the www-data group, and put all the files in the files directory to the www-data group? Then you can set the permissions to more like 775 on the directories, and the files will be readable as needed.