Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] public_html proper chmod
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
venom
Tux's lil' helper
Tux's lil' helper


Joined: 09 Jun 2005
Posts: 110
Location: Poland

PostPosted: Wed May 31, 2006 12:48 pm    Post subject: [SOLVED] public_html proper chmod Reply with quote

Hi,

I want to have public_html directory enabled to store www sites by my system users. i tried to set it up with user called 'venom'.

In /etc/apache2/httpd.conf I have:

Quote:

<IfModule mod_userdir.c>
UserDir public_html
UserDir enabled venom
UserDir disabled root


<Directory /home/*/public_html>
AllowOverride FileInfo AuthConfig Limit Indexes
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
<Limit GET POST OPTIONS PROPFIND>
Order allow,deny
Allow from all
</Limit>
<LimitExcept GET POST OPTIONS PROPFIND>
Order deny,allow
Deny from all
</LimitExcept>
</Directory>


and in /etc/conf.d/apache2:

Quote:

APACHE2_OPTS="-D SSL -D DEFAULT_VHOST -D SSL_DEFAULT_VHOST -D PHP -D USERDIR"


so it should work. But when I'm trying to connect with 127.0.0.1/~venom/index.php i get 403 error :/
I think, that it depend on proper permissions on userdir and public_html. I dont't want to have this directory open to read by other users, so I tried to set permissions by group apache:

Quote:

# cat /etc/group |grep apache
apache:x:81:apache

# ls -l /home/venom/public_html/
total 4
-rw-r----- 1 venom apache 6 May 31 13:29 index.php
sexy venom # ls -l /home/venom/ |grep public
drw-r----- 2 venom apache 4096 May 31 13:29 public_html


but it doesn't work :/ any sugestions ?


Last edited by venom on Wed May 31, 2006 7:59 pm; edited 1 time in total
Back to top
View user's profile Send private message
magic919
Advocate
Advocate


Joined: 17 Jun 2005
Posts: 2182
Location: Berkshire, UK

PostPosted: Wed May 31, 2006 2:23 pm    Post subject: Reply with quote

On the face of it the thing should work. Can I suggest a small change

Code:

<IfModule mod_userdir.c>
UserDir public_html
UserDir disabled
UserDir enabled venom
Back to top
View user's profile Send private message
venom
Tux's lil' helper
Tux's lil' helper


Joined: 09 Jun 2005
Posts: 110
Location: Poland

PostPosted: Wed May 31, 2006 2:39 pm    Post subject: Reply with quote

Now it works:

Quote:

drwx---r-x 88 venom wheel 12288 May 31 16:35 venom
->
drwx---r-x 2 venom wheel 4096 May 31 13:29 public_html
->
-rw----r-x 1 venom wheel 24 May 31 15:31 index.php


so it should be +rx. But now, everybody can view my home directory :/

The solution, what I can imagine now is to add apache to wheel group or chgrp -R apache /home/venom.
Every of this 2 ways is stupid :/
Back to top
View user's profile Send private message
magic919
Advocate
Advocate


Joined: 17 Jun 2005
Posts: 2182
Location: Berkshire, UK

PostPosted: Wed May 31, 2006 2:51 pm    Post subject: Reply with quote

I suppose it is called public_html. Just use some auth method with Apache instead of leaving it wide open.
Back to top
View user's profile Send private message
venom
Tux's lil' helper
Tux's lil' helper


Joined: 09 Jun 2005
Posts: 110
Location: Poland

PostPosted: Wed May 31, 2006 7:59 pm    Post subject: Reply with quote

solved ;)

user's home directory should be drwx-----x
Quote:

drwx-----x 88 venom wheel 12288 May 31 21:47 venom


public_html: drwx---r-x
Quote:

drwx---r-x 2 venom wheel 4096 May 31 13:29 public_html


and it works - other users can't read files from your home, and apache can run sites from public_html ;)

thanks
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