Mac OS X 下 Apache 2 站点文件/文件夹的所有者/组/权限是否正确? [英] Correct owner/group/permissions for Apache 2 site files/folders under Mac OS X?

查看:25
本文介绍了Mac OS X 下 Apache 2 站点文件/文件夹的所有者/组/权限是否正确?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在网络上很难找到针对此问题的 Mac 专用答案,所以我希望有人能帮我解决这个问题?我在我的网站上的权限搞砸了,我不知道如何修复它们,而不只是在很明显不正确的所有内容上猛击递归 777.

It's hard to find Mac-specific answers to this question on the web, so I'm hoping someone out there can put this one to rest for me? My permissions are screwed up on my sites and I'm not sure how to fix them without just slamming a recursive 777 on everything which is quite obviously incorrect.

谢谢!

推荐答案

这是我发现的最严格和最安全的方法,正如这里对假设的 ~/my/web/root/ 的解释您的网络内容的目录:

This is the most restrictive and safest way I've found, as explained here for hypothetical ~/my/web/root/ directory for your web content:

  • 对于通向您的网络根目录的每个父目录(例如 ~/my~/my/web~/my/web/root):
    • chmod go-rwx DIR(除所有者外没有人可以访问内容)
    • chmod go+x DIR(允许包括 _www 在内的用户"输入"目录)
    • For each parent directory leading to your web root (e.g. ~/my, ~/my/web, ~/my/web/root):
      • chmod go-rwx DIR (nobody other than owner can access content)
      • chmod go+x DIR (to allow "users" including _www to "enter" the dir)

      所有其他解决方案都将文件对其他本地用户开放(他们属于staff"组,并且显然属于o"/others 组).然后,这些用户可以自由浏览和访问您的 Web 配置文件和脚本中的数据库配置、源代码或其他敏感细节(如果这些是您内容的一部分).如果这对您来说不是问题,那么请务必采用一种更简单的解决方案.

      All other solutions leave files open to other local users (who are part of the "staff" group as well as obviously being in the "o"/others group). These users may then freely browse and access DB configurations, source code, or other sensitive details in your web config files and scripts if such are part of your content. If this is not an issue for you, then by all means go with one of the simpler solutions.

      这篇关于Mac OS X 下 Apache 2 站点文件/文件夹的所有者/组/权限是否正确?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