WEB:本地创建目录、git推到仓库、服务器上拉取创建的目录apache无法写入


和同事使用 git 协作开发网站,我在本地创建的文件夹,通过 git 推到仓库、服务器上以 root 身份登录、并 pull 获取后,创建的目录是属于 root 的。这个时候 apache 上传文件的功能就失效了:目录无权限写入。

请输入图片描述

现在的解决方案是:每次 git pull 完成后,再执行 chown apache:apache -R files ,比较麻烦。

请问有更好的解决办法吗?

Linux 权限 git

霜月火腿肠 11 years, 6 months ago

修改文件夹为777或更换Apache的运行用户

Y杀必死Y answered 11 years, 6 months ago

Your Answer