0

I am trying to create a site for the outlook and thunderbird autoconfiguration, in both cases they are using a specific subdomain to pull the configuration xml.

You need to create the following entries in you dns

autodiscover.example.com
autoconfig.example.com

Then in apache, you have to create a virtualhost in port 80 and another one in port 443 (outlook only uses https)

  <VirtualHost *:80>
        ServerAdmin webmaster@localhost
        ServerName autodiscover.example.com
        ServerAlias autoconfig.example.com autodiscover.* autoconfig.*
        DocumentRoot /var/www/mail_discover

        <Directory /var/www/mail_discover>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
  </VirtualHost>

NOTE: that you can only use wildcards in the ServerAlias entry, not in the ServerName (apache.org)

aseques
  • 688
  • 4
  • 12
  • 26

1 Answers1

0

The main issue with this, and the original reason for this entry is when there are multiple wildcards in apache. Apache matches in strict order, so for example with:

0_vhost1.conf -> ServerAlias *.example.com
vhost2.conf -> ServerAlias webmail.example.com

It will always match the entry in 0_vhost1

aseques
  • 688
  • 4
  • 12
  • 26