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 19/12/2018, à 03:38

dd

[resolu] 127.0.0.1 : La connexion a échoué

Je suis passée de 16.04 à 18.04

Mes sites en local (LAMP installé) refonctionnaient correctement, je redémarre mon PC et maintenant je n'arrive plus à accéder au serveur.

http://127.0.0.1/phpmyadmin/  et http://127.0.0.1/html/

donnent "La connexion a échoué"

J'ai tenté quelques commandes sans succès :

/var/log/apache2 : pas de fichier log

sudo systemctl restart apache2
Job for apache2.service failed because the control process exited with error code.
See "systemctl status apache2.service" and "journalctl -xe" for details.

Dans  /etc/apache2/sites-enabled/000-default.conf
j'ai  :

<Directory /var/www/html>
	Options Indexes FollowSymLinks MultiViews
	AllowOverride All	
</Directory>

Voici une liste d'erreurs que je ne sais pas interpréter pour réparer :

sudo systemctl restart apache2
Job for apache2.service failed because the control process exited with error code.
See "systemctl status apache2.service" and "journalctl -xe" for details.
dd@portable:~$ journalctl -xe
déc. 19 03:34:04 portable sudo[8435]:       dd : TTY=pts/3 ; PWD=/home/dd ; USER=root ; COMMAND=/bin/systemctl restart apache2
déc. 19 03:34:04 portable sudo[8435]: pam_unix(sudo:session): session opened for user root by (uid=0)
déc. 19 03:34:04 portable systemd[1]: Starting The Apache HTTP Server...
-- Subject: L'unité (unit) apache2.service a commencé à démarrer
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- L'unité (unit) apache2.service a commencé à démarrer.
déc. 19 03:34:04 portable apachectl[8438]: AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using
déc. 19 03:34:04 portable apachectl[8438]: (2)No such file or directory: AH02291: Cannot access directory '/var/log/apache2/' for main er
déc. 19 03:34:04 portable apachectl[8438]: (2)No such file or directory: AH02291: Cannot access directory '/var/log/apache2/' for error l
déc. 19 03:34:04 portable apachectl[8438]: AH00014: Configuration check failed
déc. 19 03:34:04 portable apachectl[8438]: Action 'start' failed.
déc. 19 03:34:04 portable apachectl[8438]: The Apache error log may have more information.
déc. 19 03:34:04 portable systemd[1]: apache2.service: Control process exited, code=exited status=1
déc. 19 03:34:04 portable systemd[1]: apache2.service: Failed with result 'exit-code'.
déc. 19 03:34:04 portable systemd[1]: Failed to start The Apache HTTP Server.
-- Subject: L'unité (unit) apache2.service a échoué
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- L'unité (unit) apache2.service a échoué, avec le résultat RESULT.
déc. 19 03:34:04 portable sudo[8435]: pam_unix(sudo:session): session closed for user root
lines 1495-1517/1517 (END)

Quelqu'un ici comprend-il ?

Merci

Dernière modification par dd (Le 20/12/2018, à 19:28)


OS: Ubuntu 20.04 focal / Kernel: x86_64 Linux 5.8.0-63-generic
Shell: bash 5.0.17 / DE: GNOME 3.36.5
CPU: Intel Core i3 540 @ 4x 3.067GHz
GPU: Intel Corporation Core Processor Integrated Graphics Controller (rev 18)

Hors ligne

#2 Le 19/12/2018, à 07:25

bruno

Re : [resolu] 127.0.0.1 : La connexion a échoué

Bonjour,

Apparemment apache2 ne démarre pas car il ne peut pas accéder aux logs : /var/log/apache2/
Donne-nous le retour de :

ls -al /var/log/apache2/
sudo apache2ctl -t

et éventuellement l'intégralité du fichier etc/apache2/sites-enabled/000-default.conf

Hors ligne

#3 Le 19/12/2018, à 12:16

dd

Re : [resolu] 127.0.0.1 : La connexion a échoué

Voici :

ls -al /var/log/apache2/
ls: impossible d'accéder à '/var/log/apache2/': Aucun fichier ou dossier de ce type
sudo apache2ctl -t
[sudo] Mot de passe de dd : 
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
(2)No such file or directory: AH02291: Cannot access directory '/var/log/apache2/' for main error log
(2)No such file or directory: AH02291: Cannot access directory '/var/log/apache2/' for error log of vhost defined at /etc/apache2/sites-enabled/000-default.conf:1
AH00014: Configuration check failed
Action '-t' failed.
The Apache error log may have more information.

