"Apache2.service não está ativo, não pode recarregar"


10

Ao executar sudo service apache2 reload, recebo o erro:

apache2.service is not active, cannot reload

Saída de sudo service apache2 status

root@gamma:~# sudo service apache2 status
● 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: inactive (dead) since Sat 2016-10-15 08:23:11 UTC; 2h 28min ago
 Docs: man:systemd-sysv-generator(8)
Process: 2203 ExecStop=/etc/init.d/apache2 stop (code=exited,     status=0/SUCCESS)
Process: 2185 ExecStart=/etc/init.d/apache2 start (code=exited, status=0/SUCCESS)

Oct 15 08:23:10 gamma systemd[1]: Starting LSB: Apache2 web server...
Oct 15 08:23:10 gamma apache2[2185]:  * Starting Apache httpd web server apache2
Oct 15 08:23:11 gamma apache2[2185]: Action 'start' failed.
Oct 15 08:23:11 gamma apache2[2185]: The Apache error log may have more information.
Oct 15 08:23:11 gamma apache2[2185]:  *
Oct 15 08:23:11 gamma apache2[2203]:  * Stopping Apache httpd web server apache2
Oct 15 08:23:11 gamma apache2[2203]:  *
Oct 15 08:23:11 gamma systemd[1]: Started LSB: Apache2 web server.
root@gamma:~# sudo service apache2 reload
apache2.service is not active, cannot reload.
root@gamma:~#

Saída de error.log

root@gamma:/# sudo service apache2 force-reload
apache2.service is not active, cannot reload.
root@gamma:/# grep '15 08:23:' /var/log/apache2/error.log
root@gamma:/# zgrep -h 'Oct 15 08:23:' /var/log/apache2/error.log*
[Sat Oct 15 08:23:11.012917 2016] [ssl:emerg] [pid 2202] AH02562: Failed to configure certificate   bot.testingsite.cf:443:0 (with chain), check /etc/apache2/ssl/bot.testingsite.cf.crt
[Sat Oct 15 08:23:11.013037 2016] [ssl:emerg] [pid 2202] SSL Library Error:    error:0906D06C:PEM rou  tines:PEM_read_bio:no start line (Expecting: TRUSTED CERTIFICATE) -- Bad file contents or format -   or even just a forgotten SSLCertificateKeyFile?
[Sat Oct 15 08:23:11.013056 2016] [ssl:emerg] [pid 2202] SSL Library Error: error:140DC009:SSL rou  tines:SSL_CTX_use_certificate_chain_file:PEM lib
root@gamma:/#

Eu tentei habilitar o certificado SSL. A Namecheap me forneceu um arquivo e eu o usei no arquivo ..cf.crt. Depois de ver esse erro, tentei validar via método DCV. Mas ainda assim eu recebo esse erro. sudo service apache2 restartnão fornece nenhuma saída.


Podemos ver a saída do status do serviço sudo apache2?
Manuel Alvarez

@ManuelAlvarez Postagem editada
user9677832 15/16

1
Você também pode adicionar a saída degrep '15 08:23:' /var/log/apache2/error.log
Martin Thornton

Se não houver saída, execute zgrep -h 'Oct 15 08:23:' /var/log/apache2/error.log*.
Martin Thornton

Eu também tentei reiniciar o sistema operacional inteiro, mas não ajudou.
user9677832

Respostas:


16

Faz

apachectl stop

Emitirá uma mensagem de erro referente ao erro de sintaxe no /etc/apache2/apache2.confarquivo

Corrija isto.

Então faça

apachectl stop
/etc/init.d/apache2 start

Agora o recarregamento do apache2 funcionará

Faz

/etc/init.d/apache2 reload

Na verdade, isso foi há um mês e eu tive que reinstalar o SO. A propósito, obrigado pela resposta.
user9677832

Isso funcionou para mim!
Gthuo # 4/18
Ao utilizar nosso site, você reconhece que leu e compreendeu nossa Política de Cookies e nossa Política de Privacidade.
Licensed under cc by-sa 3.0 with attribution required.