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.

I have to do some operations within my fresh installed open-suse-operating-system version 12.1

I need to put a user into a group that has write permissions in

 /srv/www/ 

why: my server resides over there and I find it very tricky to install or configure it better - with a more appropriate way.

I tried several times to get it running with

~/username/public_html
  • which is in my subirectories.

well - believe it or not: I have installed my in

srv/www

I those folders belong to root. To work as root is not so clever. You can imagine that i often get troubles with the ownership of those folders like that in command-line.

Well after I recognized that I wanted to set up the Apache 2 server on the correct path:

but a buddy told me to

that the alternative would be to put your user into a group that has write permissions in /srv/www/, rather that change where the server resides.

I like this idea - i guess that it can solve many many issues that i have with the files.

How can i do that?

look forward to hear from you

update: some additional ideas for the discussion

well i think there are several solutions:

we just could chown www to an ordinary user, e.g. chown billy:users /srv/www and depending what was in www we likely would use the -R switch. That's equivalent (in terms of Linux permissions/ownership) to moving the doc root to publc_html. The second one is just the (personal) preferred option FWIW.

What do you think - look forward to hear from you ...

generally spoken - we can say so:

Well, those folders by default belong to user root, group root. If we don't change that, we would have to either work as user "root", which is not a good idea, or as group "root", but only read access, not write.

we can add our user to any group; the easiest is simply using YAST user/group editor.

That would give us read access. To have write access we would have to change the group permissions of all files and directories there.

We can also change the owner of those files and work as that user. We cold use wwwrun, perhaps. I for one do notr liek the superuser very much i hate this...

If what we want is access to the user published home,

we could do some defining work. eg.an appropiate location for the tree outside of /home, like for example "/srv/www/home/", and there create a folder for each user owned by their respective users. By default openSUSE uses /home/user/public_html/, but we can't use that as we don't give access to our home user root directory.

What do you say?

well i love to hear from you - what is the easiest way - to do it - what is the best way to solve the issues.

share|improve this question
1  
Comment against the update, I'm not professional sysadmin, this kind of stuff maybe security related, so you may need another question for more professional answers. I personally guide my web server to a directory in my home, which almost equals chown. –  M. Gao Mar 11 '12 at 11:33
    
thx again Md Gao - great - well i am glad to read our advices –  zero Mar 11 '12 at 14:54
add comment

1 Answer

up vote 2 down vote accepted

gpasswd can add user to group:

# gpasswd -a USERNAME GROUP

for more information, looking forward the gpasswd --help or man gpasswd

To get the group of /srv/www/, either use stat /srv/www | grep Gid or ls

check the groups the current user has joined, do groups command (without sudo).

share|improve this answer
    
hello dear MD Gao many many thanks for the input. GREAT to hear that. i will try it out! –  zero Mar 11 '12 at 10:37
add comment

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.