LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-22-2009, 07:22 PM   #1
gabsik
Member
 
Registered: Dec 2005
Location: This planet
Distribution: Debian,Xubuntu
Posts: 567

Rep: Reputation: 30
Exclamation Apache different owner for different document root


Hi LQ!
I run apache on a debian lenny/sid . The main apache owner owns also the default document root of its virtual host.
I want to run an another virtualhost but its document root has to be in the HOME of a user which is not apache's owner.How do i get around this ?
Thanks !
 
Old 01-22-2009, 07:26 PM   #2
AuroraCA
Member
 
Registered: Jul 2008
Location: Northern CA USA
Distribution: Ubuntu, Slackware, Gentoo, Fedora, Red Hat, Puppy Linux
Posts: 370

Rep: Reputation: 35
DocumentRoot is an Apache directive which is placed in the VirtualHost file for the virtual host. The owner of the DocumentRoot specified needs to the the Apache user. That's just the way Apache works.
 
Old 01-22-2009, 09:53 PM   #3
sleddog
Member
 
Registered: Jan 2002
Location: Labrador, Canada
Distribution: CentOS, Debian
Posts: 182

Rep: Reputation: 35
Quote:
Originally Posted by AuroraCA View Post
DocumentRoot is an Apache directive which is placed in the VirtualHost file for the virtual host. The owner of the DocumentRoot specified needs to the the Apache user. That's just the way Apache works.
Maybe I'm misunderstanding you but, the DocumentRoot for a VirtualHost does not need to be owned by the Apache user. It needs only to be readable by the Apache user. e.g. 755 directory permissions, which gives read-access to anyone, is usually sufficient.

If the DocumentRoot is owned by the Apache user, and the directory has permissions of 700 or higher, then the directory is also writable by Apache, which may or may not be desirable.
 
Old 01-22-2009, 11:20 PM   #4
AuroraCA
Member
 
Registered: Jul 2008
Location: Northern CA USA
Distribution: Ubuntu, Slackware, Gentoo, Fedora, Red Hat, Puppy Linux
Posts: 370

Rep: Reputation: 35
Quote:
Originally Posted by sleddog View Post
Maybe I'm misunderstanding you but, the DocumentRoot for a VirtualHost does not need to be owned by the Apache user. It needs only to be readable by the Apache user. e.g. 755 directory permissions, which gives read-access to anyone, is usually sufficient.

If the DocumentRoot is owned by the Apache user, and the directory has permissions of 700 or higher, then the directory is also writable by Apache, which may or may not be desirable.
That was very sloppy wording on my part. You are correct. The Apache user only needs to be able to read the filse. This can be accomplished in numerous ways with various combinations of ownership and permissions. Your solution is the safest.

Thank you for the correction.
 
Old 01-24-2009, 05:09 AM   #5
gabsik
Member
 
Registered: Dec 2005
Location: This planet
Distribution: Debian,Xubuntu
Posts: 567

Original Poster
Rep: Reputation: 30
Wink

Thank you guys !
 
  


Reply



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 - change document root? squall14716 Linux - Software 2 01-20-2010 10:16 AM
Apache Document Root Re-Direct? carlosinfl Red Hat 1 07-09-2007 07:45 PM
altering document root for apache pbhj Linux - Server 3 09-04-2006 07:05 PM
Apache 2: won't allow document root to be changed, plus more QtCoder Linux - Networking 1 11-06-2004 04:44 PM
Document Root in Apache Hal Linux - Newbie 2 10-28-2003 06:10 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:15 PM.

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