I found the error. It was because I am using a script to setup the certificates, and one of the steps I am performing is apache2ctl configtest
. The error was coming from this command, and not from apache restart, which was what was misleading me. Since I was running the apache2ctl command as normal user, it had no access the the keyfiles, and thus the error message.
Facit: make sure all your apache commands are run with sudo, even the ones which are only intended for syntax verification (apache2ctl
), since they alse need access to the keys.