写入权限 - 本地主机 - Mac OSX [英] Write Privileges - localhost - Mac OSX

查看:29
本文介绍了写入权限 - 本地主机 - Mac OSX的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 mac 世界的新手,刚刚设置了我的网络服务器.我使用了以下指南:https://alan.ivey.dev/posts/2011/os-x-10.7-lion-development-native-mamp-with-mysql-installer/

I'm new to the mac world and have just been setting up my webserver. I used the following guide: https://alan.ivey.dev/posts/2011/os-x-10.7-lion-development-native-mamp-with-mysql-installer/

我已经转移了我的网站和数据库,一切进展顺利.我唯一的问题是写入权限.例如,有一个需要写入的配置文件,我必须右键单击,转到获取信息",然后启用读取 &为员工和每个人写作.

I've transferred my sites and databases and everything is going pretty well. The only problem I have is with the writing permissions. For example there is a config file that needs to be written to, and I had to right click, go to Get Info then enable read & write for staff and everyone.

我无法手动检查并为每个文件/文件夹启用这些写入权限.我不需要使用 WAMP 来执行此操作,并且使开发速度更快.

I can't manually go through and enable these write privileges for every file/folder. I didn't need to do this using WAMP and made development much quicker.

所以想知道 2 种可能的解决方案:a) 将我的用户帐户添加到 localhost 的白名单中,以便 644 权限就足够了b) 递归设置写权限

So wondering about 2 possible solutions: a) add my user account to a whitelist for the localhost so that 644 privileges are sufficient b) set the write privileges recursively

推荐答案

我发现最好的解决方案是更改 apache 用户和组设置.说明可以在以下位置找到:http://paulmason.名称/项目/change-apache-user-group-in-lion-os-x

I found the best solution was to change the apache user and group settings. The instructions can be found at: http://paulmason.name/item/change-apache-user-group-in-lion-os-x

  1. 打开终端并输入

  1. Open Terminal and Enter

sudo nano /private/etc/apache2/httpd.conf

  • Find and change http.conf code from

    User _www
    Group _www
    

    User your_mac_username
    Group staff
    

    注意:对于早期版本(例如 Leopard),将人员大写为人员.您可以通过在终端中输入id"并按 Enter 来获取您的用户名和组

    Note: With earlier versions such as Leopard, capitalize staff to Staff. You can get your username and group by typing "id" and hitting enter in terminal

    重启 Apache

    sudo apachectl restart
    

  • 这篇关于写入权限 - 本地主机 - Mac OSX的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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