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 02/03/2015, à 08:30

Arnolphe

[Résolu] Pb configuration vhosts - Apache 2.2 - Graphes Munin

Bonjour,

J'ai installé Munin sur mon serveur Ubuntu 12.04 hébergé par OVH et j'ai activé ses plugins Apache. Dans un premier temps, les graphes d'Apache n'apparaissaient pas et après quelques recherches dans la doc, j'ai fini par trouver que Munin avait besoin d'avoir accès à /var/cache/munin/www/ depuis 127.0.0.1 et qu'il fallait indiquer la <location> de /server-status dans le fichier de config du vhost default. Je me suis souvenu que j'avais désactivé default (a2dissite default) de mes vhosts-enabled, j'ai donc modifié sa config en conséquence et je l'ai réactivé.

Comme prévu, les graphes d'Apache de Munin se sont mis à tracer et j'étais bien content... Mais, un problème auquel je ne m'attendais pas est apparu : un des vhosts qui sert un des noms de domaine configuré sur ce serveur pointait vers le vhost default !!! hmm

En résumé, actuellement avec le vhost default désactivé : http://ns358756.ovh.net/ pointe vers http://www.conciergeriepme.fr/ ce qui est "étrange" mais pas vraiment gênant sauf pour les plugins Apache de Munin...

Et en activant le vhost default
pour permettre à Munin de tracer les graphes du plugin Apache, j'obtiens le fonctionnement exactement inverse du précédent à savoir : http://www.conciergeriepme.fr/ pointe vers http://ns358756.ovh.net/.

Cerise sur le gâteau, les autres domaines configurés sur le serveur fonctionnent normalement avec ou sans le vhost default activé ! Bref, j'y comprends plus rien yikes. Donc si un expert en config d'Apache passe par là, son aide sera la bien venue. wink

Ci-dessous la config actuelle de mon serveur Apache :

Les liens symboliques vers les répertoires de travail :

root@ns358756:/var/www# ls -a -l
total 12
drwxr-xr-x  2 root root 4096 mars   1 20:01 .
drwxr-xr-x 14 root root 4096 févr. 28 00:33 ..
lrwxrwxrwx  1 root root   26 mai    4  2014 cgiepme -> /home/fulbert/www/cgiepme
lrwxrwxrwx  1 root root   22 nov.  10  2013 cpa -> /home/fulbert/www/cpa
lrwxrwxrwx  1 root root   22 nov.  10  2013 fea -> /home/fulbert/www/fea
lrwxrwxrwx  1 root root   22 mai    4  2014 map -> /home/fulbert/www/map
lrwxrwxrwx  1 root root   22 nov.   9  2013 ppa -> /home/fulbert/www/ppa
lrwxrwxrwx  1 root root   23 nov.   6  2013 ppa1 -> /home/fulbert/www/ppa1
-rw-r--r--  1 root root   26 mars   1 00:07 robots.txt
lrwxrwxrwx  1 root root   18 mars   1 20:01 www -> /home/fulbert/www

Les répertoires de travail :

root@ns358756:/home/fulbert/www# ls -a -l
total 40
drwxr-sr-x  8 fulbert www-data 4096 mars   1 18:05 .
drwxr-xr-x  4 fulbert fulbert 4096 mars   1 19:16 ..
drwxrwxr-x 18 fulbert www-data 4096 mai    5  2014 cgiepme
drwxrwxr-x 21 fulbert www-data 4096 juil. 23  2014 cpa
drwxrwxr-x 21 fulbert www-data 4096 juil. 23  2014 fea
-rw-r--r--  1 fulbert www-data   51 mars   1 17:59 #.htaccess
-r--r--r--  1 fulbert www-data    0 févr. 28 08:58 index.html
drwxrwxr-x 18 fulbert www-data 4096 mai    5  2014 map
dr-xr-xr-x 46 fulbert www-data 4096 nov.  11  2013 ppa
drwxr-xr-x 45 fulbert www-data 4096 févr. 28 03:15 ppa1
-r--r--r--  1 fulbert www-data   28 mars   1 00:04 robots.txt

