Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
but not good at finding/setting "service" user accounts because I have no idea what they think they need in the way of permissions. However I think I remember somewhere that the Apache user is "www-data" but not sure.
Distribution: Slackware (current), FreeBSD, Win10, It varies
Posts: 9,952
Rep:
did you set up your server something like this, knowing that the naming convention can be changed to what ever you want?
Code:
Using Unix Groups
Most users will want to be able to modify their content without being root.
The easiest way to achieve this is through the use of Unix Groups; you create
a group to which you add your content editing user, then you add the httpd
user to that group.
Note that this doesn't easilly extend to more than one user who needs to
edit the files, since at that point you need to set Group write on the files.
One would need to use ACL's to achive this.
For example, we have a user "alice" who needs to edit our content, stored
in /var/www/html/
First we create the content group, then we add both alice and apache to it.
# groupadd www-content
# usermod -aG www-content <user-name>
# usermod -aG www-content _apache
Now we need to set the right permissions on our files.
# chown -R alice:web-content /var/www/html
# find /var/www/html -type f -exec chmod 640 {} \;
# find /var/www/html -type d -exec chmod 750 {} \;
What we've done here is to set all files to 640, or rw-r----- and directories
to rwxr-x---. Because the group "web-content" is applied to all the files
and directories, httpd can read these files, but cannot write to them.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.