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 17/03/2018, à 16:40

RolandG

Pourquoi mes hôtes vituels ne fonctionnent-ils plus ?

Bonjour,

J'ai installé sur mon lamp 3 hôtes virtuels qui fonctionnaient parfaitement jusqu'à cette nuit.

Ce matin,
tout appel en localhost/xxx.dev ou 127.0.0.1/xxx.dev m'envoie une erreur 404,
tout appel en www.xxx.dev  ou http://xxx.dev ou http://www.xxx.dev donne une erreur du navigateur "page introuvable" avec, dans la barre d'adresse "https://xxx.dev" par le jeux des recherches successives d'apache.

les trois VH paraissent correctement déclarés dans /etc/hosts :

127.0.0.1    www.speedytools.dev
127.0.0.1    www.outilsdurouteur.dev
127.0.0.1    www.noticedevote.dev
127.0.0.1	localhost
127.0.1.1	roland-TMP645-M

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

Les trois fichiers .conf des VH semblent correctement présents dans /etc/apache2/sites-available :

ls -al /etc/apache2/sites-available
total 32
drwxr-xr-x 2 root root 4096 mars  17 14:59 .
drwxr-xr-x 8 root root 4096 mars  11 22:28 ..
-rw-r--r-- 1 root root 1332 juil. 27  2017 000-default.conf
-rw-r--r-- 1 root root 6338 juil. 27  2017 default-ssl.conf
-rw-r--r-- 1 root root  397 mars  17 14:59 noticedevote.dev.conf
-rw-r--r-- 1 root root  406 mars  11 22:35 outilsdurouteur.dev.conf
-rw-r--r-- 1 root root  386 mars  16 23:22 speedytools.dev.conf

les trois fichiers .conf ne présente pas de variation par rapport à leur création (par le même script) :

cat /etc/apache2/sites-available/noticedevote.dev.conf<VirtualHost *:80>
        DocumentRoot /home/roland/www-dev/noticedevote.dev/
        ServerName noticedevote.dev
        ServerAlias www.noticedevote.dev
	ErrorLog /home/roland/www-dev/noticedevote.dev/error.log.txt
        <Directory /home/roland/www-dev/noticedevote.dev/>
		Options SymLinksIfOwnerMatch
		AuthType Basic
		AllowOverride all
		Require local
        </Directory>
</VirtualHost>

(les trois sont semblables)

les trois liens sont bien présents dans /etc/apache2/sites-enabled :

ls -al /etc/apache2/sites-enabled
total 8
drwxr-xr-x 2 root root 4096 mars  16 23:22 .
drwxr-xr-x 8 root root 4096 mars  11 22:28 ..
lrwxrwxrwx 1 root root   35 mars  11 22:28 000-default.conf -> ../sites-available/000-default.conf
lrwxrwxrwx 1 root root   40 mars  11 22:34 noticedevote.dev.conf -> ../sites-available/noticedevote.dev.conf
lrwxrwxrwx 1 root root   43 mars  11 22:35 outilsdurouteur.dev.conf -> ../sites-available/outilsdurouteur.dev.conf
lrwxrwxrwx 1 root root   39 mars  16 23:22 speedytools.dev.conf -> ../sites-available/speedytools.dev.conf

le fichier error.log d'apache (/var/log/apache2) ne présente rien de particulier :

cat /var/log/apache2/error.log
[Sat Mar 17 00:06:30.123800 2018] [mpm_prefork:notice] [pid 4503] AH00163: Apache/2.4.27 (Ubuntu) configured -- resuming normal operations
[Sat Mar 17 00:06:30.123833 2018] [core:notice] [pid 4503] AH00094: Command line: '/usr/sbin/apache2'
[Sat Mar 17 00:27:55.864591 2018] [mpm_prefork:notice] [pid 4503] AH00169: caught SIGTERM, shutting down
[Sat Mar 17 10:31:53.731976 2018] [mpm_prefork:notice] [pid 976] AH00163: Apache/2.4.27 (Ubuntu) configured -- resuming normal operations
[Sat Mar 17 10:31:53.732234 2018] [core:notice] [pid 976] AH00094: Command line: '/usr/sbin/apache2'
[Sat Mar 17 11:34:39.997952 2018] [mpm_prefork:notice] [pid 976] AH00171: Graceful restart requested, doing restart
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
[Sat Mar 17 11:34:40.030583 2018] [mpm_prefork:notice] [pid 976] AH00163: Apache/2.4.27 (Ubuntu) configured -- resuming normal operations
[Sat Mar 17 11:34:40.030598 2018] [core:notice] [pid 976] AH00094: Command line: '/usr/sbin/apache2'
[Sat Mar 17 13:21:25.282367 2018] [mpm_prefork:notice] [pid 976] AH00169: caught SIGTERM, shutting down
[Sat Mar 17 13:21:51.639863 2018] [mpm_prefork:notice] [pid 910] AH00163: Apache/2.4.27 (Ubuntu) configured -- resuming normal operations
[Sat Mar 17 13:21:51.640113 2018] [core:notice] [pid 910] AH00094: Command line: '/usr/sbin/apache2'
[Sat Mar 17 15:05:37.460715 2018] [mpm_prefork:notice] [pid 910] AH00171: Graceful restart requested, doing restart
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
[Sat Mar 17 15:05:37.492875 2018] [mpm_prefork:notice] [pid 910] AH00163: Apache/2.4.27 (Ubuntu) configured -- resuming normal operations
[Sat Mar 17 15:05:37.492892 2018] [core:notice] [pid 910] AH00094: Command line: '/usr/sbin/apache2'