Les sites-enabled :

root@ns358756:/etc/apache2/sites-enabled# ls -a -l
total 8
drwxr-xr-x 2 root root 4096 mars   2 06:04 .
drwxr-xr-x 7 root root 4096 févr. 28 00:54 ..
lrwxrwxrwx 1 root root   41 mars   2 05:57 www.conciergeriepme.fr -> ../sites-available/www.conciergeriepme.fr
lrwxrwxrwx 1 root root   51 nov.  10  2013 www.coursparticulierallemand.com -> ../sites-available/www.coursparticulierallemand.com
lrwxrwxrwx 1 root root   46 nov.  10  2013 www.formationenallemand.com -> ../sites-available/www.formationenallemand.com
lrwxrwxrwx 1 root root   50 mai    4  2014 www.monassistantepersonnelle.fr -> ../sites-available/www.monassistantepersonnelle.fr
lrwxrwxrwx 1 root root   50 nov.   9  2013 www.profparticulierallemand.com -> ../sites-available/www.profparticulierallemand.com

Le fichier de config du vhost www.conciergeriepme.fr :

<VirtualHost *:80>
        ServerAdmin webmaster@concergieriepme.fr
        ServerName  www.concergieriepme.fr
        ServerAlias concergieriepme.fr

        DocumentRoot /var/www/cgiepme
        <Directory />
                Options FollowSymLinks
                AllowOverride All
        </Directory>
        <Directory /var/www/cgiepme>
                Options -Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order Allow,Deny
                Allow from all
        </Directory>

        ## ZONE CGIEPME
        Alias /cgiepme /home/fulbert/www/cgiepme
        <Directory /home/fulbert/www/cgiepme>
                Options -Indexes +FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                Allow from all
        </Directory>


        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>

        ErrorLog /var/log/apache2/concergieriepme.fr-error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog /var/log/apache2/concergieriepme.fr-access.log combined

        Alias /doc/ "/usr/share/doc/"
        <Directory "/usr/share/doc/">
                Options Indexes MultiViews FollowSymLinks
                AllowOverride None
                Order deny,allow
                Deny from all
                Allow from 127.0.0.0/255.0.0.0 ::1/128
        </Directory>

</VirtualHost>

Le fichier de config du vhost default :

<VirtualHost *:80>
        ServerAdmin webmaster@localhost
        ServerName ns358756.ovh.net

        DocumentRoot /var/www
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/www/>
        ErrorDocument 403 "http://ns358756.ovh.net/www/"
        Options -Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order Deny,Allow
        Deny from all
        Allow from 127.0.0.1            # local
        Allow from [Mon IP Freebox]
        </Directory>

        ## ZONE PUBLIQUE
        ErrorDocument 403 "http://ns358756.ovh.net/www/"
        Alias /www /home/fulbert/www
        <Directory /home/fulbert/www>
        Options -Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        Allow from all
        </Directory>

        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog ${APACHE_LOG_DIR}/access.log combined

    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>

        <Location /server-status>
                SetHandler server-status
                Order deny,allow
                Deny from all
                Allow from localhost ip6-localhost
                Allow from 127.0.0.1
                Allow from [Mon IP Freebox]
        </Location>

</VirtualHost>

Dernière modification par Arnolphe (Le 03/03/2015, à 18:24)

Hors ligne

#2 Le 02/03/2015, à 21:15

tiramiseb

Re : [Résolu] Pb configuration vhosts - Apache 2.2 - Graphes Munin

Salut,

Ton problème est dans le fichier /etc/apache2/sites-enabled/www.conciergeriepme.fr : tu as fait une faute de frappe à la ligne suivante :

         ServerName  www.concergieriepme.fr

Hors ligne

#3 Le 03/03/2015, à 09:25

Arnolphe

Re : [Résolu] Pb configuration vhosts - Apache 2.2 - Graphes Munin

Ah mais quel boulet je fais ! Je l'ai eu sous le nez 150 fois minimum et je ne voyais rien... roll Un grand merci à tiramiseb pour cette relecture attentive ! smile

Hors ligne