Trouble with Auto Renew SSL Cert and Certbot

The file shown has no defined root nor ServerName.
Which means it is using the "defaults"
Sadly someone somewhere has taught all new web server admins to name their server by the first name in the first vhost.
This couldn't be more incorrect; as seen in this example - the default now conflicts with that first vhost.
They seem to have tried to fix this by putting the cert for that name.

But that doesn't remove the overlap.

Please change the main ServerName to "whatever" in the main config file.
Restart Apache
Rerun and show us that output:
sudo apachectl -S

1 Like

that directory path is not there

hmm... let's get this spaghetti straight, Rudy :wink:

1 Like

I must run for now. I know you've got this Rudy. :slightly_smiling_face:

I'll check back when I return for the congratulations.

can you please provide more info on what to change?

Sorry, I am just not following what file to change.

Sorry about the delay, it seems we both stepped out at the same time.

The file that is needed is the main config file.
If you don't know which that one is, try showing:
ls -l /etc/httpd/*.conf

1 Like

AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using audiopress-staging.bitpress.com. Set the 'ServerName' directive globally to suppress this message
VirtualHost configuration:
*:80 audiopress-staging.bitpress (/etc/httpd/conf/httpd.conf:43)
*:443 is a NameVirtualHost
default server audiopress-staging.bitpress.com (/etc/httpd/conf.d/ssl.conf:56)
port 443 namevhost audiopress-staging.bitpress.com (/etc/httpd/conf.d/ssl.conf:56)
port 443 namevhost audiopress-staging.bitpress.com (/etc/httpd/conf/httpd-le-ssl.conf:2)
alias audiopress-staging.bitpress.com
ServerRoot: "/etc/httpd"
Main DocumentRoot: "/var/www/html"
Main ErrorLog: "/etc/httpd/logs/error_log"
Mutex proxy-balancer-shm: using_defaults
Mutex rewrite-map: using_defaults
Mutex ssl-stapling-refresh: using_defaults
Mutex authdigest-client: using_defaults
Mutex lua-ivm-shm: using_defaults
Mutex ssl-stapling: using_defaults
Mutex proxy: using_defaults
Mutex authn-socache: using_defaults
Mutex ssl-cache: using_defaults
Mutex default: dir="/run/httpd/" mechanism=default
Mutex mpm-accept: using_defaults
Mutex cache-socache: using_defaults
Mutex authdigest-opaque: using_defaults
Mutex watchdog-callback: using_defaults
PidFile: "/run/httpd/httpd.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="apache" id=48
Group: name="apache" id=48

1 Like

Please show the output of this command:
ls -l /etc/httpd/*.conf

1 Like

That exact command doesn't work for me, but if I change to:

ls -l /etc/httpd/*conf

I get:

total 32
-rw-r--r-- 1 root root 12283 Oct 9 06:18 httpd.conf
-rw-r--r-- 1 root root 418 Oct 9 06:16 httpd-le-ssl.conf
-rw-r--r-- 1 root root 13064 Aug 24 18:54 magic

1 Like

OK please now show:
grep -i ServerName /etc/httpd/httpd.conf
or maybe it is:
grep -i ServerName /etc/httpd/conf/httpd.conf

[root@audiopress-staging conf]# grep -i ServerName /etc/httpd/conf/httpd.conf
  ServerName "audiopress-staging.bitpress.com"
# ServerName gives the name and port that the server uses to identify itself.
#ServerName audiopress-staging.bitpress.com:80

Ok edit this file:

as I mentioned before:

"the main config file" is /etc/httpd/conf/httpd.conf

Ok, sorry, I have changed it and then changed it back again a few times. I will do it again now.

1 Like

Do not set the main server name to "audiopress-staging.bitpress.com".
That is what is causing the problem.

AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using audiopress-staging.bitpress.com. Set the 'ServerName' directive globally to suppress this message
VirtualHost configuration:
*:80 whatever (/etc/httpd/conf/httpd.conf:43)
*:443 is a NameVirtualHost
default server audiopress-staging.bitpress.com (/etc/httpd/conf.d/ssl.conf:56)
port 443 namevhost audiopress-staging.bitpress.com (/etc/httpd/conf.d/ssl.conf:56)
port 443 namevhost audiopress-staging.bitpress.com (/etc/httpd/conf/httpd-le-ssl.conf:2)
alias audiopress-staging.bitpress.com
ServerRoot: "/etc/httpd"
Main DocumentRoot: "/var/www/html"
Main ErrorLog: "/etc/httpd/logs/error_log"
Mutex mpm-accept: using_defaults
Mutex cache-socache: using_defaults
Mutex authdigest-opaque: using_defaults
Mutex watchdog-callback: using_defaults
Mutex proxy-balancer-shm: using_defaults
Mutex rewrite-map: using_defaults
Mutex ssl-stapling-refresh: using_defaults
Mutex authdigest-client: using_defaults
Mutex lua-ivm-shm: using_defaults
Mutex ssl-stapling: using_defaults
Mutex proxy: using_defaults
Mutex authn-socache: using_defaults
Mutex ssl-cache: using_defaults
Mutex default: dir="/run/httpd/" mechanism=default
PidFile: "/run/httpd/httpd.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="apache" id=48
Group: name="apache" id=48

What did you change it to?

We are not making any progress.

Set it to:
localhost.localdomain._

I changed it from:
ServerName "audiopress-staging.bitpress.com"

to
ServerName "whatever"

I will change it to:
ServerName "localhost.localdomain._"

AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using audiopress-staging.bitpress.com. Set the 'ServerName' directive globally to suppress this message
VirtualHost configuration:
*:80 localhost.localdomain._ (/etc/httpd/conf/httpd.conf:43)
*:443 is a NameVirtualHost
default server audiopress-staging.bitpress.com (/etc/httpd/conf.d/ssl.conf:56)
port 443 namevhost audiopress-staging.bitpress.com (/etc/httpd/conf.d/ssl.conf:56)
port 443 namevhost audiopress-staging.bitpress.com (/etc/httpd/conf/httpd-le-ssl.conf:2)
alias audiopress-staging.bitpress.com
ServerRoot: "/etc/httpd"
Main DocumentRoot: "/var/www/html"
Main ErrorLog: "/etc/httpd/logs/error_log"
Mutex authdigest-opaque: using_defaults
Mutex watchdog-callback: using_defaults
Mutex proxy-balancer-shm: using_defaults
Mutex rewrite-map: using_defaults
Mutex ssl-stapling-refresh: using_defaults
Mutex authdigest-client: using_defaults
Mutex lua-ivm-shm: using_defaults
Mutex ssl-stapling: using_defaults
Mutex proxy: using_defaults
Mutex authn-socache: using_defaults
Mutex ssl-cache: using_defaults
Mutex default: dir="/run/httpd/" mechanism=default
Mutex mpm-accept: using_defaults
Mutex cache-socache: using_defaults
PidFile: "/run/httpd/httpd.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="apache" id=48
Group: name="apache" id=48

OK (that was my fault) we need one more step to make that "work".

We need to add a matching entry in file /etc/hosts
Please add to it:
127.0.0.1 localhost.localdomain._