--post-hook not restarting my server

So my issue is that the server does not restart after the --post-hook runs.

I have to manually type service apache2 start for the server to restart

I ran this command:
sudo certbot certonly --force-renewal --cert-name new.com --standalone --pre-hook “service apache2 stop” --post-hook “service apache2 start”

It produced this output:

everything looks as normal: last line of the output is

Running post-hook command: service apache2 start

My web server is (include version):

Ubunto 13.04

My hosting provider, if applicable, is:

I can login to a root shell on my machine (yes or no, or I don’t know):yes

I’m using a control panel to manage my site (no, or provide the name and version of the control panel):no

The version of my client is (e.g. output of certbot --version or certbot-auto --version if you’re using Certbot): 0.31.0

Hi @pstarmach,

It looks like you’re using certonly and trying to stop an existing Apache server and then start it again. I think a better approach would be to use the Certbot apache plugin, or, to use the webroot mode with the existing Apache server. In both cases this would avoid the need to stop the server and would avoid temporary downtime during the renewal process.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.