Les fichiers error.log.txt de chaque VH ne comportent aucune ligne datée d'aujourd'hui.


Je cale ...

Pourriez-vous svp m'indiquer dans quelle direction chercher  ?

Merci par avance pour votre aide,
Roland


loup maigre (et vieux ...)

Hors ligne

#2 Le 17/03/2018, à 17:51

bruno

Re : Pourquoi mes hôtes vituels ne fonctionnent-ils plus ?

Bonjour,

Il faut regarder /var/log/apache2/access.log et éventuellement dans ces fichiers placés à un endroit curieux :

ErrorLog /home/roland/www-dev/noticedevote.dev/error.log.txt

Et indiquer le contenu et les droits des dossiers des sites :

ls -al /home/roland/www-dev/noticedevote.dev/

Hors ligne

#3 Le 18/03/2018, à 00:24

RolandG

Re : Pourquoi mes hôtes vituels ne fonctionnent-ils plus ?

Bonjour Bruno,

les error.log.txt de chaque VH sont dans les repertoire des VH pour une meilleur facilité d'accès (je les consulte souvent ... wink Je les y ai installé par la directive de configuration dans leur .conf respectif :

cat ~/www-dev/noticedevote.dev/error.log.txt
[Wed Mar 14 23:05:09.915109 2018] [php7:notice] [pid 907] [client 127.0.0.1:37978] ________________________________________

Il s'agit de la trace de mon dernier test qui remonte à mercredi dernier.

Les droits d'accès ont été modifiés selon tes indication lors d'un échange précédent :

ls -al ~/www-dev/noticedevote.dev
total 524
drwxr-xr-x 13 roland roland  4096 mars  15 23:23 .
drwxr-xr-x 14 roland roland  4096 mars  11 16:24 ..
-rwxr-xr-x  1 roland roland 11917 mars   2 16:57 20180225 StockProc CQ.sql
-rwxr-xr-x  1 roland roland  1693 mars  13 22:12 activer.php
-rwxr-xr-x  1 roland roland  1693 mars   2 16:57 activer.php~

Je ne mets pas la liste complète mais ils ont tous les mm droits (dont rx pour tous).

Le acces.log :

cat  /var/log/apache2/access.log
127.0.0.1 - - [17/Mar/2018:14:53:01 +0100] "GET / HTTP/1.1" 200 3477 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0"
127.0.0.1 - - [17/Mar/2018:14:53:01 +0100] "GET /icons/ubuntu-logo.png HTTP/1.1" 200 3623 "http://localhost/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0"
127.0.0.1 - - [17/Mar/2018:14:53:01 +0100] "GET /favicon.ico HTTP/1.1" 404 500 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0"
127.0.0.1 - - [17/Mar/2018:14:53:02 +0100] "GET /favicon.ico HTTP/1.1" 404 500 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0"
127.0.0.1 - - [17/Mar/2018:16:17:48 +0100] "GET /noticedevote.dev HTTP/1.1" 404 506 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0"
127.0.0.1 - - [17/Mar/2018:16:19:05 +0100] "GET /noticedevote.dev HTTP/1.1" 404 506 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0"
127.0.0.1 - - [17/Mar/2018:16:19:06 +0100] "GET /favicon.ico HTTP/1.1" 404 500 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0"
127.0.0.1 - - [17/Mar/2018:16:19:06 +0100] "GET /favicon.ico HTTP/1.1" 404 500 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0"

Je n'avais pas regardé celui-là.

Il y a effectivement des messages d'erreur d'accès.
Je suis étonné de voir la mention X11 dans toutes les lignes d'erreur puisque X11 ,'est pas utilisé par Ubuntu 17.10 ...

Quand à l'erreur 404 500:
1/ J'ai déjà remplacé FollowSymLinks par SymLinksIfOwnerMatch :

cat /etc/apache2/sites-available/noticedevote.dev.conf 
<VirtualHost *:80>
        DocumentRoot /home/roland/www-dev/noticedevote.dev/
        ServerName noticedevote.dev
        ServerAlias www.noticedevote.dev
	ErrorLog /home/roland/www-dev/noticedevote.dev/error.log.txt
        <Directory /home/roland/www-dev/noticedevote.dev/>
		Options SymLinksIfOwnerMatch
		AuthType Basic
		AllowOverride all
		Require local
        </Directory>
</VirtualHost>

2/ il n'y a aucun fichier ".htaccess" dans www-dev/noticedevote.dev
3/ ayant utilisé un "chmod -R a+rx ...", il n'y a pas de fichier ou répertoire mod 777 dans www-dev/noticedevote.dev.


Peux-tu stp m'éclairer sur la signification du-dit message ?

le fichier favicon.ico est bien dans ~/noticedevote.dev avec les droits -rwx r-x r-x

à te lire,
Roland


loup maigre (et vieux ...)

Hors ligne

#4 Le 18/03/2018, à 08:11

bruno

Re : Pourquoi mes hôtes vituels ne fonctionnent-ils plus ?

