Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
apache /var/www/... permissions
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
dgrant
Apprentice
Apprentice


Joined: 28 May 2003
Posts: 158
Location: Vancouver, BC, Canada

PostPosted: Sat May 22, 2004 10:48 pm    Post subject: apache /var/www/... permissions Reply with quote

What should the permissions of my /var/www/<servername>/htdocs directories be?

Apache is running as apache:apache but I also want to be able to edit the files as my normal user: "david". One idea that I've had is:

-Everything chown to david:apache
-Make apache user a member of apache group if not already
-Set write permissions for user (david in this case)
-Read permissions for apache group

So something like 750?

And how do I get new files which are created to have those permissions by default?
Back to top
View user's profile Send private message
ikaro
Advocate
Advocate


Joined: 14 Jul 2003
Posts: 2527
Location: Denmark

PostPosted: Sat May 22, 2004 11:06 pm    Post subject: Reply with quote

i guess that would work.
_________________
linux: #232767
Back to top
View user's profile Send private message
dgrant
Apprentice
Apprentice


Joined: 28 May 2003
Posts: 158
Location: Vancouver, BC, Canada

PostPosted: Sat May 22, 2004 11:21 pm    Post subject: Reply with quote

Is there any security danger there though? I'm not an expert on this type of thing.

Also, what about directory permissions? Same as files?
Back to top
View user's profile Send private message
Kope
Tux's lil' helper
Tux's lil' helper


Joined: 17 May 2004
Posts: 136

PostPosted: Sat May 22, 2004 11:32 pm    Post subject: Reply with quote

Frankly, it's a bad idea.

You don't want your production files to be owned by someone wtih a shell. You don't want apache running as a user with a shell. Bad all around.

Create a sandbox to make and test your changes in. Use 'su' to copy the changes over to the apache tree when you're happy with them.
Back to top
View user's profile Send private message
dgrant
Apprentice
Apprentice


Joined: 28 May 2003
Posts: 158
Location: Vancouver, BC, Canada

PostPosted: Sat May 22, 2004 11:35 pm    Post subject: Reply with quote

Apache wouldn't be running as a user with a shell. Apache would be running as apache:apache which is the default in /etc/apache/conf

So maybe I could keep my files in my cvs repository and then do a cvs export to the web dir when I'm ready?
Back to top
View user's profile Send private message
7dave7
n00b
n00b


Joined: 21 Sep 2003
Posts: 12

PostPosted: Sat May 22, 2004 11:54 pm    Post subject: Reply with quote

Make your user david a member of the apache group, make sure the apache group has write access to the files you want to modify (i.e. chmod 760).



Quote:
And how do I get new files which are created to have those permissions by default?


Get familiar with the umask command.

Dave
[/quote]
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum