Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This 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.


  Search this Thread
Old 11-30-2016, 05:57 PM   #1
Registered: May 2016
Location: Greenville, TX
Distribution: Kubuntu 18.04
Posts: 681

Rep: Reputation: Disabled
Apache User Permissions


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:

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.


Old 11-30-2016, 06:16 PM   #2
LQ Guru
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (current), FreeBSD, Win10, It varies
Posts: 10,045

Rep: Reputation: 2158Reputation: 2158Reputation: 2158Reputation: 2158Reputation: 2158Reputation: 2158Reputation: 2158Reputation: 2158Reputation: 2158Reputation: 2158Reputation: 2158
did you set up your server something like this, knowing that the naming convention can be changed to what ever you want?


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.
Old 12-01-2016, 07:57 PM   #3
Registered: May 2016
Location: Greenville, TX
Distribution: Kubuntu 18.04
Posts: 681

Original Poster
Rep: Reputation: Disabled

Found the issue! I deleted the VH wrappers of:

<VirtualHost *:80>

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

Marking closed!




Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
.js file with permissions 640, owned by apache user cannot be accessed thru browser secretlydead Linux - Server 2 09-20-2012 09:07 AM
apache + userdir + proper user directory permissions = ???? neocontrol Linux - Server 1 03-26-2008 11:23 AM
Apache user directories permissions Wordan Linux - Networking 9 07-14-2006 04:42 PM
Super User For Apache..!! CBQ!!! ujjwal_wadhawan Red Hat 1 03-03-2006 07:53 AM
Apache user directory permissions AMMullan Linux - Software 11 12-23-2004 02:56 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:58 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration