简体   繁体   English

如何在Linux(centOS)下设置Apache的所有权?

[英]How to set ownership for apache under linux (centOS)?

I want to install and use prestashop but now it only works correctly when I set permissions to 777 (I can login to the server via shell with root privileges). 我想安装和使用prestashop,但是现在它仅在将权限设置为777时才能正常工作(我可以使用root特权通过shell登录到服务器)。 While installing I get this error "recursive write permissions for apache user on..." and only works for permissions set to 777. I don't like this idea because after installation I can't even change back to 755 or 775. I also get problem partly solved when I change the user ownership to apache but then I can't do anything with my ftp client with that folder. 安装时出现此错误“ apache用户在...上的递归写入权限...”,并且仅适用于设置为777的权限。我不喜欢这个主意,因为安装后我什至无法更改回755或775。当我将用户所有权更改为apache时,也会得到部分解决的问题,但是使用该文件夹的ftp​​客户端无法执行任何操作。

The user owner is ftp and the group owner is psacln? 用户所有者是ftp,组所有者是psacln? How should I change the membership of the folders so I can work both through ftp and allow apache to do things with presta files? 我应该如何更改文件夹的成员身份,以便既可以通过ftp工作又可以让apache处理presta文件? (and of course have the permission set not higher then to 775). (当然,权限设置不得高于775)。 BTW, do I have to restart a server when adding or removing user's membership of the group? 顺便说一句,添加或删除用户的组成员身份时是否必须重新启动服务器?

This should fix your problem. 这应该可以解决您的问题。

ssh root@ip_address ssh root @ ip_address

chown -R www-data:ftp /var/www/prestashop chown -R www-data:ftp / var / www / prestashop

You don't need to restart the server. 您不需要重新启动服务器。

Optional : service apache2 reload 可选:服务apache2重新加载

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM