Tilde ~ not referring to home

I am getting the error

SSLCertificateFile: file ‘/etc/apache2/~/joebloggs/somesite_com.crt’ does not exist or is empty

Due to the following line written in default-ssl.conf

SSLCertificateChainFile ~/joebloggs/somesite_com.crt

In order to refer to the file home/joebloggs/joebloggs/somesite_com.crt

I’ve also used ../ to try and go up a directory when attempting to create a relative address to the crt, but this fails also. Anybody know what is going wrong?

Asked By: Stumbler


The tilde (~) referring to one’s $HOME directory is a bash (and other shells’) feature.

Apache does not support this feature.

You must specify the file as /home/joebloggs/joebloggs/somesite_com.crt

Answered By: waltinator

Apache uses the ~ to turn on "extended regular expression" evaluation in directives like Directory. Someone should have mentioned this I think.

For example (from manual):

<Directory ~ "^/www/.*/[0-9]{3}">
Answered By: gview