"file '/etc/letsencrypt/live/homelistt.com/fullchain.pem' does not exist or is empty" Error in Ubuntu 20.04

Hi, first of all thank u for this community. I am not much experienced configuring a web server and i have a problem.

I have switched my php mod from prework to event and i installed php fpm. And then, to verify the MPM module i entered ( apachectl -M | grep 'mpm') command and it gave the output below. Probably this exists before switching the php mod. And i have two sites enabled under /etc/apache2/sites-enabled: homelistt.com.conf homelistt.com-le-ssl.conf
I uploaded their screenshots.

My question is why i am getting this output. What should i do thank you.

NOTE: I have checked and found two keys:
~$ sudo ls -l /etc/letsencrypt/keys
-rw------- 1 root root 1708 Apr 21 23:35 0000_key-certbot.pem
-rw------- 1 root root 1704 Apr 21 23:44 0001_key-certbot.pem

My domain is: homelistt.com

I ran this command: apachectl -M | grep 'mpm'

It produced this output:
AH00526: Syntax error on line 35 of /etc/apache2/sites-enabled/homelistt.com-le-ssl.conf:
SSLCertificateFile: file '/etc/letsencrypt/live/homelistt.com/fullchain.pem' does not exist or is empty

My web server is (include version): Apache/2.4.41 (Ubuntu)

The operating system my web server runs on is (include version): Linux

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 can login root shell

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

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

Welcome to the community @elvn

It looks like you lost the Let's Encrypt cert files. What does this show?

ls -lR /etc/letsencrypt

You should see symlinks in the live folder that point to the latest cert in archive folder.

3 Likes

hi @MikeMcQ

The results are like in screenshot.

1 Like

Oh, sorry, this would be better:

sudo ls -lR /etc/letsencrypt/{archive,live,renewal}

If you cannot capture all of the output in a screenshot, then add >temp.lst to the command and upload temp.lst file to your post. Thanks

3 Likes

No problem @MikeMcQ . The result is in screenshot

Good news. Your letsencrypt folders look good. Try:

sudo apachectl -M | grep 'mpm'

I think it is just a permissions thing

3 Likes

I already tried to change permission of /etc/letsencrypt/live file but it didn't work @ MikeMcQ

So you are saying you get the same "missing or empty file" error using sudo apachectl -M as you did in your first post?

3 Likes

Yes I just tried to change live file permission and the result was the same I gave 755 permission to live file

Please show result of this

sudo apachectl -t -D DUMP_VHOSTS
3 Likes

a) Don't change the permissions of the files without proper thinking. Haphazardly setting everything to 755 is NOT a smart thing to do!
b) Setting the permissions to symbolic links (which the files in the live directory are) doesn't matter at all.

4 Likes

sorry for the late answer @MikeMcQ . I think I misunderstood smt in command line. This command worked and now it is activated and the result of sudo apachectl -M command is " mpm_event_module (shared)" . Thanks.

Btw can i ask questions about my vhost file to this community if no can you advice a nice community like this one thank you.

1 Like

@Osiris u re right for that reason I changed the permission back like it was before. I was trying smt for solution. Btw can i ask questions about my vhost config file to this community if no can you advice a nice community like this one thank you.

1 Like

Glad you understand what was happening. And I agree with Osiris advice about being careful about changing permissions.

As for other VHost file questions, sure, ask. If it is at all related to Let's Encrypt or its config (https, redirects, hsts, stapling, ...) then certainly someone will answer. Sometimes we will even answer other questions :slight_smile:

5 Likes