how to put a user into a group that has write permissions in /srv/www/

hello dear folks good evening dear linux-freaks!

well 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 seerver resides over there and i find it very tricky to install or configure it better - with a more appropiate way.

i tried seeral 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 terminal :

well after i recognized that i wanted to set up the Apacbe 2 server on the correct path:

but Robin Listas a forum user 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 -
well - how can i do that!?

look forward to hear from you

I would just chown www to an ordinary user, e.g. chown billy:users /srv/www and depending what was in www you 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 my (personal) preferred option FWIW.

On 2012-03-11 08:56, dilbertone wrote:

> but Robin Listas a forum user 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 -
> well - how can i do that!?
>
> look forward to hear from you

Well, those folders by default belong to user root, group root. If you
don’t change that, you would have to either work as user “root”, not a good
idea, or as group “root”, but only read access, not write.

You can add your user to any group; the easiest is simply using Yast
user/group editor.

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

You can also change the owner of those files and work as that user. You
cold use wwwrun, perhaps.

If what you want is access to the user published home, what I do is define
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 I
can’t use that as I don’t give access to my home user root directory.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)