# Fix Apache SSLCertificateFile Not Found After Certificate Renewal
After renewing your SSL certificate, Apache refuses to start:
[Thu Apr 08 06:00:01.234567 2026] [ssl:emerg] [pid 2345] AH02312: Fatal error initialising mod_ssl, exiting.
[Thu Apr 08 06:00:01.234568 2026] [ssl:emerg] [pid 2345] AH02563: Unable to configure RSA server private key
[Thu Apr 08 06:00:01.234569 2026] [ssl:error] [pid 2345] SSL Library Error: error:0B080074:x509 certificate routines:X509_check_private_key:key values mismatchOr:
AH02238: Unable to configure RSA server private key
AH02574: Init: Unable to set private key file `/etc/ssl/private/example.com.key'Apache cannot find or read the certificate or private key file specified in the SSL configuration.
Step 1: Verify File Paths
Check the paths in your Apache SSL configuration:
grep -r "SSLCertificate" /etc/apache2/sites-enabled/
# or for RHEL/CentOS
grep -r "SSLCertificate" /etc/httpd/conf.d/Common paths:
- /etc/letsencrypt/live/example.com/fullchain.pem (Let's Encrypt)
- /etc/ssl/certs/example.com.crt (custom certificate)
- /etc/apache2/ssl/example.com.pem (Debian default)
Verify each file exists:
ls -la /etc/letsencrypt/live/example.com/fullchain.pem
ls -la /etc/letsencrypt/live/example.com/privkey.pemStep 2: Check Symlink Validity
Let's Encrypt certificates are symlinks. If the renewal succeeded but the symlinks were not updated:
ls -la /etc/letsencrypt/live/example.com/
# Should show:
# fullchain.pem -> ../../archive/example.com/fullchain5.pem
# privkey.pem -> ../../archive/example.com/privkey5.pemIf the symlink points to a non-existent file:
sudo certbot renew --force-renewal
sudo systemctl reload apache2Step 3: Verify File Permissions
The Apache process must be able to read the certificate and key files. Check the permissions:
ls -la /etc/letsencrypt/live/example.com/
ls -la /etc/letsencrypt/archive/example.com/Certificate files should be readable by all:
sudo chmod 644 /etc/letsencrypt/live/example.com/fullchain.pem
sudo chmod 644 /etc/letsencrypt/live/example.com/cert.pemPrivate key files must be readable only by root and the Apache user:
sudo chmod 640 /etc/letsencrypt/live/example.com/privkey.pem
sudo chown root:ssl-cert /etc/letsencrypt/live/example.com/privkey.pem
sudo usermod -a -G ssl-cert www-dataOn RHEL/CentOS systems, the Apache user is apache:
sudo chown root:apache /etc/ssl/private/example.com.key
sudo chmod 640 /etc/ssl/private/example.com.keyStep 4: SELinux Context (RHEL/CentOS)
On SELinux-enabled systems, the security context matters:
ls -Z /etc/ssl/private/example.com.keyIf the context is wrong, Apache cannot read the file even with correct permissions. Fix it:
sudo restorecon -v /etc/ssl/private/example.com.key
sudo chcon -t cert_t /etc/ssl/private/example.com.keyOr set the correct context permanently:
sudo semanage fcontext -a -t cert_t "/etc/ssl/private(/.*)?"
sudo restorecon -Rv /etc/ssl/private/Step 5: Verify Certificate and Key Match
A common cause of SSL startup failure is a mismatched certificate and key:
openssl x509 -noout -modulus -in /etc/letsencrypt/live/example.com/fullchain.pem | md5sum
openssl rsa -noout -modulus -in /etc/letsencrypt/live/example.com/privkey.pem | md5sumBoth commands must output the same hash. If they differ, the certificate and key do not match -- you may have mixed up files from different renewals.
Step 6: Test Configuration Before Restart
Always test before restarting Apache:
sudo apachectl configtest
# or
sudo apache2ctl configtestOnly restart if the test passes:
sudo systemctl reload apache2Using reload instead of restart avoids dropping existing connections during the SSL reconfiguration.