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

耗尽温柔 提交于 2019-12-11 18:05:19

问题


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). 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.

The user owner is ftp and the group owner is 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? (and of course have the permission set not higher then to 775). BTW, do I have to restart a server when adding or removing user's membership of the group?


回答1:


This should fix your problem.

ssh root@ip_address

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

You don't need to restart the server.

Optional : service apache2 reload



来源:https://stackoverflow.com/questions/32391891/how-to-set-ownership-for-apache-under-linux-centos

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!