Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Apache-UserDir] Permissions pour certains utilisateurs Réso
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index French
View previous topic :: View next topic  
Author Message
BaNaNe
Guru
Guru


Joined: 18 May 2003
Posts: 327
Location: Vous êtes ici...

PostPosted: Sat Feb 16, 2008 10:02 am    Post subject: [Apache-UserDir] Permissions pour certains utilisateurs Réso Reply with quote

Bonjour tout le monde!
Je suis en train d'essayer de faire fonctionner le module UserDir sous Apache.

En fait, il fonctionne presque, c'est à dire, pour certains utilisateurs.
Sur mon server, j'ai certains utilisateurs qui ont leur répertoire home dans le répertoire /home (répertoire de la partition racine) et d'autres qui sont dans un répertoire d'un autre disque dur.
Par exemple, l'utilisateur jf a son home dans /home/jf. /home est un répertoire de /dev/hda1 monté dans /
Par contre, l'utilisateur test est dans /mnt/160GO/home/test. /mnt/160GO correspond à /dev/hdd1

Ce qui se passe : les utilisateurs qui sont dans /home ont leur répertoire public_html accessible via l'adresse http://monserver/~user mais pas ceux qui sont dans /mnt/160GO/...

Pour ces dernier, le server retourne une erreur 403 (Forbidden, You don't have permission to access ...).

J'en déduit que j'ai un problème de permissions quelque part et même du coté du montage du disque dur /dev/hdd puisque ca fonctionne avec les user dans /home...

Le répertoire public_html à dans tout les cas les permissions suivante : le_nom_de_l'utilisateur:users en chmod 755.
Un utilisateur qui fonctionne :
Code:

bug002 /# ls -l /home/jf/
drwxr-xr-x 2 jf users 4096 Feb 16 10:54 public_html


Un qui ne fonctionne pas :
Code:

bug002 /# ls -l /mnt/160GO/home/test/
drwxr-xr-x 3 testusers  4096 Feb 16 10:58 public_html



Voici la ligne du fstab correspondant au disque /dev/hdd:
Code:
/dev/hdd1               /mnt/160GO      ext3            rw,user,users,exec      0 0



Voilà, j'espère que quelqu'un pourra m'aider à régler ce problème!
Merci d'avance
_________________
Comme c'est à la mode de mettre la config de tous ses pc...
Desktop : Intel Q9550 + 4Go DDR2 + 640Go & 1To Sata2 + HD4870
Portable : Centrino 2ghz 1Go DDR 160GO
Server Fichier : PII 400Mhz 640SDR 200GO


Last edited by BaNaNe on Tue Feb 19, 2008 9:07 pm; edited 1 time in total
Back to top
View user's profile Send private message
DidgeriDude
Guru
Guru


Joined: 30 Jan 2005
Posts: 349

PostPosted: Sat Feb 16, 2008 10:09 am    Post subject: Reply with quote

Je pense que ta config d'Apache sur les UserDir pourrait être utile :wink:
Back to top
View user's profile Send private message
BaNaNe
Guru
Guru


Joined: 18 May 2003
Posts: 327
Location: Vous êtes ici...

PostPosted: Sat Feb 16, 2008 10:52 am    Post subject: Reply with quote

Elle doit être plus ou moins correcte vu que ça fonctionne avec certains utilisateurs.
Mais la voilà quand même ;)

/etc/apache2/modules.d/00_mod_userdir.conf
Code:

# Settings for user home directories

<IfDefine USERDIR>
<IfModule userdir_module>

# UserDir: The name of the directory that is appended onto a user's home
# directory if a ~user request is received.  Note that you must also set
# the default access control for these directories, as in the example below.
UserDir public_html

# Control access to UserDir directories.  The following is an example
# for a site where these directories are restricted to read-only.
<Directory /home/*/public_html>
        AllowOverride FileInfo AuthConfig Limit Indexes
        Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
        <Limit GET POST OPTIONS>
                Order allow,deny
                Allow from all
        </Limit>
        <LimitExcept GET POST OPTIONS>
                Order deny,allow
                Deny from all
        </LimitExcept>
</Directory>

# Suexec isn't really required to run cgi-scripts, but it's a really good
# idea if you have multiple users serving websites...
<IfDefine SUEXEC>
<IfModule suexec_module>
<Directory /home/*/public_html/cgi-bin>
        Options ExecCGI
        SetHandler cgi-script
</Directory>
</IfModule>
</IfDefine>

</IfModule>
</IfDefine>


Et j'ai aussi ceci dans /etc/conf.d/apache2 :
Code:
APACHE2_OPTS="-D DEFAULT_VHOST -D INFO -D LANGUAGE -D PHP5 -D USERDIR"


Et ceci dans le httpd.conf
Code:
<IfDefine USERDIR>
LoadModule userdir_module modules/mod_userdir.so
</IfDefine>

_________________
Comme c'est à la mode de mettre la config de tous ses pc...
Desktop : Intel Q9550 + 4Go DDR2 + 640Go & 1To Sata2 + HD4870
Portable : Centrino 2ghz 1Go DDR 160GO
Server Fichier : PII 400Mhz 640SDR 200GO
Back to top
View user's profile Send private message
adjaxio
n00b
n00b


