macos 如何在 Mac Os X 上将用户添加到 apache 组?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4424612/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to add a user to apache group on Mac Os X?
提问by mikaelrandy
I'm actually trying to run Symfony2 on my MacBook Pro (Mac OS X 10.6).
我实际上是在尝试在我的 MacBook Pro(Mac OS X 10.6)上运行 Symfony2。
When i launch my application by apache, all cache and log file are created by the _www:_www user/group. But, i already have to edit these files in the CLI, with my own user.
当我通过 apache 启动我的应用程序时,所有缓存和日志文件都是由 _www:_www 用户/组创建的。但是,我已经必须使用我自己的用户在 CLI 中编辑这些文件。
My question is : how to add my user to the _www group ?
我的问题是:如何将我的用户添加到 _www 组?
I have tried to edit the /etc/group to add my user name to _www group, restart apache : fail I have also tried to edit /etc/apache2/httpd.conf to change user and group used by Apache : complete error acces.
我尝试编辑 /etc/group 以将我的用户名添加到 _www 组,重新启动 apache :失败 我还尝试编辑 /etc/apache2/httpd.conf 以更改 Apache 使用的用户和组:完全错误访问。
Anyone have an idea ?
有人有想法吗?
回答by swisscheese
sudo dseditgroup -o edit -a your_username -t user _www
回答by Benji
I'd suggest the same as above but here's a bit more copy/paste friendly version:
我建议与上述相同,但这里有一个更易于复制/粘贴的版本:
sudo dseditgroup -o edit -a `whoami` -t user _www
回答by Raj Wilson Dsouza
I was facing the same issue just to make it global on your personal mac not production i would suggest to run this and you will never have to do chmod again
我正面临同样的问题,只是为了在您的个人 mac 而不是生产环境中使用它,我建议运行它,您将永远不必再次执行 chmod
sudo dseditgroup -o edit -a _www -t user staff
sudo dseditgroup -o edit -a _www -t user staff