Australian cloud for business software — built and run in Sydney since 2002

NetLeverage
NetLeverage

Apache AH00526: SSLCertificateFile "does not exist or is empty": Apache refuses to start

Technical article
Hosting

About this article: This article is reviewed against the cited sources. This is source research, not lab validation. Check the stated versions and your own requirements before making changes.

Apache httpd 2.4 prints AH00526: Syntax error on line 14 of /path/to/site.conf: and then SSLCertificateFile: file '/path/to/file' does not exist or is empty when the file named by the SSLCertificateFile directive is missing, is not a regular file, or has a size of 0 bytes. The configuration does not load, so Apache does not start, or a restart is refused. Correct the path, or put a real certificate file where the path points, run the configuration test, then start Apache.

What the error means

AH00526 itself is general. In the Apache 2.4.62 source, server/config.c logs Syntax error on line %d of %s: under the identifier 00526 for any directive that returns an error while the configuration is read. The text on the next line says which directive failed and why.

For this message, modules/ssl/ssl_engine_config.c in the same release returns the directive name, then : file ', then the path, then ' does not exist or is empty. The check behind it (modules/ssl/ssl_util.c) asks three questions of the path: does it exist, is it a regular file, and is its size above zero. Our own reading of that code: a directory, a link whose target is missing, and a file of 0 bytes all give this same message.

In the same source file the check also runs for SSLCertificateKeyFile, SSLCertificateChainFile and other mod_ssl file directives, and the message then starts with the failing directive's name. SSLCertificateFile and SSLCertificateKeyFile are valid in "server config, virtual host" context according to the mod_ssl page.

For SSLCertificateFile, the mod_ssl page says: "This file is read at server startup, while the server is still running as root (before privilege dropping)". It adds that the file "is not re-read during normal operation; a server restart is required for changes to take effect." A server that is already running therefore keeps its certificate until a restart. Our own reading: the fault often appears only at the next restart, reboot or graceful restart, after someone has moved or removed the files.

The apachectl page says restart and graceful check the configuration files "as in configtest" before they restart. A bad path therefore stops the command with this error.

A relative path is not read from the current directory. The core documentation says relative paths in directives "are taken as relative to" the ServerRoot directory. The source resolves the path with the server root before it checks the file, and the message prints the resolved path.

Likely causes

Cause What you see How to confirm
The path is mistyped, or names a different certificate than the one issued The path in the message is not a file you can find Compare it with the Certificate Path that certbot certificates prints
The certificate was deleted, or was never issued on this server certbot certificates does not list the name in the path The listing has no entry for that name
The file exists but has 0 bytes A listing of the file shows size 0 File size in a directory listing
The path is a directory, or a link whose target is gone A directory listing shows a directory or a broken link The path does not lead to a regular file
A relative path was resolved against ServerRoot The message shows a path that starts with the server root Compare the message with the value of ServerRoot
The failing directive is SSLCertificateKeyFile or another file directive The message starts with that directive name Read the first words of the second line

Prove the cause before changing anything

Every step in this section only reads.

  1. Run the configuration test. The apachectl page says configtest "reports Syntax Ok or detailed information about the particular syntax error".
apachectl configtest

A good result is Syntax Ok. A bad result is the AH00526 line, naming a file and a line number, followed by the does not exist or is empty line with the path.

  1. Open the file and line named in the AH00526 line. Note the directive and the exact path.

  2. Look at the path in a file listing. A good result is a regular file with a size above 0 bytes. A bad result is no such file, a size of 0, a directory, or a broken link.

  3. If Certbot issued the certificate, list what it knows. The Certbot user guide shows this command, and its output lists Certificate Name, Domains, Expiry Date, Certificate Path, Key Type and Private Key Path.

certbot certificates

A good result is a certificate whose Certificate Path and Private Key Path are the paths in your Apache configuration. A bad result is a different name, a number added to the name, or no entry.

  1. Find every configuration file that mentions the certificate. This is the Certbot guide's own search, with example.com replaced by your certificate name.
sudo bash -c 'grep -R live/example.com /etc/{nginx,httpd,apache2}'

Example (illustrative): on web01, apachectl configtest stops with AH00526: Syntax error on line 14 of /etc/apache2/sites-available/000-default-le-ssl.conf: and SSLCertificateFile: file '/etc/letsencrypt/live/example.com/fullchain.pem' does not exist or is empty. certbot certificates lists a certificate named example.com-0001 with Certificate Path /etc/letsencrypt/live/example.com-0001/fullchain.pem and Private Key Path /etc/letsencrypt/live/example.com-0001/privkey.pem. There is no live/example.com directory. Lines 14 and 15 of the configuration name the old directory, so the file is edited and both lines change.

Fix

Match the fix to the cause you proved.

