8

When running sudo service apache2 reload, I get the error:

apache2.service is not active, cannot reload

Output of 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:~#

Output of 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:/#

I tried to enable ssl certificate. Namecheap provided me a file & I used it on ..cf.crt file. After seeing this error I tried to validate via DCV method. But Still I get this error. sudo service apache2 restart does not give any output.

  • Can we see the output of sudo service apache2 status? – Manuel Alvarez Oct 15 '16 at 9:04
  • @ManuelAlvarez Post edited – user9677832 Oct 15 '16 at 11:01
  • 1
    Can you also add the output of grep '15 08:23:' /var/log/apache2/error.log – Martin Thornton Oct 15 '16 at 11:56
  • If there is no output, run zgrep -h 'Oct 15 08:23:' /var/log/apache2/error.log* instead. – Martin Thornton Oct 15 '16 at 20:32
  • I also tried to reboot entire OS , but it did not help. – user9677832 Oct 16 '16 at 10:19
14

Do

apachectl stop

It will throw an error message regarding syntax error in /etc/apache2/apache2.conf file

Correct it.

Then do

apachectl stop
/etc/init.d/apache2 start

Now reloading of apache2 will work

Do

/etc/init.d/apache2 reload
  • Actually, that was month ago and i had to reinstall OS . By the Way, Thank you for the answer. – user9677832 Nov 14 '16 at 8:28
  • This worked for me! – gthuo Oct 4 '18 at 5:04

protected by Community Apr 5 at 6:52

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.