views:

125

answers:

3

I've got several domains setup in /etc/apache2/sites-enabled:

domain1.com
domain2.com
domain3.com

I need to setup webmail.domain*.com for each one. I can do this with individual vhost files for each, but is there a way to write a wildcard vhost to be caught by all domains?

Also, the same directory should be served by all webmail.*.com requests.

A: 

Despite my mean~ness, check out Apache's vhosts documentation looks like the answer is not. You need a FQDN, not a globbing character.

Suroot
+2  A: 

ServerAlias allows wildcards

vartec
I believe that's what my solution below employs. Thanks!
Nick Sergeant
A: 

Ah, here's what worked for me:

<VirtualHost *:80>
    ServerName webmail.domain.com
    ServerAlias webmail.*
    DocumentRoot /path/to/webmail
    UseCanonicalName Off
</VirtualHost>
Nick Sergeant

related questions