Move (or copy) keys to another directory

My domain is:volhealthservices.space

I ran this command:sudo snap install --classic certbot

It produced this output:
Successfully received certificate.
Certificate is saved at: /etc/letsencrypt/live/volhealthservices.space/fullchain.pem
Key is saved at: /etc/letsencrypt/live/volhealthservices.space/privkey.pem
This certificate expires on 2024-03-03.
These files will be updated when the certificate renews.
Certbot has set up a scheduled task to automatically renew this certificate in the background.
Deploying certificate
We were unable to find a vhost with a ServerName or Address of volhealthservices.space.
Which virtual host would you like to choose?


1: 000-default.conf Enabled
2: jdva.conf Enabled


Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 1
Successfully deployed certificate for volhealthservices.space to /etc/apache2/sites-available/000-default-le-ssl.conf
Error while running apache2ctl graceful.
httpd not running, trying to start
Action 'graceful' failed.
The Apache error log may have more information.

My web server is (include version):gophish 0.12.1
The operating system my web server runs on is (include version):Ubuntu 23.10
My hosting provider, if applicable, is:Digital Ocean VPS
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 :2.8.0

My Problem:
I'm using GoPhish to run a phishing simulation.
I was testing part of my setup with apache running and made some wrong selections (somewhere above)when installing certbot.
The current state is:

  • I am not running apache as gophish has its own admin and phishing servers.
  • gophish has a certificate installed (its own) but I want to use the LE cetrificate.
  • I need to replace the cert files in the gophish directory with the LE cert files.
  • I can probably point the gophish.conf file at the [DOMAIN] directory where the LE files are, but am wondering of I can move/copy the cert files - and what I have to do to make sure it works.
    (I'm a bit worried at the long path string to the LE dir I'll have to use in the conf file)
    Any guidance will be appreciated. Thanks

Welcome to the Let's Encrypt Community.

You can certainly use the existing path. You could also create a deply-hook.

You may also want to use staging server while you are testing things. Just don't forget to switch back to the production server when you have it working the way you want.

You will find details on both of those options in the User Guide — Certbot 2.6.0 documentation

4 Likes

If you point to the files that LE updates, you won't have to ever do anything else.
If you copy/move the cert files, then you will have to do that each time the cert is updated.

5 Likes

Thanks very much for the advice.
@linkp I will read the certbot reference. My mess-up was because I was using the apache server for testing, exacerbated by being a noob with gophish (and the rest). I'm in the middle of my phishing simulation campaign so won't rock the boat just yet. However will try swapping certs in a day or two.
@rg305 Thanks Rudy. Pointing the config at LE does sound the way to go.
I'll probably try both to get familiar with the process.Need to set myself up with max understanding for future simulations.
Your wisdom much appreciated, thanks!

5 Likes

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