I am wanting to conditionally load VirtualHosts depending on the existance of the appropriate key files required for SSL for that virtualhost (or failing which, have a generic certificate I can fall back to), and I've been unable to find a way to get Apache to do this.

I have come across the directive, which would appear to be what I'm looking for, but it keeps on complaining "Invalid command '

I'm using Apache 2.4.29 (Ubuntu) as packaged with Ubuntu 18.04.

I've tried configuring outside the directives, and also within it, bracketting the SSL configuration files.

It occurs to me that I might be missing a module, but according to my reading of the documentation this should be included in the core of Apache.

Can anyone shine light on why I IfFile is failing for me?

  • 1
    It says right there "Available in 2.4.34 and later". – Michael Hampton May 14 at 3:41
  • Yes, I just noticed that, and that is indeed the problem. Do you want to post this as an answer ? (Using ppa:ondrej/apache2 allowed me to upgrade to this version) – davidgo May 14 at 3:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.