The path is wrong

Certbot's guide says: "Rather than copying, please point your (web) server configuration directly to those files (or create symlinks)." It also says fullchain.pem "is what Apache >= 2.4.8 needs for SSLCertificateFile" and privkey.pem is what Apache needs for SSLCertificateKeyFile.

First save the current state, with the copy placed outside Apache's include patterns. Use the file named in your own AH00526 line; the path in the block is the example's. The POSIX cp page says -p duplicates the modification and access times, the user and group IDs and the permission bits of the source file.

cp -p /etc/apache2/sites-available/000-default-le-ssl.conf /root/000-default-le-ssl.conf.2026-12-04

Risk: the next edit changes which certificate and key files Apache loads at its next start. A wrong path keeps Apache from starting, and a path to the wrong certificate makes browsers show the wrong certificate.

Edit the file named in the AH00526 line. Set SSLCertificateFile to the Certificate Path that Certbot printed, and SSLCertificateKeyFile to the Private Key Path.

Risk, only if you back out: the next command overwrites the edited file with the saved copy, so every later change to that file is lost and the original path, with its error, returns.

To undo it, copy the saved file back over the edited one, using your own file name and the copy you saved (the paths in the block are the example's):

cp -p /root/000-default-le-ssl.conf.2026-12-04 /etc/apache2/sites-available/000-default-le-ssl.conf

Then check the restored file. Expect the same error that you started with:

apachectl configtest

The certificate was removed, or the file is empty

Certbot's guide says: "Do not manually delete certificate files from inside /etc/letsencrypt/. Always use the delete subcommand." It warns that "Deleting a certificate without following the proper steps can result in a non-functioning server", because Apache's configuration still points at the files. Our own reading: where certbot certificates no longer lists the certificate, the path in the Apache configuration has nothing behind it, and the choices are to point the directive at files that do exist (the path fix above) or to obtain the certificate again. An empty file is the same case: the path has no certificate behind it.

To obtain it again, Certbot's guide says certbot certonly can be used to "just obtain the certificate without installing it anywhere".

First save the current state: write down the output of certbot certificates and the time.

Risk: the next command requests a new certificate from the certificate authority and cannot be undone. Certbot's guide says a new certificate counts against several rate limits, and that if the name already exists Certbot updates the existing certificate. It changes no Apache configuration; the new files are used only after you set the paths (the path fix above) and start Apache.

certbot certonly -d example.com -d www.example.com

Use your own domain names. Certbot's guide also shows certonly with plugin options such as --webroot and --standalone; use the method the first issue used. Run certbot certificates again, and use its Certificate Path and Private Key Path in the path fix above.

Only if you need to back out: leave the new files unused, which changes nothing in Apache. Certbot's guide calls deleting a certificate with certbot delete --cert-name an irreversible operation that needs its steps for safely deleting certificates first.

Test, then start

Check the edited configuration first. This is a read-only step:

apachectl configtest

The expected result is Syntax Ok. If AH00526 is still printed, the new path has the same problem; go back to the checks above.

First save the current state. Write down whether Apache is running now and the time.

Disruptive step: the next command starts Apache with the new files, or, if it is already running, restarts its workers gracefully. The apachectl page says graceful differs from a normal restart in that "currently open connections are not aborted", and that it starts the daemon if it is not running. If Apache was stopped, the sites it serves go live on the new certificate.

apachectl graceful

Risk, only if you back out: the next command stops Apache, so every site it serves goes offline.

To undo it, if the value you wrote down was that Apache was not running, stop it again:

apachectl stop

Confirm the fix

  1. apachectl configtest prints Syntax Ok.
  2. Apache is running and answers on port 443.
  3. Open the site in a browser and look at the certificate details. The name and the Expiry Date are the ones Certbot lists.

What to watch afterwards

  • Our own advice: after every renewal Apache must load the new files, because it does not re-read them while running. Certbot's guide describes running executable files from /etc/letsencrypt/renewal-hooks/deploy after a renewal, and the --deploy-hook option of certbot renew.
  • Check certbot certificates after anything that touches /etc/letsencrypt, such as a server migration or a restore from backup. Our own reading: a restored configuration can point at files that were never restored.
  • If a site still shows an old certificate after a clean start, see Certbot renewed but the site still shows the old certificate: reload, deploy hooks and the right file.

Risks and limits

  • These commands have not been run or lab-tested.
  • Apache 2.4.62 prints this error text. Other 2.4 releases may word it differently; Apache's mod_ssl page for 2.4 carries the directive behaviour.
  • fullchain.pem as the value for SSLCertificateFile is the Certbot guide's advice for Apache 2.4.8 and later. Earlier releases need cert.pem and a separate chain file.
  • A certificate that exists but does not match the site name is a different fault.

Sources