O Apache2 falha ao reiniciar, o 'configtest' falhou nos logs 'systemctl status'

1

tentando iniciar meu apache2 depois do servidor da web do terminal

sudo service apache2 restart

mas diz

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

eu tento executar journalctl -xe e dizer

Nov 11 15:39:39 sd-101534 sshd[7011]: PAM service(sshd) ignoring max retries; 6 > 3
Nov 11 15:39:39 sd-101534 sshd[7013]: Failed password for root from 58.218.198.169 port 61692 ssh2
Nov 11 15:39:39 sd-101534 sshd[7013]: Received disconnect from 58.218.198.169 port 61692:11:  [preauth]
Nov 11 15:39:39 sd-101534 sshd[7013]: Disconnected from 58.218.198.169 port 61692 [preauth]
Nov 11 15:39:39 sd-101534 sshd[7013]: PAM 2 more authentication failures; logname= uid=0 euid=0 tty=ssh ruser= rhost=58.218.198.169  user=root
Nov 11 15:39:40 sd-101534 sshd[7015]: Failed password for root from 58.242.83.32 port 58820 ssh2
Nov 11 15:39:43 sd-101534 sshd[7035]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=58.242.83.20  user=root
Nov 11 15:39:43 sd-101534 sshd[7015]: Failed password for root from 58.242.83.32 port 58820 ssh2
Nov 11 15:39:43 sd-101534 sshd[7015]: error: maximum authentication attempts exceeded for root from 58.242.83.32 port 58820 ssh2 [preauth]
Nov 11 15:39:43 sd-101534 sshd[7015]: Disconnecting: Too many authentication failures [preauth]
Nov 11 15:39:43 sd-101534 sshd[7015]: PAM 5 more authentication failures; logname= uid=0 euid=0 tty=ssh ruser= rhost=58.242.83.32  user=root
Nov 11 15:39:43 sd-101534 sshd[7015]: PAM service(sshd) ignoring max retries; 6 > 3
Nov 11 15:39:45 sd-101534 sshd[7035]: Failed password for root from 58.242.83.20 port 37618 ssh2
Nov 11 15:39:48 sd-101534 sshd[7035]: Failed password for root from 58.242.83.20 port 37618 ssh2
Nov 11 15:39:48 sd-101534 sshd[7039]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=58.242.83.32  user=root
Nov 11 15:39:50 sd-101534 sshd[7039]: Failed password for root from 58.242.83.32 port 17432 ssh2
Nov 11 15:39:50 sd-101534 sshd[7035]: Failed password for root from 58.242.83.20 port 37618 ssh2
Nov 11 15:39:51 sd-101534 sshd[7037]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=58.218.198.169  user=root
Nov 11 15:39:52 sd-101534 sshd[7037]: Failed password for root from 58.218.198.169 port 48911 ssh2
Nov 11 15:39:52 sd-101534 sshd[7039]: Failed password for root from 58.242.83.32 port 17432 ssh2
Nov 11 15:39:53 sd-101534 sshd[7035]: Failed password for root from 58.242.83.20 port 37618 ssh2
Nov 11 15:39:55 sd-101534 sudo[7041]:   jazuly : TTY=pts/0 ; PWD=/home/jazuly ; USER=root ; COMMAND=/bin/journalctl -xe
Nov 11 15:39:55 sd-101534 sudo[7041]: pam_unix(sudo:session): session opened for user root by jazuly(uid=0)

então eu corro nano /var/log/apache2/error.log

eu tenho isso

$[Sat Nov 11 15:31:10.188122 2017] [mpm_prefork:notice] [pid 797] AH00169: caught SIGTERM, shutting down

eu corro sudo systemctl status apache2.service

● apache2.service - LSB: Apache2 web server
   Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)
  Drop-In: /lib/systemd/system/apache2.service.d
           └─apache2-systemd.conf
   Active: failed (Result: exit-code) since Sat 2017-11-11 15:42:06 CET; 16min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 6744 ExecStop=/etc/init.d/apache2 stop (code=exited, status=0/SUCCESS)
  Process: 25897 ExecReload=/etc/init.d/apache2 reload (code=exited, status=0/SUCCESS)
  Process: 7132 ExecStart=/etc/init.d/apache2 start (code=exited, status=1/FAILURE)

Nov 11 15:42:06 sd-101534 apache2[7132]:  * The apache2 configtest failed.
Nov 11 15:42:06 sd-101534 apache2[7132]: Output of config test was:
Nov 11 15:42:06 sd-101534 apache2[7132]: AH00526: Syntax error on line 12 of /etc/apache2/mods-enabled/mpm_prefork.conf:
Nov 11 15:42:06 sd-101534 apache2[7132]: Invalid command 'MazClients', perhaps misspelled or defined by a module not included in the server configuration
Nov 11 15:42:06 sd-101534 apache2[7132]: Action 'configtest' failed.
Nov 11 15:42:06 sd-101534 apache2[7132]: The Apache error log may have more information.
Nov 11 15:42:06 sd-101534 systemd[1]: apache2.service: Control process exited, code=exited status=1
Nov 11 15:42:06 sd-101534 systemd[1]: Failed to start LSB: Apache2 web server.
Nov 11 15:42:06 sd-101534 systemd[1]: apache2.service: Unit entered failed state.
Nov 11 15:42:06 sd-101534 systemd[1]: apache2.service: Failed with result 'exit-code'.

o que preciso fazer para que minha web volte ao normal.

    
por Jazuly 11.11.2017 / 15:47

1 resposta

2

Você tem uma opção de configuração inválida, e é por isso que o Apache não pode ser iniciado e porque diz 'configtest' failed . Na verdade, a leitura da saída de systemctl status geralmente é suficiente para identificar esses problemas e identificar os principais motivos pelos quais o seu software não está sendo executado corretamente. Eu vejo isso o tempo todo.

Dito isto, este é o erro específico, conforme detalhado na sua saída de status systemctl :

Nov 11 15:42:06 sd-101534 apache2[7132]: AH00526: Syntax error on line 12 of /etc/apache2/mods-enabled/mpm_prefork.conf:
Nov 11 15:42:06 sd-101534 apache2[7132]: Invalid command 'MazClients', perhaps misspelled or defined by a module not included in the server configuration

Edite o arquivo que ele faz referência ( /etc/apache2/mods-enabled/mpm_prefork.conf ) e tente substituir MazClients por MaxClients e tente iniciar o Apache novamente. Parece-me que o seu problema real é com o MPM Prefork e não com o MySQL.

    
por Thomas Ward 11.11.2017 / 16:05