Bon, le fichier favicon on s'en moque pour l'instant. Les navigateurs web cherchent systématiquement ce fichier à la racine d'un site me s'il n'existe pas.

Ce que montre tes logs c'est que tu as bien une réponse en accédant à / via http://localhost (ligne 1 et 2) par contre tu as une erreur 404 en tenatnt d’accéder à la ressource /noticedevote.dev.
Si tu tapes http://noticedevote.dev dans la barre d'adresse de ton navigateur, dans le fichier access.log on devrait voir une requête vers / et non vers /noticedevote.dev
Il faudrait savoir quelle URL tu as saisi dans ton navigateur à ce moment là et connaître la configuration de ton hôte virtuel par défaut.


Remarque sur les logs Apache, les logs contiennent les informations suivantes dans l'ordre :
- IP du client : 127.0.0.1
- des infos sur l'utilisateur(généralement absentes) : - -
- date : [17/Mar/2018:14:53:01 +0100]
- requête : "GET /icons/ubuntu-logo.png HTTP/1.1"
- le code de retour HTTP : 200
- le référent : "http://localhost/" ( - si absent)
- la chaîne d'identification du navigateur : "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0"

Hors ligne

#5 Le 18/03/2018, à 10:23

RolandG

Re : Pourquoi mes hôtes vituels ne fonctionnent-ils plus ?

Bonjour Bruno,

Suite à un appel de http://noticedevote.dev, l'access.log d'aujourd'hui est vide :

ls -l /var/log/apache2
total 68
-rw-r----- 1 root adm    0 mars  18 00:06 access.log
-rw-r----- 1 root adm 1323 mars  17 16:19 access.log.1
-rw-r----- 1 root adm   73 mars  16 08:49 access.log.2.gz
-rw-r----- 1 root adm   85 mars  13 11:42 access.log.3.gz
-rw-r----- 1 root adm  582 mars  18  2018 error.log
-rw-r----- 1 root adm 2610 mars  18 00:06 error.log.1
-rw-r----- 1 root adm  542 mars  17 00:06 error.log.2.gz
-rw-r----- 1 root adm  488 mars  16 08:22 error.log.3.gz
-rw-r----- 1 root adm  602 mars  15 08:09 error.log.4.gz
-rw-r----- 1 root adm  672 mars  14 10:06 error.log.5.gz
-rw-r----- 1 root adm  421 mars  13 10:09 error.log.6.gz
-rw-r----- 1 root adm  647 mars  12 08:34 error.log.7.gz
-rw-r----- 1 root adm    0 mars  17 00:06 other_vhosts_access.log
-rw-r----- 1 root adm 3102 mars  16 23:27 other_vhosts_access.log.1
-rw-r----- 1 root adm  310 mars  15 23:16 other_vhosts_access.log.2.gz
-rw-r----- 1 root adm 1174 mars  14 23:05 other_vhosts_access.log.3.gz
-rw-r----- 1 root adm 1274 mars  14 09:11 other_vhosts_access.log.4.gz
-rw-r----- 1 root adm  354 mars  13 07:48 other_vhosts_access.log.5.gz
-rw-r----- 1 root adm  436 mars  12 08:30 other_vhosts_access.log.6.gz

L'error.log de apache de ce jour :

cat /var/log/apache2/error.log
[Sun Mar 18 00:06:01.424053 2018] [mpm_prefork:notice] [pid 949] AH00163: Apache/2.4.27 (Ubuntu) configured -- resuming normal operations
[Sun Mar 18 00:06:01.424081 2018] [core:notice] [pid 949] AH00094: Command line: '/usr/sbin/apache2'
[Sun Mar 18 01:19:37.490540 2018] [mpm_prefork:notice] [pid 949] AH00169: caught SIGTERM, shutting down
[Sun Mar 18 10:23:39.383864 2018] [mpm_prefork:notice] [pid 943] AH00163: Apache/2.4.27 (Ubuntu) configured -- resuming normal operations
[Sun Mar 18 10:23:39.384091 2018] [core:notice] [pid 943] AH00094: Command line: '/usr/sbin/apache2'

