LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Apache User Permissions (https://www.linuxquestions.org/questions/linux-software-2/apache-user-permissions-4175594532/)

TBotNik 11-30-2016 04:57 PM

Apache User Permissions
 
All,

I have Apache2 installed on Kubuntu 14.04 on my Aspire Laptop and constantly get 403 permissions errors on all my alias directories.

I had previous problems that I posted/resolved at:

http://www.linuxquestions.org/questi...nk-4175591291/

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.

Cheers!

TBNK

BW-userx 11-30-2016 05:16 PM

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.


TBotNik 12-01-2016 06:57 PM

All,

Found the issue! I deleted the VH wrappers of:

<VirtualHost *:80>
and
</VirtualHost>

and now everything works. Don't remember how those got into my aliases.conf file, but they were the problem.

Marking closed!

Cheers!

TBNK


All times are GMT -5. The time now is 03:38 PM.