Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Just installed FreeBSD for a Webserver, and the www directory which was created by the 'root' user can only be managed and changed while running commands under su.

I understand that I need to add the group of my normal user to the groups that control the directory, but I don't really understand how do I do it.

Thanks.

share|improve this question
    
chmod 644 -r *.* (not sure about -r) –  hjpotter92 Jul 14 '12 at 8:57

2 Answers 2

Normally you would achieve this by creating a user group

sudo addgroup writewww

add the user(s) who should have the access level to that group

sudo adduser username writewww

and then set the access premissions on the folder

sudo chown -R :writewww www
sudo chmod -R g=rwx www

(This will change the group owner of the www folder to writewww and then give the group read, write, traverse access on that folder)

If you want more control, you can user access control lists, but they're much more complicated.

Edit: That said, many Linux distributions' apache package now creates an apache group by default, so you can simply add users to that group. It would be great to see that in the Unix world.

share|improve this answer
    
do you have any docs I can read about user access control lists? –  Eran Jul 14 '12 at 14:38
    
I don't have much exprience with Freebsd though. This is the first result on google: freebsd.org/doc/handbook/fs-acl.html This is primarily a file system feature with some supports needed in the kernel, so many Linux related instructions may apply to BSD as well. –  billc.cn Jul 14 '12 at 17:18

There are at least 2 different things you can do. First of all, can you tell me under which user apache runs? Now, the first option and the most easy one is to change the directory permissions as:

chmod g+s <dirname>
chmod g+w <dirname>

Now, all you need to do is to add the user you want in the same group as the us

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.