# Accidentally removed Cert

**URL:** <https://community.letsencrypt.org/t/accidentally-removed-cert/184696>\
**Category:** Help\
**Created:** [September 19, 2022, 9:11am UTC](https://community.letsencrypt.org/t/accidentally-removed-cert/184696 "2022-09-19T09:11:25Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![zzzniczxz](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/zzzniczxz/32/64065_2.png) [@zzzniczxz](https://community.letsencrypt.org/u/zzzniczxz)\
**Post date:** [September 19, 2022, 9:11am UTC](https://community.letsencrypt.org/t/accidentally-removed-cert/184696/1 "2022-09-19T09:11:25Z")

</div>

I want to remove this domain [mwiki.takylstudios.com](http://mwiki.takylstudios.com)  
but I did it manually.

I ran this command: rm -r /etc/letsencrypt/live/mwiki.taktylstudios.com

can't start the nginx due to this error: systemd[1]: Starting A high performance web server and a reverse proxy server...  
nginx[2264]: nginx: [emerg] cannot load certificate "/etc/letsencrypt/live/mwiki.taktylstudios.com\>  
nginx[2264]: nginx: configuration file /etc/nginx/nginx.conf test failed  
systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE  
systemd[1]: nginx.service: Failed with result 'exit-code'.  
systemd[1]: Failed to start A high performance web server and a reverse proxy s\>

My web server is (include version): ubuntu 20.4

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

I don't need that cert anymore that's why I deleted it but  
upon researching it should not be manually deleted ☹

---

<div class="post-metadata">

**Author:** ![Osiris](https://avatars.discourse-cdn.com/v4/letter/o/839c29/32.png) [@Osiris](https://community.letsencrypt.org/u/Osiris)\
**Post date:** [September 19, 2022, 12:21pm UTC](https://community.letsencrypt.org/t/accidentally-removed-cert/184696/2 "2022-09-19T12:21:58Z")

</div>

The contents of the `/live/` directory are symlinks to the most recent files in the corresponding `/archive/` directory. You can manually recreate the symbolic links.

---

<div class="post-metadata">

**Author:** ![zzzniczxz](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/zzzniczxz/32/64065_2.png) [@zzzniczxz](https://community.letsencrypt.org/u/zzzniczxz)\
**Post date:** [September 19, 2022, 12:44pm UTC](https://community.letsencrypt.org/t/accidentally-removed-cert/184696/3 "2022-09-19T12:44:28Z")

</div>

Hello, there are no files in /etc/letsencrypt/archive.

can you please elaborate on manually recreating the symbolic links?

---

<div class="post-metadata">

**Author:** ![Osiris](https://avatars.discourse-cdn.com/v4/letter/o/839c29/32.png) [@Osiris](https://community.letsencrypt.org/u/Osiris)\
**Post date:** [September 19, 2022, 2:43pm UTC](https://community.letsencrypt.org/t/accidentally-removed-cert/184696/4 "2022-09-19T14:43:39Z")

</div>

> [@zzzniczxz](#):
>
> there are no files in /etc/letsencrypt/archive

Where did the content of that directory go?

> [@zzzniczxz](#):
>
> can you please elaborate on manually recreating the symbolic links?

That's of no use if there are no contents in the `/archive/` directory. In that case you need to use a backup or, if no backup is available, issue a new certificate.

---

<div class="post-metadata">

**Author:** ![rg305](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/rg305/32/91314_2.png) [@rg305](https://community.letsencrypt.org/u/rg305)\
**Post date:** [September 19, 2022, 3:26pm UTC](https://community.letsencrypt.org/t/accidentally-removed-cert/184696/5 "2022-09-19T15:26:54Z")

</div>

> [@zzzniczxz](#):
>
> `rm -r /etc/letsencrypt/...`

Please don't do anything like that [ever again].  
Whatever you are trying to do, there should be an instruction for `certbot` to do it for you [correctly].

---

<div class="post-metadata">

**Author:** ![zzzniczxz](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/zzzniczxz/32/64065_2.png) [@zzzniczxz](https://community.letsencrypt.org/u/zzzniczxz)\
**Post date:** [September 20, 2022, 12:30am UTC](https://community.letsencrypt.org/t/accidentally-removed-cert/184696/6 "2022-09-20T00:30:36Z")

</div>

I mean there's a folder in archive but other domain name not [mwiki.takylstudios.com](http://mwiki.takylstudios.com) ☹

I also tried to issue a new cert with [mwiki.takylstudios.com](http://mwiki.takylstudios.com) but still same error I got \>.\<

---

<div class="post-metadata">

**Author:** ![zzzniczxz](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/zzzniczxz/32/64065_2.png) [@zzzniczxz](https://community.letsencrypt.org/u/zzzniczxz)\
**Post date:** [September 20, 2022, 12:31am UTC](https://community.letsencrypt.org/t/accidentally-removed-cert/184696/7 "2022-09-20T00:31:06Z")

</div>

Yes I will take note of that sir in my life, Thanks!

---

<div class="post-metadata">

**Author:** ![zzzniczxz](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/zzzniczxz/32/64065_2.png) [@zzzniczxz](https://community.letsencrypt.org/u/zzzniczxz)\
**Post date:** [September 20, 2022, 1:15am UTC](https://community.letsencrypt.org/t/accidentally-removed-cert/184696/8 "2022-09-20T01:15:01Z")

</div>

How bout reinstalling the nginx and certbot?

---

<div class="post-metadata">

**Author:** ![MikeMcQ](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/mikemcq/32/52772_2.png) [@MikeMcQ](https://community.letsencrypt.org/u/MikeMcQ)\
**Post date:** [September 20, 2022, 2:16am UTC](https://community.letsencrypt.org/t/accidentally-removed-cert/184696/9 "2022-09-20T02:16:47Z")

</div>

Would you show output of this? We can probably fix the damage

```nohighlight
ls -l /etc/letsencrypt/{live,archive,renewal}

```

And, don't just try to reinstall certbot. It won't help. What you have is an nginx config problem because you deleted files it still requires.

---

<div class="post-metadata">

**Author:** ![zzzniczxz](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/zzzniczxz/32/64065_2.png) [@zzzniczxz](https://community.letsencrypt.org/u/zzzniczxz)\
**Post date:** [September 20, 2022, 2:24am UTC](https://community.letsencrypt.org/t/accidentally-removed-cert/184696/11 "2022-09-20T02:24:35Z")

</div>

Here sir:

/etc/letsencrypt/archive:  
total 4  
drwxr-xr-x 2 root root 4096 Sep 10 12:08 [staging.taktylstudios.com](http://staging.taktylstudios.com)

/etc/letsencrypt/live:  
total 12  
-rw-r--r-- 1 root root 740 Feb 8 2022 README  
drwxr-xr-x 2 root root 4096 Sep 19 08:12 [mwiki.taktylstudios.com](http://mwiki.taktylstudios.com)  
drwxr-xr-x 2 root root 4096 Sep 10 12:08 [staging.taktylstudios.com](http://staging.taktylstudios.com)

/etc/letsencrypt/renewal:  
total 4  
-rw-r--r-- 1 root root 582 Sep 10 12:08 staging.taktylstudios.com.conf

btw I tried to recreate the cert of [mwiki.taktylstudios.com](http://mwiki.taktylstudios.com)

---

<div class="post-metadata">

**Author:** ![MikeMcQ](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/mikemcq/32/52772_2.png) [@MikeMcQ](https://community.letsencrypt.org/u/MikeMcQ)\
**Post date:** [September 20, 2022, 2:25am UTC](https://community.letsencrypt.org/t/accidentally-removed-cert/184696/12 "2022-09-20T02:25:43Z")

</div>

Ok, now please show:

```nohighlight
ls -l /etc/letsencrypt/live/mwiki.taktylstudios.com

```

EDIT:  
And also

```nohighlight
ls -l /etc/letsencrypt/live/staging.taktylstudios.com

```

---

<div class="post-metadata">

**Author:** ![zzzniczxz](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/zzzniczxz/32/64065_2.png) [@zzzniczxz](https://community.letsencrypt.org/u/zzzniczxz)\
**Post date:** [September 20, 2022, 2:26am UTC](https://community.letsencrypt.org/t/accidentally-removed-cert/184696/13 "2022-09-20T02:26:53Z")

</div>

ls -l /etc/letsencrypt/live/mwiki.taktylstudios.com  
total 0

---

<div class="post-metadata">

**Author:** ![MikeMcQ](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/mikemcq/32/52772_2.png) [@MikeMcQ](https://community.letsencrypt.org/u/MikeMcQ)\
**Post date:** [September 20, 2022, 2:27am UTC](https://community.letsencrypt.org/t/accidentally-removed-cert/184696/14 "2022-09-20T02:27:49Z")

</div>

Sorry, was too late, also this:

```nohighlight
ls -l /etc/letsencrypt/live/staging.taktylstudios.com

```

---

<div class="post-metadata">

**Author:** ![zzzniczxz](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/zzzniczxz/32/64065_2.png) [@zzzniczxz](https://community.letsencrypt.org/u/zzzniczxz)\
**Post date:** [September 20, 2022, 2:28am UTC](https://community.letsencrypt.org/t/accidentally-removed-cert/184696/15 "2022-09-20T02:28:21Z")

</div>

ls -l /etc/letsencrypt/live/staging.taktylstudios.com  
total 4  
-rw-r--r-- 1 root root 692 Feb 8 2022 README  
lrwxrwxrwx 1 root root 49 Sep 10 12:08 cert.pem -\> ../../archive/staging.taktylstudios.com/cert4.pem  
lrwxrwxrwx 1 root root 50 Sep 10 12:08 chain.pem -\> ../../archive/staging.taktylstudios.com/chain4.pem  
lrwxrwxrwx 1 root root 54 Sep 10 12:08 fullchain.pem -\> ../../archive/staging.taktylstudios.com/fullchain4.pem  
lrwxrwxrwx 1 root root 52 Sep 10 12:08 privkey.pem -\> ../../archive/staging.taktylstudios.com/privkey4.pem

---

<div class="post-metadata">

**Author:** ![MikeMcQ](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/mikemcq/32/52772_2.png) [@MikeMcQ](https://community.letsencrypt.org/u/MikeMcQ)\
**Post date:** [September 20, 2022, 2:31am UTC](https://community.letsencrypt.org/t/accidentally-removed-cert/184696/16 "2022-09-20T02:31:25Z")

</div>

OK, just one more but it's long. Then I can give good advice on what to do.

Please show result of `sudo nginx -T` (skip sudo if you don't need it). Place 3 backticks before and after the output like  
```  
output of: sudo nginx -T  
```

Or, upload the txt file created by doing `sudo nginx -T >upload.txt`

---

<div class="post-metadata">

**Author:** ![zzzniczxz](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/zzzniczxz/32/64065_2.png) [@zzzniczxz](https://community.letsencrypt.org/u/zzzniczxz)\
**Post date:** [September 20, 2022, 2:35am UTC](https://community.letsencrypt.org/t/accidentally-removed-cert/184696/17 "2022-09-20T02:35:06Z")

</div>

sure btw Thanks a lot for your time sir!

````nohighlight
nginx: configuration file /etc/nginx/nginx.conf test failed```

[upload.txt|attachment](upload://fprEVGUMf2UMGFJrVQzYCl7p3d.txt) (382 Bytes)
````

---

<div class="post-metadata">

**Author:** ![MikeMcQ](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/mikemcq/32/52772_2.png) [@MikeMcQ](https://community.letsencrypt.org/u/MikeMcQ)\
**Post date:** [September 20, 2022, 2:37am UTC](https://community.letsencrypt.org/t/accidentally-removed-cert/184696/18 "2022-09-20T02:37:13Z")

</div>

Oh, right, ack. OK, can you upload the nginx.conf file (might have to copy it to .txt file)

---

<div class="post-metadata">

**Author:** ![zzzniczxz](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/zzzniczxz/32/64065_2.png) [@zzzniczxz](https://community.letsencrypt.org/u/zzzniczxz)\
**Post date:** [September 20, 2022, 2:39am UTC](https://community.letsencrypt.org/t/accidentally-removed-cert/184696/19 "2022-09-20T02:39:21Z")

</div>

noted sir

[nginx.conf.txt](https://community.letsencrypt.org/uploads/short-url/rUWKqHvT6W9eMsz0FXesLnDYKVX.txt) (1.9 KB)

---

<div class="post-metadata">

**Author:** ![MikeMcQ](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/mikemcq/32/52772_2.png) [@MikeMcQ](https://community.letsencrypt.org/u/MikeMcQ)\
**Post date:** [September 20, 2022, 2:43am UTC](https://community.letsencrypt.org/t/accidentally-removed-cert/184696/20 "2022-09-20T02:43:20Z")

</div>

thanks. Give me a minute

---

<div class="post-metadata">

**Author:** ![MikeMcQ](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/mikemcq/32/52772_2.png) [@MikeMcQ](https://community.letsencrypt.org/u/MikeMcQ)\
**Post date:** [September 20, 2022, 2:45am UTC](https://community.letsencrypt.org/t/accidentally-removed-cert/184696/21 "2022-09-20T02:45:03Z")

</div>

show

```nohighlight
ls -l /etc/nginx/conf.d/*.conf
ls -l /etc/nginx/sites-enabled

```

[Next page](https://community.letsencrypt.org/t/accidentally-removed-cert/184696.md?page=2)
