Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 10-20-2008, 04:34 AM   #1
LQ Newbie
Registered: Oct 2008
Posts: 2

Rep: Reputation: 0
Apache server Docroot file permissions


I have an issue with file permissions, hopefully someone here will be able to help me.

Apache runs as apache:apache

user: alanp, groups: alanp
user: apache, groups: apache

I want to be able to rwx (read, write, execute) files in my docroot (/var/www) with my normal user account 'alanp'. The Apache server itself should normally only be allowed to r-x (read & execute) these files.

First, I issued a 'chown -R alanp:apache /var/www'. I am now the owner of the files and directories, and apache is the group.

I then issued a 'chmod -R 750 /var/www'. The permissions on the files are now -rwxr-x---. This means 'alanp' has +rwx and the apache group has +rx permissions.

This works great. My next problem arises however because I have a directory that allows the apache group write access for a php script that creates some flat-file logs. The permissions for this 'logs' directory are drwxrwx---. Apache is running as apache:apache, so that's how it's files get created, which means my normal user 'alanp' cannot access these files.

The only solution I can think of is to run apache as alanp:apache. Is this a suitable solution or is there anything better I could do?


Old 10-20-2008, 04:40 AM   #2
LQ Newbie
Registered: Oct 2008
Posts: 2

Original Poster
Rep: Reputation: 0
I've just been informed that suPHP may be a solution. I'm looking in to it now but it seems like a bit of a botch fix.
Old 10-20-2008, 05:58 AM   #3
Senior Member
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

Rep: Reputation: 96

You could add alanp to the apache group. Or you could create an 'apachewrite' group that has write access to whatever files, and add the apache and alanp users to that.



apache, permissions

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
Apache file permissions problem. {Apache/2.2.6 Fedora 8} hacker supreme Linux - Server 5 01-31-2008 03:26 PM
VHost tries to use apache docroot images, should not belorion Linux - Server 1 02-03-2007 04:05 PM
Apache 1.3.34 Server on Kubuntu - index.html file permissions? lefty.crupps Linux - Networking 0 09-07-2006 09:59 AM
Apache 2.0.54 DocRoot strange behaviour with VirtualHost dimsh Linux - Newbie 2 12-24-2005 03:31 AM
Fresh Load FC3 Apache err - Docroot must be directory trekk Linux - Networking 18 11-30-2004 04:48 PM > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 04:53 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration