Monday 23 April 2018

fedora - Group permissions for apache


I've run into a problem with Joomla. . . it cant create new folders through the Admin UI. It's a standard permissions error. I've been told to chmod all of the folders in the site to 777.


Is there a better way to go about this? Somebody said something about creating a group and adding myself and apache into it. Then give group access to those folders. . . or something like that.


Can anybody give me any specific steps. . . I'm not that familiar doing this from the terminal ?? Or should I just chmod everything to 777 ?



Answer




should I just chmod everything to 777?



Definitely no. This is always a security risk.


The solution is similar to the answer I gave here. Ideally, you should create a group for all "web" users, e.g. users that need write access to /var/www. This would include you, root and apache.


sudo addgroup www-users

Then, you would add yourself and apache to this group.


sudo adduser  www-users
sudo adduser apache www-users

Finally, let's modify /var/www so that the new group can fully access it:


sudo chgrp www-users /var/www
sudo chmod –R 775 /var/www
sudo chmod g+s /var/www

No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...