Joined: 06 Mar 2006
Posts: 54

PostPosted: Sat Feb 16, 2008 1:43 pm    Post subject: Reply with quote

Code:
# Settings for user home directories

<IfDefine USERDIR>
<IfModule userdir_module>

# UserDir: The name of the directory that is appended onto a user's home
# directory if a ~user request is received.  Note that you must also set
# the default access control for these directories, as in the example below.
UserDir public_html

# Control access to UserDir directories.  The following is an example
# for a site where these directories are restricted to read-only.
<Directory ~/public_html>
        AllowOverride FileInfo AuthConfig Limit Indexes
        Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
        <Limit GET POST OPTIONS>
                Order allow,deny
                Allow from all
        </Limit>
        <LimitExcept GET POST OPTIONS>
                Order deny,allow
                Deny from all
        </LimitExcept>
</Directory>

# Suexec isn't really required to run cgi-scripts, but it's a really good
# idea if you have multiple users serving websites...
<IfDefine SUEXEC>
<IfModule suexec_module>
<Directory ~/public_html/cgi-bin>
        Options ExecCGI
        SetHandler cgi-script
</Directory>
</IfModule>
</IfDefine>

</IfModule>
</IfDefine>


Moi j'aurai essayer comme ceci.

AdJaXiO
Back to top
View user's profile Send private message
BaNaNe
Guru
Guru


Joined: 18 May 2003
Posts: 327
Location: Vous êtes ici...

PostPosted: Sat Feb 16, 2008 2:43 pm    Post subject: Reply with quote

Je viens de comparer ma config avec celle que tu m'as donné. Je ne vois que les deux lignes Directory qui changent.

J'ai essayé mais là, résultat est pire : j'ai un 'Forbidden' pour tout mes utilisateurs :s .
_________________
Comme c'est à la mode de mettre la config de tous ses pc...
Desktop : Intel Q9550 + 4Go DDR2 + 640Go & 1To Sata2 + HD4870
Portable : Centrino 2ghz 1Go DDR 160GO
Server Fichier : PII 400Mhz 640SDR 200GO
Back to top
View user's profile Send private message
adjaxio
n00b
n00b


Joined: 06 Mar 2006
Posts: 54

PostPosted: Sat Feb 16, 2008 3:42 pm    Post subject: Reply with quote

dsl alors je vois pas comment tu peut faire (je suis pas un pros non plus ;)
Back to top
View user's profile Send private message
DidgeriDude
Guru
Guru


Joined: 30 Jan 2005
Posts: 349

PostPosted: Sat Feb 16, 2008 4:52 pm    Post subject: Reply with quote

Je rajouterais le bloc suivant à ta config, à la suite du </Directory> :
Code:
<Directory /mnt/160GO/home/*/public_html>
        AllowOverride FileInfo AuthConfig Limit Indexes
        Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
        <Limit GET POST OPTIONS>
                Order allow,deny
                Allow from all
        </Limit>
        <LimitExcept GET POST OPTIONS>
                Order deny,allow
                Deny from all
        </LimitExcept>
</Directory>

En gros, une section <Directory ...> (...) </Directory> pour chaque endroit où tu mets tes homes (Attention, je n'ai pas dis une section par home personnel !!)
Back to top
View user's profile Send private message
DidgeriDude
Guru
Guru


Joined: 30 Jan 2005
Posts: 349

PostPosted: Tue Feb 19, 2008 7:30 pm    Post subject: Reply with quote

Euh... Ça marche mon truc ou pas ?
Back to top
View user's profile Send private message
BaNaNe
Guru
Guru


Joined: 18 May 2003
Posts: 327
Location: Vous êtes ici...

PostPosted: Tue Feb 19, 2008 7:57 pm    Post subject: Reply with quote

Oh désolé de ne plus avoir donné de nouvelles... Enfait, je n'ai pas accès à la machine pour le moment... mais j'ai bien envie d'essayer par SSH.

Je te tiens au courant ;)

EDIT: ah ben oui, ça fonctionne! Merci! C'est bizare que je doive rajouter cela. ~/public_html devrait être remplacé par le bon chemin non?
_________________
Comme c'est à la mode de mettre la config de tous ses pc...
Desktop : Intel Q9550 + 4Go DDR2 + 640Go & 1To Sata2 + HD4870
Portable : Centrino 2ghz 1Go DDR 160GO
Server Fichier : PII 400Mhz 640SDR 200GO
Back to top
View user's profile Send private message
DidgeriDude
Guru
Guru


Joined: 30 Jan 2005
Posts: 349

PostPosted: Tue Feb 19, 2008 9:16 pm    Post subject: Reply with quote

BaNaNe wrote:
EDIT: ah ben oui, ça fonctionne! Merci! C'est bizare que je doive rajouter cela. ~/public_html devrait être remplacé par le bon chemin non?

Le ~ ne doit pas avoir le même fonctionnement que l'*...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index French 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