/etc/apache2/sites-enabled/000-default.conf

<VirtualHost *:80>
	# The ServerName directive sets the request scheme, hostname and port that
	# the server uses to identify itself. This is used when creating
	# redirection URLs. In the context of virtual hosts, the ServerName
	# specifies what hostname must appear in the request's Host: header to
	# match this virtual host. For the default virtual host (this file) this
	# value is not decisive as it is used as a last resort host regardless.
	# However, you must set it for any further virtual host explicitly.
	#ServerName www.example.com

	ServerAdmin webmaster@localhost
	DocumentRoot /var/www/html

<Directory /var/www/html>
	Options Indexes FollowSymLinks MultiViews
	AllowOverride All
Require all granted
</Directory>

## ZONE PRIVEE
Alias /var/www/html /home/dd/html
<Directory /home/dd/html>
	Options Indexes FollowSymLinks MultiViews
	<RequireAny>
		Require ip 127.0.0.1
		Require ip 192.168.1
		Require host .w3.org
	</RequireAny>
</Directory>

	# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
	# error, crit, alert, emerg.
	# It is also possible to configure the loglevel for particular
	# modules, e.g.
	#LogLevel info ssl:warn

	ErrorLog ${APACHE_LOG_DIR}/error.log
	CustomLog ${APACHE_LOG_DIR}/access.log combined

	# For most configuration files from conf-available/, which are
	# enabled or disabled at a global level, it is possible to
	# include a line for only one particular virtual host. For example the
	# following line enables the CGI configuration for this host only
	# after it has been globally disabled with "a2disconf".
	#Include conf-available/serve-cgi-bin.conf
</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

Merci de ton aide


OS: Ubuntu 20.04 focal / Kernel: x86_64 Linux 5.8.0-63-generic
Shell: bash 5.0.17 / DE: GNOME 3.36.5
CPU: Intel Core i3 540 @ 4x 3.067GHz
GPU: Intel Corporation Core Processor Integrated Graphics Controller (rev 18)

Hors ligne

#4 Le 19/12/2018, à 12:51

bruno

Re : [resolu] 127.0.0.1 : La connexion a échoué

La création du dossier manquant devrait résoudre le problème.

sudo mkdir /var/log/apache2

Puis :

sudo chown root:adm /var/log/apache2

sudo chmod 750 /var/log/apache2

pour avoir les bons droits d'accès.
Et enfin redémarrage du serveur apache :

sudo systemctl restart apache2

Dernière modification par bruno (Le 19/12/2018, à 12:52)

Hors ligne

#5 Le 19/12/2018, à 13:10

dd

Re : [resolu] 127.0.0.1 : La connexion a échoué

Merci ! Maintenant Apache est OK et je vois la liste de mes hosts.

Par contre le serveur sql a un problème de droit. Mon mot de passe phpmyadmin n'est plus reconnu :

 #2002 - No such file or directory &mdash; Le serveur ne répond pas (ou l'interface de connexion vers le serveur MySQL local n'est pas correctement configurée).

J'ai essayé d'appliquer ce qui est dit ici : https://doc.ubuntu-fr.org/phpmyadmin#acces_root

mais l'accès à sql n'est pas possible :

 sudo mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

OS: Ubuntu 20.04 focal / Kernel: x86_64 Linux 5.8.0-63-generic
Shell: bash 5.0.17 / DE: GNOME 3.36.5
CPU: Intel Core i3 540 @ 4x 3.067GHz
GPU: Intel Corporation Core Processor Integrated Graphics Controller (rev 18)

Hors ligne

#6 Le 19/12/2018, à 13:15

bruno

Re : [resolu] 127.0.0.1 : La connexion a échoué

Et avec :

sudo mysql -u root -p

en donnant le mot de passe de l'utilisateur rot de mysql.

Hors ligne

#7 Le 19/12/2018, à 13:16

dd

Re : [resolu] 127.0.0.1 : La connexion a échoué

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)


OS: Ubuntu 20.04 focal / Kernel: x86_64 Linux 5.8.0-63-generic
Shell: bash 5.0.17 / DE: GNOME 3.36.5
CPU: Intel Core i3 540 @ 4x 3.067GHz
GPU: Intel Corporation Core Processor Integrated Graphics Controller (rev 18)

Hors ligne

#8 Le 19/12/2018, à 13:17

bruno

Re : [resolu] 127.0.0.1 : La connexion a échoué

Le service est-il bien lancé ?

sudo systemctl status mysql

