Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We're having problem with a server config, and I hope I can get some help with this as its driving us mad!

Basically, we have an app set up at, and wildcard subdomains set up on the same domain, for users. We want to implement custom domains for users the same way tumblr does it for instance, so that the user creates a CNAME to his subdomain, for instance :  -> CNAME ->

After setting this up for one user though, his domain just routes to a server default page on our end. After getting in touch with plesk the response was this :

According to internal web servers logics, name based hosting works using hostname in HTTP header. Using only CNAME record in DNS will not work, due to DNS return us only new-server IP, and browser will go to that IP, but an old-server name still remains in HTTP headers.

And web-server after receiving such a request will work as it should, it will unsuccessfully try to find and open default virtual host, in our case Media Temple Server page.

Ok, cool. So we went to edit our config slightly. We're running Plesk 10.4, and under the wildcard subdomain we have a httpd.include file for vhosts.

In there we have this :

    ServerName ""
    ServerAlias  "*"
    UseCanonicalName Off


Now, we tried removing the ServerName and just keeping the Alias, and using /etc/init.d/httpd reload to reload the config, but we're still getting a Default Server Page.

We're stumped.

Has anyone had experience with this problem before, and is there a solution?

Thanks in advance, Warren

share|improve this question
up vote 2 down vote accepted

The browser will still send a Host: header, the CNAME record will not cause a redirect. You will therefore need ServerAlias in your configuration. It is in your application that you will need to associate to the user.

share|improve this answer
We're looking for a more dynamic solution though, where we dont have to manually add a ServerAlias each time we have a user. Tumblr does this with CNAMEs somehow. What about a catch all vhost and get the user to set up an A record to an ip on our end? – Warren Haskins Jun 20 '12 at 10:08
You already have your catch-all vhost, it apparently shows your "Default Server Page". Just put your application there and it will catch all requests that arrive at your server. For the browser it is irrelevant if you use CNAME or A records. It will always send the host name the user entered into the address field. – Oliver Jun 20 '12 at 11:08
Awesome. The only problem I can see is that we have 2 apps that need this functionality. We have no problem setting up a IP for each. Is there a default server page area for each, or do we need to alter the catch all for each domain and add the document root for each to where each app is now? – Warren Haskins Jun 20 '12 at 11:47
I think you could create a dispatcher application then, which redirects users to the respective application? Suppose that is subscribed to app1. If a request with Host: arrives at the dispatcher, you could e.g. redirect it to, which would be a virtual host on your server. But, honestly, a distict IP address for each application wouldn't be too bad. – Oliver Jun 20 '12 at 12:34

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.