1

Given this configuration:

NameVirtualHost *:80
Listen 80

<VirtualHost *:80>
    ServerName default.example.com
</VirtualHost>
<VirtualHost *:80>
        ServerName    www.example.net
        ServerAlias   testy.example.net
</VirtualHost>
<VirtualHost *:80>
        ServerName    www.example.org
        ServerAlias   new.example.org
</VirtualHost>

Requests for www.* are served as I expect, the page(s) for the .net and .org sites are delivered.

However requests for the ServerAliases, new.example.org and testy.example.net, are fufilled from default.example.com

This is on Apache 2.2.22

/usr/sbin/apache2 -f -S only shows default servers ... so digging, digging further

  • Only difference with my config is that i've got listen 0.0.0.0:80 -S shows every servername vhost – GioMac May 05 '13 at 03:36

2 Answers2

0

Try with:

ServerName    example.net
ServerAlias   *.example.net
cahitonur
  • 1
  • 1
  • 1
    Hello and welcome to serverfault. Your response is not enough to count as an answer, these kind of proposals can merely be posted as a comment. Please make your reply more substantial and give an explanation why the proposed idea might work. – superuser0 May 04 '13 at 23:40
  • I guess I can't leave comments to other people's questions or answers since you need 50 points to leave comments. Anyways this reputation things are not for me already. Cheers. – cahitonur May 05 '13 at 20:39
0

OFM

My example should have read:

<VirtualHost *:80>
    ServerName    www.example.net
    ServerAlias   testy.example.net. otherhost.example.net
</VirtualHost>

My bind habit, on that one host, of specifying a FQDN with a terminating dot in this context yields a non-parsable name.

Nothing to see here, move along now.