So, I got a brand new CentOS 8 server and I migrated from openSUSE Leap 15.1.
The configuration of Apache is pretty much the standard one and I simply added my own sites as includes under the /etc/httpd/sites.d/
directory.
My problem is that httpd is not starting when I use a specific self-signed certificate I use on my lab server for some years now! The error I get is the AH00016: Configuration Failed
which is not very helpful (SSL log files are empty).
Without the specific certificate, other SSL enabled sites (which use another certificate) are fine and httpd starts normally.
If I use the same (working) certificate to all sites, httpd start normally. If I remove the other sites and use just this one, httpd does not start. If I use the same (problematic) certificate to all sites, httpd does not start.
The certificate and the private key (obviously) match since I use them for ages, the permissions are correct, SELinux is not an issue and generally speaking I am very confused.
Here is what I did so far:
Check the if the certificate and key matches:
openssl pkey -in /etc/pki/tls/private/server_ukey.pem -pubout -outform pem | sha256sum
6bb8de59f3527df9b5cf25a4e52e5ae42682399d795a439d0ba57ee67c8bc4b7 -
openssl x509 -in /etc/pki/tls/certs/server_cert.pem -pubkey -noout -outform pem | sha256sum
6bb8de59f3527df9b5cf25a4e52e5ae42682399d795a439d0ba57ee67c8bc4b7 -
So, they match.
Check the permissions:
ls -lrt /etc/pki/tls/certs/server_cert.pem
-rw-r--r--. 1 root apache 1590 Feb 1 07:55 /etc/pki/tls/certs/server_cert.pem
ls -lrt /etc/pki/tls/private/server_ukey.pem
-rw-r-----. 1 root apache 887 Feb 1 07:55 /etc/pki/tls/private/server_ukey.pem
Note that even with 600 as permissions the error message is exactly the same!
Check if there is any syntax error:
httpd -t
Syntax OK
Check the Virtual Hosts configuration:
httpd -t -D DUMP_VHOSTS
10.0.0.1:80 is a NameVirtualHost
default server server.example.com (/etc/httpd/conf.d/_default_80.conf:2)
port 80 namevhost server.example.com (/etc/httpd/conf.d/_default_80.conf:2)
alias server
port 80 namevhost admin.news.example.com (/etc/httpd/sites.d/002-admin.f1.example.com.conf:1)
port 80 namevhost mysql.example.com (/etc/httpd/sites.d/003-mysql.example.com.conf:1)
port 80 namevhost phpipam.example.com (/etc/httpd/sites.d/005-phpipam.example.com.conf:1)
port 80 namevhost trd.example.com (/etc/httpd/sites.d/006-trd.example.com.conf:4)
alias trd
*:443 is a NameVirtualHost
default server server.example.com (/etc/httpd/conf.d/ssl.conf:40)
port 443 namevhost server.example.com (/etc/httpd/conf.d/ssl.conf:40)
port 443 namevhost trd.example.com (/etc/httpd/vhosts.d/006-trd.example.com.conf:19)
alias trd
So, nothing strange.
Any help would be appreciated.