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
- Code: Select all
/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
- Code: Select all
~/username/public_html
- which is in my subirectories.
well - believe it or not: i have installed my in
- Code: Select all
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 Apacbe 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 -
well - how can i do that!?
look forward to hear from you
update:
well i think there are several solutions:
the first one:
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.
well i can do this also with
gpasswd can add user to group:
- Code: Select all
# gpasswd -a USERNAME GROUP
for more information, we need to look forward the gpasswd --help or man gpasswd
To get the group of /srv/www/, either use stat /srv/www | grep Gid or ls
we should check the groups the current user has joined, and should do groups command (without sudo).
the second way:
the second way is to put our (the) user into a group that
has write permissions in /srv/www/, rather that change where the server resides.
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.
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.
well i love to hear from you - what is the easiest way - to do it - what is the best way to solve the issues.