DevHeads.net

Postings by Adam Cecile

if statement and ssl directives (apache 2.4)

Hi,

I'm trying to achieve a simplier vhost configuration using if statements
but httpd refuses to start when I put SSL related directive inside the
if block:

<VirtualHost *:80 *:443>
  ServerName <a href="http://www.comptoir-hardware.com" title="www.comptoir-hardware.com">www.comptoir-hardware.com</a>
  ServerAlias <a href="http://www.comptoir-hardware.com" title="www.comptoir-hardware.com">www.comptoir-hardware.com</a>
  ServerAlias new.comptoir-hardware.com
  ServerAlias comptoir.co
  ServerAlias <a href="http://www.comptoir.co" title="www.comptoir.co">www.comptoir.co</a>

  <If "req('Port') == '443'">
    SSLEngine on
    SSLCertificateFile /etc/ssl/certs/comptoir-hardware.com.crt
    SSLCertificateKeyFile /etc/ssl/private/comptoir-hardware.com.key
    SSLCACertificateFile  /etc/ssl/certs/compt