# Slightly confused about SSL files and their locations

**URL:** <https://forum.virtualmin.com/t/slightly-confused-about-ssl-files-and-their-locations/104459>\
**Category:** Virtualmin Hosting Offers\
**Created:** [February 6, 2020, 5:14am UTC](https://forum.virtualmin.com/t/slightly-confused-about-ssl-files-and-their-locations/104459 "2020-02-06T05:14:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![arretx](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/arretx/32/328_2.png) [@arretx](https://forum.virtualmin.com/u/arretx)\
**Post date:** [February 6, 2020, 5:14am UTC](https://forum.virtualmin.com/t/slightly-confused-about-ssl-files-and-their-locations/104459/1 "2020-02-06T05:14:33Z")

</div>

For a given virtualhost, when I use Letsencrypt from the `Server Configuration -> SSL Certificate -> Let's Encrypt -> Request Certificate` button, the system spins and whirrs and spits out a few files.

This is where’s I’m confused.

The current certificate (CA, Key, Cert) for the virtual server is placed in `/home/<user>/domains/subdomain.domain.com` as `ssl.cert`, `ssl.key`, and `ssl.ca`, along with a few other variations.

The `/etc/letsencrypt/live` folder is a different story. It contains a myriad of files for each virtual server on my system, like:

`subdomain.domain1.com/cert.pem`  
`subdomain.domain1.com/fullchain.pem`  
`subdomain.domain1.com/privkey.pem`

Let’s Encrypt documentation expresses that Apache needs the full path to the `/etc/letsencrypt/live/.../fullchain.pem` file to satisfy the SSLCertificateKeyFile directive, yet in the virtual server’s apache \*.conf file, the directive points to the _other_ folders (/home//domains/…/ssl.cert).

In addition to that, there a) a bunch of folders under `/let/letsencrypt` for virtual servers that no longer exist, and b) duplicates of many servers that DO exist with appended sequential numbers after the .com, like .com-0001, .com-0002, etc.

I’d like to clean things up, but I need to understand what’s going on here that Virtualmin is doing that’s proprietary to Virtualmin.

Thoughts? Ideas?

---

<div class="post-metadata">

**Author:** ![Ilia](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/ilia/32/10185_2.png) [@Ilia](https://forum.virtualmin.com/u/Ilia)\
**Post date:** [February 6, 2020, 11:29am UTC](https://forum.virtualmin.com/t/slightly-confused-about-ssl-files-and-their-locations/104459/2 "2020-02-06T11:29:35Z")

</div>

> [@arretx](#):
>
> I’d like to clean things up, but I need to understand what’s going on here that Virtualmin is doing that’s proprietary to Virtualmin.

Actually _Virtualmin_ does absolutely nothing “proprietary” in this regard. It’s just using `certbot` and it does the work.

**Relevant:**

> **[Correct way to completely remove issued certificate(s) for a domain](https://community.letsencrypt.org/t/correct-way-to-completely-remove-issued-certificate-s-for-a-domain/7409/9)**
>
> The reason for deleting cert: For example, I began developing new version of site at new.site.com Then I need to issue cert for new.site.com Then, when development is ending, I switch domain site.com to the directory of test.site.com And I...

> **[Help needed to delete certificates](https://community.letsencrypt.org/t/help-needed-to-delete-certificates/58281)**
>
> I am very new to all this (try to learn something) and after messing around quite a bit, I need help to revoke/delete all certificates. Below are the info and let me know what else is needed: Run: certbot certificates (I followed the certbot...

---

<div class="post-metadata">

**Author:** ![chriswoods](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/chriswoods/32/109_2.png) [@chriswoods](https://forum.virtualmin.com/u/chriswoods)\
**Post date:** [February 6, 2020, 3:44pm UTC](https://forum.virtualmin.com/t/slightly-confused-about-ssl-files-and-their-locations/104459/3 "2020-02-06T15:44:25Z")

</div>

The -0001, -0002 thing has always happened to me (manually using certbot) when a new request for a domain (and possibly extra SANs, if you’ve included them) is successful, but the certificate is ‘partially overlapping’. Usually it’s when a combination of domains in your latest request did not exactly match those for a prior request where the primary domain name was the same.

As the requests weren’t identical, certbot does not overwrite the new one with the old, instead it increments the newly obtained certificate name with a -0001 to distinguish it.

(e.g. [https://community.letsencrypt.org/t/certbot-renew-created-a-second-set-of-domain-0001-certificates/82824/3](https://community.letsencrypt.org/t/certbot-renew-created-a-second-set-of-domain-0001-certificates/82824/3) , and other discussions)

To clean this up, you need to use certbot to delete the new -0001 and -0002 request, then delete the original certificate from the letsencrypt store, then make a fresh request for a cert.

`certbot certificates` at an SSH prompt should indicate the duplicates.

if I were sorting this manually, I would use certbot with `certbot unregister` using the output from the `certificates` command. I’m not sure how Webmin will take this, but it’s probably OK as you can just generate another LE request from the web interface and certbot will handle the deployment.

---

<div class="post-metadata">

**Author:** ![system](https://cdn.forum.virtualmin.com/uploads/default/original/2X/c/cd96d761e326db4b2bef94886a639109bd7a8e76.svg) [@system](https://forum.virtualmin.com/u/system)\
**Post date:** [April 30, 2020, 6:17am UTC](https://forum.virtualmin.com/t/slightly-confused-about-ssl-files-and-their-locations/104459/4 "2020-04-30T06:17:12Z")

</div>

Closed on April 30, 2020, 6:17am UTC


