У меня есть два виртуальных хоста, но Apache, кажется, по умолчанию для одного из них.
Вот хост № 1:
<VirtualHost *>
        ServerName goiclub.com
        ServerAlias www.goiclub.com *.goiclub.com
        ServerAdmin webmaster@localhost
        DocumentRoot /home/casey/public_html/goiclub/public
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /home/casey/public_html/goiclub/public>
                DirectoryIndex index.php index.htm index.html
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>
        ErrorLog /home/casey/public_html/goiclub/log/error.log
        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel debug
        CustomLog /home/casey/public_html/goiclub/log/access.log combined
        ServerSignature On
        Alias /doc/ /usr/share/doc/
        <Directory "/usr/share/doc/">
                Options Indexes MultiViews FollowSymLinks
                AllowOverride None
                Order deny,allow
                Deny from all
                Allow from 127.0.0.0/255.0.0.0 ::1/128
        </Directory>
</VirtualHost>
И это другой vhost:
<VirtualHost *>
ServerAdmin webmaster@geticlub.com
ServerName geticlub.com
ServerAlias www.geticlub.com *.geticlub.com
DirectoryIndex index.php
DocumentRoot /home/casey/public_html/geticlub/public
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /home/casey/public_html/geticlub/public>
                DirectoryIndex index.php index.htm index.html
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>
LogLevel debug
ErrorLog /home/casey/public_html/geticlub/log/error.log
CustomLog /home/casey/public_html/geticlub/log/access.log combined
</VirtualHost>
введите ли я goiclub.com или geticlub.com, он возвращает vhost «geticlub.com». Кто-нибудь знает почему?
Также это может быть полезно:
sudo apache2ctl -t -D DUMP_VHOSTS
apache2: Could not reliably determine the server's fully qualified domain name, using 50.56.118.158 for ServerName
VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
*:*                    geticlub.com (/etc/apache2/sites-enabled/geticlub.com:1)
*:*                    goiclub.com (/etc/apache2/sites-enabled/goiclub.com:1)
 