Hors ligne

#9 Le 19/12/2018, à 13:20

dd

Re : [resolu] 127.0.0.1 : La connexion a échoué

sudo systemctl status mysql
● mysql.service - MySQL Community Server
   Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: en
   Active: failed (Result: exit-code) since Wed 2018-12-19 11:57:57 CET; 1h 22mi
  Process: 1114 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/run/mysqld/my
  Process: 1096 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exit

déc. 19 11:57:57 portable systemd[1]: mysql.service: Service hold-off time over,
déc. 19 11:57:57 portable systemd[1]: mysql.service: Scheduled restart job, rest
déc. 19 11:57:57 portable systemd[1]: Stopped MySQL Community Server.
déc. 19 11:57:57 portable systemd[1]: mysql.service: Start request repeated too
déc. 19 11:57:57 portable systemd[1]: mysql.service: Failed with result 'exit-co
déc. 19 11:57:57 portable systemd[1]: Failed to start MySQL Community Server.


OS: Ubuntu 20.04 focal / Kernel: x86_64 Linux 5.8.0-63-generic
Shell: bash 5.0.17 / DE: GNOME 3.36.5
CPU: Intel Core i3 540 @ 4x 3.067GHz
GPU: Intel Corporation Core Processor Integrated Graphics Controller (rev 18)

Hors ligne

#10 Le 19/12/2018, à 13:25

bruno

Re : [resolu] 127.0.0.1 : La connexion a échoué

Merci d'utiliser les balises [ code ] (icône < >) pour les retours de commandes. Et de ne pas couper les lignes…
Ton serveur MySQL ne démarre pas.

Donner le contenu de /var/log/mysql/error.log et/ou le retour de :

journalctl -u mysql

Hors ligne

#11 Le 19/12/2018, à 13:27

dd

Re : [resolu] 127.0.0.1 : La connexion a échoué

Désolée, j'ai des problèmes de taille de fenêtres

Voici:

journalctl -u mysql
-- Logs begin at Wed 2018-12-19 11:57:51 CET, end at Wed 2018-12-19 13:25:42 CETjournalctl -u mysql
-- Logs begin at Wed 2018-12-19 11:57:51 CET, end at Wed 2018-12-19 13:25:42 CET. --
déc. 19 11:57:53 portable systemd[1]: Starting MySQL Community Server...
déc. 19 11:57:54 portable mysqld[945]: 2018-12-19T10:57:54.444950Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is depreca
déc. 19 11:57:54 portable mysqld[945]: 2018-12-19T10:57:54.448362Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.24-0ubuntu0.18.04.1) s
déc. 19 11:57:54 portable mysqld[945]: 2018-12-19T10:57:54.460570Z 0 [ERROR] Could not open file '/var/log/mysql/error.log' for
déc. 19 11:57:54 portable mysqld[945]: 2018-12-19T10:57:54.460623Z 0 [ERROR] Aborting
déc. 19 11:57:54 portable mysqld[945]: Initialization of mysqld failed: 0
déc. 19 11:57:54 portable mysqld[945]: 2018-12-19T10:57:54.465847Z 0 [Note] Binlog end
déc. 19 11:57:54 portable mysqld[945]: 2018-12-19T10:57:54.466021Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
déc. 19 11:57:54 portable systemd[1]: mysql.service: Control process exited, code=exited status=1
déc. 19 11:57:54 portable systemd[1]: mysql.service: Failed with result 'exit-code'.
déc. 19 11:57:54 portable systemd[1]: Failed to start MySQL Community Server.
déc. 19 11:57:54 portable systemd[1]: mysql.service: Service hold-off time over, scheduling restart.
déc. 19 11:57:54 portable systemd[1]: mysql.service: Scheduled restart job, restart counter is at 1.
déc. 19 11:57:54 portable systemd[1]: Stopped MySQL Community Server.
déc. 19 11:57:54 portable systemd[1]: Starting MySQL Community Server...
déc. 19 11:57:54 portable mysqld[1007]: 2018-12-19T10:57:54.960646Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprec
déc. 19 11:57:54 portable mysqld[1007]: 2018-12-19T10:57:54.963967Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.24-0ubuntu0.18.04.1) 
déc. 19 11:57:54 portable mysqld[1007]: 2018-12-19T10:57:54.970004Z 0 [ERROR] Could not open file '/var/log/mysql/error.log' fo
déc. 19 11:57:54 portable mysqld[1007]: 2018-12-19T10:57:54.970062Z 0 [ERROR] Aborting
déc. 19 11:57:54 portable mysqld[1007]: Initialization of mysqld failed: 0
lines 1-21. --
déc. 19 11:57:53 portable systemd[1]: Starting MySQL Community Server...
déc. 19 11:57:54 portable mysqld[945]: 2018-12-19T10:57:54.444950Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is depreca
déc. 19 11:57:54 portable mysqld[945]: 2018-12-19T10:57:54.448362Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.24-0ubuntu0.18.04.1) s
déc. 19 11:57:54 portable mysqld[945]: 2018-12-19T10:57:54.460570Z 0 [ERROR] Could not open file '/var/log/mysql/error.log' for
déc. 19 11:57:54 portable mysqld[945]: 2018-12-19T10:57:54.460623Z 0 [ERROR] Aborting
déc. 19 11:57:54 portable mysqld[945]: Initialization of mysqld failed: 0
déc. 19 11:57:54 portable mysqld[945]: 2018-12-19T10:57:54.465847Z 0 [Note] Binlog end
déc. 19 11:57:54 portable mysqld[945]: 2018-12-19T10:57:54.466021Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
déc. 19 11:57:54 portable systemd[1]: mysql.service: Control process exited, code=exited status=1
déc. 19 11:57:54 portable systemd[1]: mysql.service: Failed with result 'exit-code'.
déc. 19 11:57:54 portable systemd[1]: Failed to start MySQL Community Server.
déc. 19 11:57:54 portable systemd[1]: mysql.service: Service hold-off time over, scheduling restart.
déc. 19 11:57:54 portable systemd[1]: mysql.service: Scheduled restart job, restart counter is at 1.
déc. 19 11:57:54 portable systemd[1]: Stopped MySQL Community Server.
déc. 19 11:57:54 portable systemd[1]: Starting MySQL Community Server...
déc. 19 11:57:54 portable mysqld[1007]: 2018-12-19T10:57:54.960646Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprec
déc. 19 11:57:54 portable mysqld[1007]: 2018-12-19T10:57:54.963967Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.24-0ubuntu0.18.04.1) 
déc. 19 11:57:54 portable mysqld[1007]: 2018-12-19T10:57:54.970004Z 0 [ERROR] Could not open file '/var/log/mysql/error.log' fo
déc. 19 11:57:54 portable mysqld[1007]: 2018-12-19T10:57:54.970062Z 0 [ERROR] Aborting
déc. 19 11:57:54 portable mysqld[1007]: Initialization of mysqld failed: 0
lines 1-21

