Contenu | Rechercher | Menus

Annonce

Si vous avez des soucis pour rester connecté, déconnectez-vous puis reconnectez-vous depuis ce lien en cochant la case
Me connecter automatiquement lors de mes prochaines visites.

À propos de l'équipe du forum.

#1 Le 10/09/2014, à 15:54

Eladriel

Droit apache avec webmin

Bonjour à tous, cela fait quelques mois que je me suis mis à ubuntu pour le boulot,

Je doit mettre en place un serveur de mail sur un ubuntu, et pour cela j'ai installé virtualmin/webmin, j'ai aussi acheter un nom de domaine pour faire des tests,

je rencontre des problèmes avec les droits dans le dossier /home/mondomaine/ , dedans j'ai  :
un dossier public_html qui contient
        index.html
       .htaccess (je ne sais pas si il est correctement écrit, j'ai essayé plusieurs syntaxe mais rien de concluant)
        phpmyadmin/
        roundcube/

Le problème c'est que j'ai une erreur quand je vais sur http://mondomaine/phpmyadmin

Not Found

The requested URL /phpmyadmin was not found on this server.

J'ai regarder les virtualhosts dans l'interface Webmin Servers -> ApacheWebServer   
Virtual Server    Any    80    mondomaine.fr    /home/mondomaine/public_html    Open..
Virtual Server    Any    443    mondomaine.fr    /home/mondomaine/public_html    Open..

Voici ce que j'ai dans la configuration du virtualhost pour le port 80

 ServerName mondomaine.fr
	ServerAlias www.mondomaine.fr
	ServerAlias webmail.mondomaine.fr
	ServerAlias admin.mondomaine.fr
	DocumentRoot /home/mondomaine/public_html
	ErrorLog /var/log/virtualmin/mondomaine.fr_error_log
	CustomLog /var/log/virtualmin/mondomaine.fr_access_log combined
	ScriptAlias /cgi-bin/ /home/mondomaine/cgi-bin/
	DirectoryIndex index.html index.htm index.php index.php4 index.php5
	<Directory /home/mondomaine/public_html>
	Options -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch +ExecCGI
	allow from all
	AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
	Require all granted
	AddHandler fcgid-script .php
	AddHandler fcgid-script .php5
	FCGIWrapper /home/mondomaine/fcgi-bin/php5.fcgi .php
	FCGIWrapper /home/mondomaine/fcgi-bin/php5.fcgi .php5
	</Directory>
	<Directory /home/mondomaine/cgi-bin>
	allow from all
	AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
	Require all granted
	</Directory>
	RewriteEngine on
	RewriteCond %{HTTP_HOST} =webmail.mondomaine.fr
	RewriteRule ^(.*) https://mondomaine.fr:20000/ [R]
	RewriteCond %{HTTP_HOST} =admin.mondomaine.fr
	RewriteRule ^(.*) https://mondomaine.fr:80/ [R]
	<Location /git>
	DAV on
	AuthType Basic
	AuthName mondomaine.waacot.com
	AuthUserFile /home/mondomaine/etc/git.basic.passwd
	Require valid-user
	Satisfy All
	RedirectMatch ^/git$ http://mondomaine.waacot.com/git/gitweb.cgi
	RedirectMatch ^/git/$ http://mondomaine.waacot.com/git/gitweb.cgi
	RewriteEngine off
	AddHandler cgi-script .cgi
	</Location>
	<Location /git/GeStock.git>
	Require user harmonie fred hassan emilien
	</Location>
	<Location /git/Gestock-Emilien.git>
	Require user emilien
	</Location>
	<Location /git/GeStock-Harmonie.git>
	Require user harmonie
	</Location>
	<Location /git/GeStock-Fred.git>
	Require user fred
	</Location>
	<Location /git/GeStock-Hassan.git>
	Require user 
	</Location>
	php_value memory_limit 32M
	php_value suhosin.session.encrypt Off
	RemoveHandler .php
	RemoveHandler .php5
	php_admin_value engine Off
	IPCCommTimeout 9999
	FcgidMaxRequestLen 1073741824
	<Directory "/home/mondomaine/public_html/webmail">
		allow from all
		AllowOverride FileInfo Indexes Limit Options
	</Directory>
	SuexecUserGroup #1005 #1003
RedirectMatch /cgi-bin/mailman/([^/\.]*)(.cgi)?(.*) https://mondomaine.fr:10000/virtualmin-mailman/unauthenticated/$1.cgi$3
RedirectMatch /mailman/([^/\.]*)(.cgi)?(.*) https://mondomaine.fr:10000/virtualmin-mailman/unauthenticated/$1.cgi$3
Alias /pipermail /var/lib/mailman/archives/public
VirtualDocumentRoot /home/mondomaine/public_html/phpmyadmin/

J'aimerai une explication sur la gestion des droits pour passer à travers les répertoires utilisateur, je sais que l'utilisateur apache (www-data) doit avoir le droit de passer à travers les dossiers, j'ai donc défini les droits de façon a ce qu'il soit autorisé, j'ai tout essayé 755 775 644 etc... j'ai même ajouté www-data dans le groupe de mon user en pensant que ça aller marcher mais rien non plus.

Si vous connaissez un tuto bien expliqué ou si vous vous sentez l'âme d'un professeur je suis disponible merci

Hors ligne

#2 Le 10/09/2014, à 17:05

saml34

Re : Droit apache avec webmin

essai cette commande sur le répertoire de ton site web.

sudo chown -R www-data NOM_DU_REPERTOIRE

Les droits (www-data en tant que propriétaire) vont s'étendre de manière récursive sur le répertoire.

Hors ligne

#3 Le 11/09/2014, à 08:58

Eladriel

Re : Droit apache avec webmin

Bonjour,

J'ai essayé ta commande et ça ne fonctionne pas, et en plus c'est un répertoire home d'un utilisateur c'est pas dangereux de lui interdire l'accès a son propre répertoire?Après j'ai des mailbox à configurer et elle seront dans les répertoire user...


Voila le résultat pour mondomaine.fr (pour info j'ai testé ta commande avec "sudo chown -R www-data NOM_DU_REPERTOIRE" et "sudo chown -R www-data:www-data NOM_DU_REPERTOIRE" au cas cela aurait pu changer quelques chose...

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at [no address given] to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

Et pour mondomaine.fr/phpmyadmin

Not Found

The requested URL /phpmyadmin was not found on this server.

les droits sont défini comme suit :

ls -l /home/
total 28
drwxr-xr-x   23    user1                 user1                    4096 sept. 10 15:38       user1
drwxrwxr-x  9     www-data           www-data            4096 août  27 15:24        mondomaine
drwxrwxr-x  10   sousdomaine1    sousdomaine1    4096 août  22 07:54        sousdomaine1
drwxrwxr-x  10   sousdomaine2    sousdomaine2     4096 août  20 13:24       sousdomaine2
drwxr-x---    9     sousdomaine3    sousdomaine3    4096 août  19 11:44        sousdomaine3
drwxr-xr-x   10   sousdomaine4    sousdomaine4    4096 août  20 13:24        sousdomaine4

Et les droits pour le dossier mondomaine/ sont bien descendu dans tout les sous-dossiers et fichiers...

Une autre idée?

Hors ligne