Le fichier 000-default.conf ( j'ai retiré les commentaires) :

cat /etc/apache2/sites-available/000-default.conf
<VirtualHost *:80>
	ServerAdmin webmaster@localhost
	DocumentRoot /var/www/html
	ErrorLog ${APACHE_LOG_DIR}/error.log
	CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Je creuse un autre point et je précise si résultat.
Roland


loup maigre (et vieux ...)

Hors ligne

#6 Le 18/03/2018, à 10:49

bruno

Re : Pourquoi mes hôtes vituels ne fonctionnent-ils plus ?

C'est normal que access.log soit vide tu n'as pas de ligne indiquant ou enregistrer les logs d’accès dans tes hôtes virtuels, il faut que tu y rajoutes :

CustomLog ${APACHE_LOG_DIR}/access.log combined

Hors ligne

#7 Le 18/03/2018, à 16:05

RolandG

Re : Pourquoi mes hôtes vituels ne fonctionnent-ils plus ?

Donc, sur tes dernières indications, j'ai modifié les trois .conf comme :

cat /etc/apache2/sites-available/noticedevote.dev.conf
<VirtualHost *:80>
        DocumentRoot /home/roland/www-dev/noticedevote.dev/
        ServerName noticedevote.dev
        ServerAlias www.noticedevote.dev
	ErrorLog /home/roland/www-dev/noticedevote.dev/error.log.txt
	CustomLog ${APACHE_LOG_DIR}/access.log combined
        <Directory /home/roland/www-dev/noticedevote.dev/>
		Options SymLinksIfOwnerMatch
		AuthType Basic
		AllowOverride all
		Require local
        </Directory>
</VirtualHost>

Apache reloadé, j'appele (bis) htxxp://noticedevote.dev :

cat /var/log/apache2/access.log
127.0.0.1 - - [18/Mar/2018:15:45:27 +0100] "GET / HTTP/1.1" 200 3477 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0"
127.0.0.1 - - [18/Mar/2018:15:45:27 +0100] "GET /icons/ubuntu-logo.png HTTP/1.1" 200 3623 "http://localhost/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0"
127.0.0.1 - - [18/Mar/2018:15:45:27 +0100] "GET /favicon.ico HTTP/1.1" 404 500 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0"
127.0.0.1 - - [18/Mar/2018:15:45:27 +0100] "GET /favicon.ico HTTP/1.1" 404 500 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0"

Je ne sais pas ce qu'il fait, mais les deux seules lignes d'erreur sont des lignes concernant le favicon.

Je n'y comprends que kwick.

Merci par avance de tes idées et pistes à suivre.


loup maigre (et vieux ...)

Hors ligne

#8 Le 18/03/2018, à 16:20

bruno

Re : Pourquoi mes hôtes vituels ne fonctionnent-ils plus ?

La première ligne indique un code de retour 200 donc succès.
Maintenant tu as une directive AuthType Basic dans ton hôte virtuel; Est-ce que l'authetification est correctement configurée ? Que se passe-t-il si tu désactives cette ligne ?

Hors ligne

#9 Le 18/03/2018, à 16:47

RolandG

Re : Pourquoi mes hôtes vituels ne fonctionnent-ils plus ?

après suppression de la ligne " AuthType Basic", reload de apache2 et appel de hxxp://noticedevote.dev, access.log n'a pas bougé d'un yota, par contre j'ai trois lignes dans l'error.log qui m'interpellent :

[Sun Mar 18 16:35:06.453326 2018] [mpm_prefork:notice] [pid 895] AH00171: Graceful restart requested, doing restart
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
[Sun Mar 18 16:35:06.500401 2018] [mpm_prefork:notice] [pid 895] AH00163: Apache/2.4.27 (Ubuntu) configured -- resuming normal operations
[Sun Mar 18 16:35:06.500415 2018] [core:notice] [pid 895] AH00094: Command line: '/usr/sbin/apache2'

Je ne comprends pas la première. (ni les autres, d'ailleurs wink)
Ma session est bien ouverte à "roland", administrateur installateur, propriétaire du sudo.

à te lire, merci de ta patience


loup maigre (et vieux ...)

Hors ligne

#10 Le 18/03/2018, à 16:53

bruno

Re : Pourquoi mes hôtes vituels ne fonctionnent-ils plus ?

Relance complètement Apache :

sudo systemctl restart apache2

et retour de

sudo systemctl status apache2

Dernière modification par bruno (Le 18/03/2018, à 16:54)

Hors ligne

#11 Le 18/03/2018, à 17:20

RolandG

Re : Pourquoi mes hôtes vituels ne fonctionnent-ils plus ?

comme suit :

sudo systemctl status apache2
● apache2.service - The Apache HTTP Server
   Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
  Drop-In: /lib/systemd/system/apache2.service.d
           └─apache2-systemd.conf
   Active: active (running) since Sun 2018-03-18 17:18:07 CET; 49s ago
  Process: 6898 ExecStop=/usr/sbin/apachectl stop (code=exited, status=0/SUCCESS)
  Process: 6903 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
 Main PID: 6907 (apache2)
    Tasks: 6 (limit: 4915)
   CGroup: /system.slice/apache2.service
           ├─6907 /usr/sbin/apache2 -k start
           ├─6909 /usr/sbin/apache2 -k start
           ├─6910 /usr/sbin/apache2 -k start
           ├─6911 /usr/sbin/apache2 -k start
           ├─6912 /usr/sbin/apache2 -k start
           └─6913 /usr/sbin/apache2 -k start

mars 18 17:18:07 roland-TMP645-M systemd[1]: Starting The Apache HTTP Server...
mars 18 17:18:07 roland-TMP645-M apachectl[6903]: AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive 
mars 18 17:18:07 roland-TMP645-M systemd[1]: Started The Apache HTTP Server.

loup maigre (et vieux ...)

Hors ligne

#12 Le 18/03/2018, à 17:30

bruno

Re : Pourquoi mes hôtes vituels ne fonctionnent-ils plus ?

Bon apache est bien lancé.
Est-ce qu'il y a une différence si tu utilises l'une ou l'autre de ces urls :
http://noticedevote.dev
http://www.noticedevote.dev

Hors ligne

#13 Le 18/03/2018, à 17:45

RolandG

Re : Pourquoi mes hôtes vituels ne fonctionnent-ils plus ?

En faisant les appels l'un après l'autre :

hxxp://noticedevote.dev :

$ cat /var/log/apache2/error.log

[Sun Mar 18 17:16:34.116059 2018] [mpm_prefork:notice] [pid 895] AH00169: caught SIGTERM, shutting down
[Sun Mar 18 17:16:34.224499 2018] [mpm_prefork:notice] [pid 6882] AH00163: Apache/2.4.27 (Ubuntu) configured -- resuming normal operations
[Sun Mar 18 17:16:34.224540 2018] [core:notice] [pid 6882] AH00094: Command line: '/usr/sbin/apache2'

hxxp://www.noticedevote.dev :

[Sun Mar 18 17:18:07.738028 2018] [mpm_prefork:notice] [pid 6882] AH00169: caught SIGTERM, shutting down
[Sun Mar 18 17:18:07.835836 2018] [mpm_prefork:notice] [pid 6907] AH00163: Apache/2.4.27 (Ubuntu) configured -- resuming normal operations
[Sun Mar 18 17:18:07.835876 2018] [core:notice] [pid 6907] AH00094: Command line: '/usr/sbin/apache2'

(je n'ai laissé que les nouvelles lignes.)
A part les pid, je ne vois pas de différence.

Aucune nouvelle ligne dans /var/log/apache2/access.log.


loup maigre (et vieux ...)

Hors ligne

#14 Le 18/03/2018, à 18:20

bruno

Re : Pourquoi mes hôtes vituels ne fonctionnent-ils plus ?

C'est access.log qu'il faut regarder et indiquer l'erreur affichée par le navigateur web.
Par contre je ne comprends pas pourquoi ton Apache redémarre à chaque fois. Est-ce que tu peux donner au moins 20 lignes de error.log

Dernière modification par bruno (Le 18/03/2018, à 18:21)

Hors ligne

#15 Le 18/03/2018, à 19:29

RolandG

Re : Pourquoi mes hôtes vituels ne fonctionnent-ils plus ?

Bruno,

Comme indiqué dans mon dernier message, il n'y a pas eu de nouvel enregistrement dans access.log. :

cat /var/log/apache2/access.log
127.0.0.1 - - [18/Mar/2018:15:45:27 +0100] "GET / HTTP/1.1" 200 3477 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0"
127.0.0.1 - - [18/Mar/2018:15:45:27 +0100] "GET /icons/ubuntu-logo.png HTTP/1.1" 200 3623 "http://localhost/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0"
127.0.0.1 - - [18/Mar/2018:15:45:27 +0100] "GET /favicon.ico HTTP/1.1" 404 500 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0"
127.0.0.1 - - [18/Mar/2018:15:45:27 +0100] "GET /favicon.ico HTTP/1.1" 404 500 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0"

et ci-après le error.log entier :

$ cat /var/log/apache2/error.log
[Sun Mar 18 00:06:01.424053 2018] [mpm_prefork:notice] [pid 949] AH00163: Apache/2.4.27 (Ubuntu) configured -- resuming normal operations
[Sun Mar 18 00:06:01.424081 2018] [core:notice] [pid 949] AH00094: Command line: '/usr/sbin/apache2'
[Sun Mar 18 01:19:37.490540 2018] [mpm_prefork:notice] [pid 949] AH00169: caught SIGTERM, shutting down
[Sun Mar 18 10:23:39.383864 2018] [mpm_prefork:notice] [pid 943] AH00163: Apache/2.4.27 (Ubuntu) configured -- resuming normal operations
[Sun Mar 18 10:23:39.384091 2018] [core:notice] [pid 943] AH00094: Command line: '/usr/sbin/apache2'
[Sun Mar 18 10:30:06.323817 2018] [mpm_prefork:notice] [pid 943] AH00169: caught SIGTERM, shutting down
[Sun Mar 18 10:30:32.997641 2018] [mpm_prefork:notice] [pid 909] AH00163: Apache/2.4.27 (Ubuntu) configured -- resuming normal operations
[Sun Mar 18 10:30:32.997883 2018] [core:notice] [pid 909] AH00094: Command line: '/usr/sbin/apache2'
[Sun Mar 18 10:44:53.289971 2018] [mpm_prefork:notice] [pid 909] AH00171: Graceful restart requested, doing restart
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
[Sun Mar 18 10:44:53.322238 2018] [mpm_prefork:notice] [pid 909] AH00163: Apache/2.4.27 (Ubuntu) configured -- resuming normal operations
[Sun Mar 18 10:44:53.322249 2018] [core:notice] [pid 909] AH00094: Command line: '/usr/sbin/apache2'
[Sun Mar 18 10:46:08.985721 2018] [mpm_prefork:notice] [pid 909] AH00171: Graceful restart requested, doing restart
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
[Sun Mar 18 10:46:09.022532 2018] [mpm_prefork:notice] [pid 909] AH00163: Apache/2.4.27 (Ubuntu) configured -- resuming normal operations
[Sun Mar 18 10:46:09.022543 2018] [core:notice] [pid 909] AH00094: Command line: '/usr/sbin/apache2'
[Sun Mar 18 10:47:01.369255 2018] [mpm_prefork:notice] [pid 909] AH00171: Graceful restart requested, doing restart
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
[Sun Mar 18 10:47:01.405084 2018] [mpm_prefork:notice] [pid 909] AH00163: Apache/2.4.27 (Ubuntu) configured -- resuming normal operations
[Sun Mar 18 10:47:01.405097 2018] [core:notice] [pid 909] AH00094: Command line: '/usr/sbin/apache2'
[Sun Mar 18 10:47:42.235253 2018] [mpm_prefork:notice] [pid 909] AH00171: Graceful restart requested, doing restart
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
[Sun Mar 18 10:47:42.271845 2018] [mpm_prefork:notice] [pid 909] AH00163: Apache/2.4.27 (Ubuntu) configured -- resuming normal operations
[Sun Mar 18 10:47:42.271856 2018] [core:notice] [pid 909] AH00094: Command line: '/usr/sbin/apache2'
[Sun Mar 18 10:48:05.839367 2018] [mpm_prefork:notice] [pid 909] AH00169: caught SIGTERM, shutting down
[Sun Mar 18 15:13:11.686617 2018] [mpm_prefork:notice] [pid 935] AH00163: Apache/2.4.27 (Ubuntu) configured -- resuming normal operations
[Sun Mar 18 15:13:11.687458 2018] [core:notice] [pid 935] AH00094: Command line: '/usr/sbin/apache2'
[Sun Mar 18 14:29:14.976575 2018] [mpm_prefork:notice] [pid 935] AH00169: caught SIGTERM, shutting down
[Sun Mar 18 16:02:21.425465 2018] [mpm_prefork:notice] [pid 952] AH00163: Apache/2.4.27 (Ubuntu) configured -- resuming normal operations
[Sun Mar 18 16:02:21.425685 2018] [core:notice] [pid 952] AH00094: Command line: '/usr/sbin/apache2'
[Sun Mar 18 15:39:20.125751 2018] [mpm_prefork:notice] [pid 952] AH00171: Graceful restart requested, doing restart
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
[Sun Mar 18 15:39:20.166884 2018] [mpm_prefork:notice] [pid 952] AH00163: Apache/2.4.27 (Ubuntu) configured -- resuming normal operations
[Sun Mar 18 15:39:20.166909 2018] [core:notice] [pid 952] AH00094: Command line: '/usr/sbin/apache2'
[Sun Mar 18 15:39:55.121528 2018] [mpm_prefork:notice] [pid 952] AH00169: caught SIGTERM, shutting down
[Sun Mar 18 15:41:11.587389 2018] [mpm_prefork:notice] [pid 895] AH00163: Apache/2.4.27 (Ubuntu) configured -- resuming normal operations
[Sun Mar 18 15:41:11.587673 2018] [core:notice] [pid 895] AH00094: Command line: '/usr/sbin/apache2'
[Sun Mar 18 15:54:43.894417 2018] [mpm_prefork:notice] [pid 895] AH00171: Graceful restart requested, doing restart
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
[Sun Mar 18 15:54:43.935435 2018] [mpm_prefork:notice] [pid 895] AH00163: Apache/2.4.27 (Ubuntu) configured -- resuming normal operations
[Sun Mar 18 15:54:43.935591 2018] [core:notice] [pid 895] AH00094: Command line: '/usr/sbin/apache2'
[Sun Mar 18 16:31:31.240360 2018] [mpm_prefork:notice] [pid 895] AH00171: Graceful restart requested, doing restart
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
[Sun Mar 18 16:31:31.293918 2018] [mpm_prefork:notice] [pid 895] AH00163: Apache/2.4.27 (Ubuntu) configured -- resuming normal operations
[Sun Mar 18 16:31:31.293938 2018] [core:notice] [pid 895] AH00094: Command line: '/usr/sbin/apache2'
[Sun Mar 18 16:33:16.685367 2018] [mpm_prefork:notice] [pid 895] AH00171: Graceful restart requested, doing restart
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
[Sun Mar 18 16:33:16.728191 2018] [mpm_prefork:notice] [pid 895] AH00163: Apache/2.4.27 (Ubuntu) configured -- resuming normal operations
[Sun Mar 18 16:33:16.728213 2018] [core:notice] [pid 895] AH00094: Command line: '/usr/sbin/apache2'
[Sun Mar 18 16:35:06.453326 2018] [mpm_prefork:notice] [pid 895] AH00171: Graceful restart requested, doing restart
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
[Sun Mar 18 16:35:06.500401 2018] [mpm_prefork:notice] [pid 895] AH00163: Apache/2.4.27 (Ubuntu) configured -- resuming normal operations
[Sun Mar 18 16:35:06.500415 2018] [core:notice] [pid 895] AH00094: Command line: '/usr/sbin/apache2'
[Sun Mar 18 17:16:34.116059 2018] [mpm_prefork:notice] [pid 895] AH00169: caught SIGTERM, shutting down
[Sun Mar 18 17:16:34.224499 2018] [mpm_prefork:notice] [pid 6882] AH00163: Apache/2.4.27 (Ubuntu) configured -- resuming normal operations
[Sun Mar 18 17:16:34.224540 2018] [core:notice] [pid 6882] AH00094: Command line: '/usr/sbin/apache2'
[Sun Mar 18 17:18:07.738028 2018] [mpm_prefork:notice] [pid 6882] AH00169: caught SIGTERM, shutting down
[Sun Mar 18 17:18:07.835836 2018] [mpm_prefork:notice] [pid 6907] AH00163: Apache/2.4.27 (Ubuntu) configured -- resuming normal operations
[Sun Mar 18 17:18:07.835876 2018] [core:notice] [pid 6907] AH00094: Command line: '/usr/sbin/apache2'

Je ne comprends pas non plus.


loup maigre (et vieux ...)

Hors ligne

#16 Le 19/03/2018, à 08:45

bruno

Re : Pourquoi mes hôtes vituels ne fonctionnent-ils plus ?

Bon, j'ai beau relire le fil je ne vois pas l'origine de ton problème même s'il y a des choses à revoir dans ta configuration.
Il doit manquer une info importante quelque part…

Puisqu'on arrive pas à voir les logs d'accès peux-tu donner le retour de cette commande :

curl -I http://www.noticedevote.dev

Hors ligne

#17 Le 19/03/2018, à 09:02

RolandG

Re : Pourquoi mes hôtes vituels ne fonctionnent-ils plus ?

Bonjour Bruno,

Je fouille sur le net mais n'ai rien trouvé qui me semble pertinent, mais je suis bien au-delà de mon niveau de compétence.

l'appel par curl dit "ok" :

 curl -I http://www.noticedevote.dev
HTTP/1.1 200 OK
Date: Mon, 19 Mar 2018 07:59:12 GMT
Server: Apache/2.4.27 (Ubuntu)
Content-Type: text/html; charset=UTF-8

Faudrait-t-il réinstaller le lamp ?


loup maigre (et vieux ...)

Hors ligne

#18 Le 19/03/2018, à 09:08

bruno

Re : Pourquoi mes hôtes vituels ne fonctionnent-ils plus ?

Donc le site www.noticedevote.dev fonctionne !
Tu peux relancer curl pour voir ce qu'il charge réellement (avec -I on n'a que le code de retour HTTP) :

curl  http://www.noticedevote.dev

Quelle erreur obtiens-tu avec un navigateur web ? Le navigateur web est-il bien lancé sur le même ordinateur que celui qui héberge les sites ?

Dernière modification par bruno (Le 19/03/2018, à 09:08)

Hors ligne

#19 Le 19/03/2018, à 09:18

RolandG

Re : Pourquoi mes hôtes vituels ne fonctionnent-ils plus ?

Il affiche ma page d'accès automatique, index.html, qui dit "Hello, world !".
Je sais, ce n'est pas très original ...

curl  http://www.noticedevote.dev
<!DOCTYPE html>
<html lang="fr">
  <head>
    <meta charset="utf-8">
    <title itemprop='name'>Notice de vote par correspondance des IRP</title>
  </head>
<body>
 <h4>Hello, world !</h4>
</body>
</html>

Difficile de faire plus simple. Il n'y a rien ici qui puisse mettre apache en biais.


loup maigre (et vieux ...)

Hors ligne

#20 Le 19/03/2018, à 09:21

bruno

Re : Pourquoi mes hôtes vituels ne fonctionnent-ils plus ?

Donc cela fonctionne.
Il n'y a a priori pas de raison que le résultat soit différent avec un navigateur web.


Quelle erreur obtiens-tu avec un navigateur web ? Le navigateur web est-il bien lancé sur le même ordinateur que celui qui héberge les sites ?

Dernière modification par bruno (Le 19/03/2018, à 09:28)

Hors ligne

#21 Le 19/03/2018, à 09:23

RolandG

Re : Pourquoi mes hôtes vituels ne fonctionnent-ils plus ?

et, pour compléter, voici le petit script qui me permet de définir un hôte virtuel :

#!/bin/bash
# newhost <domaine.dlt>
# crée l'hôte virtuel du domaine passé en paramètre
# le répertoire $HOME/www-dev/domaine.dlt doit préexister.
FOLDER_PATH=~/www-dev
## Récupération du premier paramètre
URI_SITE=$1 
## Ajouter le vhosts
echo "-= Ajouter le virtual host de $URI_SITE =-"
VHOST="<VirtualHost *:80>
        DocumentRoot $FOLDER_PATH/$URI_SITE/
        ServerName $URI_SITE
 	ServerAlias www.$URI_SITE
	ErrorLog $FOLDER_PATH/$URI_SITE/error.log.txt
	CustomLog ${APACHE_LOG_DIR}/access.log combined
        <Directory $FOLDER_PATH/$URI_SITE/>
		Options SymLinksIfOwnerMatch
#		AuthType Basic
		AllowOverride all
		Require local
        </Directory>
</VirtualHost>"
 
sudo bash -c "echo \"$VHOST\" > /etc/apache2/sites-available/$URI_SITE.conf"
 
# Ajouter dans le fichier hosts
echo "-= $URI_SITE ajouté au fichier hosts =-"
echo "127.0.0.1    www.$URI_SITE" > t.t
cat /etc/hosts >> t.t
sudo cp t.t /etc/hosts
rm t.t
 
# Enable dans apache
sudo a2ensite $URI_SITE
echo "-= Rafraichissement d'Apache =-"
# Un petit reload d'apache
#sudo service apache2 restart
sudo systemctl restart apache2
 
echo "Le site est accessible sur : http://www.$URI_SITE"
 
#ouverture du site sur firefox
firefox "http://www."$URI_SITE

Dans sa dernière version, prenant en compte tes indications de ces deux derniers jours


loup maigre (et vieux ...)

Hors ligne

#22 Le 19/03/2018, à 09:33

RolandG

Re : Pourquoi mes hôtes vituels ne fonctionnent-ils plus ?

J'ai tapé hxxp://www.noticedevote.dev, il affiche ceci :
retour sur firefox

La transformation en hxxts://noticedevote.dev doit être le résultat des tentatives de recherche de solution par apache ?

J'obtiens exactement la mm chose avec hxxp://noticedevote.dev.


loup maigre (et vieux ...)

Hors ligne

#23 Le 19/03/2018, à 09:47

bruno

Re : Pourquoi mes hôtes vituels ne fonctionnent-ils plus ?

Bon on va corriger tes erreurs et complications inutiles.
Il est inutile d'avoir 2 noms de domaine, l'un avec www et l'autre sans. En plus cela engendre sûrement des problèmes car seul le nom avec www est présent dans ton fichier hosts…

Donc dans le fichier /etc/hosts :

127.0.0.1    speedytools.dev
127.0.0.1    outilsdurouteur.dev
127.0.0.1    noticedevote.dev

Dans les hôtes virtuels :

<VirtualHost *:80>
        DocumentRoot /home/roland/www-dev/noticedevote.dev/
        ServerName noticedevote.dev
        ErrorLog  ${APACHE_LOG_DIR/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
        <Directory /home/roland/www-dev/noticedevote.dev/>
             Options SymLinksIfOwnerMatch
             AllowOverride all
             Require local
        </Directory>
</VirtualHost>

Redémarrage d'Apache et nouvel essai.

Dernière modification par bruno (Le 19/03/2018, à 09:49)

Hors ligne

#24 Le 19/03/2018, à 10:23

RolandG

Re : Pourquoi mes hôtes vituels ne fonctionnent-ils plus ?

aussitôt dit, aussitôt fait :

roland@roland-TMP645-M:~$ cat /etc/hosts
127.0.0.1    speedytools.dev
127.0.0.1    outilsdurouteur.dev
127.0.0.1    noticedevote.dev
127.0.0.1	localhost
127.0.1.1	roland-TMP645-M
# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

roland@roland-TMP645-M:~$ cat /etc/apache2/sites-available/noticedevote.dev.conf 
<VirtualHost *:80>
        DocumentRoot /home/roland/www-dev/noticedevote.dev/
        ServerName noticedevote.dev
	ErrorLog  ${APACHE_LOG_DIR}/error.log
	CustomLog ${APACHE_LOG_DIR}/access.log combined
        <Directory /home/roland/www-dev/noticedevote.dev/>
		Options SymLinksIfOwnerMatch
		AllowOverride all
		Require local
        </Directory>
</VirtualHost>

roland@roland-TMP645-M:~$ cat /etc/apache2/sites-available/speedytools.dev.conf
<VirtualHost *:80>
        DocumentRoot /home/roland/www-dev/speedytools.dev/
        ServerName speedytools.dev
        ErrorLog  ${APACHE_LOG_DIR}/error.log
	CustomLog ${APACHE_LOG_DIR}/access.log combined
        <Directory /home/roland/www-dev/speedytools.dev/>
		Options SymLinksIfOwnerMatch
		AllowOverride all
		Require local
        </Directory>
</VirtualHost>

roland@roland-TMP645-M:~$ cat /etc/apache2/sites-available/outilsdurouteur.dev.conf
<VirtualHost *:80>
        DocumentRoot /home/roland/www-dev/outilsdurouteur.dev/
        ServerName outilsdurouteur.dev
        ErrorLog  ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
        <Directory /home/roland/www-dev/outilsdurouteur.dev/>
		Options SymLinksIfOwnerMatch
		AllowOverride all
		Require local
        </Directory>
</VirtualHost>

roland@roland-TMP645-M:~$ sudo systemctl restart apache2

hxxp://noticedevote.dev donne l'écran "la connection a échoué ..."
localhost/noticedevote donne 404 not found
localhost donne "it works !

Chèvre je deviens.


loup maigre (et vieux ...)

Hors ligne

#25 Le 19/03/2018, à 10:45

bruno

Re : Pourquoi mes hôtes vituels ne fonctionnent-ils plus ?

hxxp://noticedevote.dev donne l'écran "la connection a échoué ..."

Pas normal puisque cela fonctionne avec curl. Il doit y avoir un problème avec tes pseudo nom de domaines. Essaie de remplacer dans hosts et dans les vhosts .dev par .test et relance Apache.

localhost/noticedevote donne 404 not found

Normal, le dossier /var/www/html/noticedevote n'existe pas

localhost donne "it works !

Normal, c'est le contenu de /var/www/html qui est affiché

EDIT : je te confirme qu'il ne faut pas utiliser des pseudo nom de domaine avec .dev De toute façon c'est toujours très risqué d'utiliser des pseudo domaines localement car il n'y a pas de domaines de premier niveau officiellement réservés pour cela. J'ai cependant vu quelque part (mais je n'ai pas de source officielle) que les domaines de premier niveau :
.test
.localhost
.example
.invalid
pouvaient être utilisés pour cela.

Dernière modification par bruno (Le 19/03/2018, à 10:53)

Hors ligne