OS: Ubuntu 20.04 focal / Kernel: x86_64 Linux 5.8.0-63-generic
Shell: bash 5.0.17 / DE: GNOME 3.36.5
CPU: Intel Core i3 540 @ 4x 3.067GHz
GPU: Intel Corporation Core Processor Integrated Graphics Controller (rev 18)

Hors ligne

#12 Le 19/12/2018, à 13:53

bruno

Re : [resolu] 127.0.0.1 : La connexion a échoué

Encore une erreur sur l'emplacement des logs :

 Could not open file '/var/log/mysql/error.log' for

Tu as dû faire un truc pas clair lors de ta migration…

Tu refais exactement les manipulations du #4 en remplaçant apache2 par mysql.

Mais tu risques d'avoir d'autres problèmes avec ces histoires de logs

Hors ligne

#13 Le 19/12/2018, à 13:54

mazarini

Re : [resolu] 127.0.0.1 : La connexion a échoué

déc. 19 11:57:54 portable mysqld[945]: 2018-12-19T10:57:54.460570Z 0 [ERROR] Could not open file '/var/log/mysql/error.log' for

Peut être qu'en créant /var/log/mysql, comme pour le problème de var/apache2
Par contre je ne connais pas le propriétaire. mysql.mysql ?


S'il existait une école de la politique, les locaux devraient être édifiés rue de la Santé. Les élèves pourraient s'habituer. (Pierre Dac)

Hors ligne

#14 Le 19/12/2018, à 14:26

dd

Re : [resolu] 127.0.0.1 : La connexion a échoué

youpidoo
J'ai réinstallé mysql et ça remarche

Merci pour votre aide


OS: Ubuntu 20.04 focal / Kernel: x86_64 Linux 5.8.0-63-generic
Shell: bash 5.0.17 / DE: GNOME 3.36.5
CPU: Intel Core i3 540 @ 4x 3.067GHz
GPU: Intel Corporation Core Processor Integrated Graphics Controller (rev 18)

Hors ligne