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

Sorry if this is answered somewhere else but can't figure it out. Cant get my server to respond on the subdomain, only the main domain. Relevant info below, if you need more let me know.

ServerName server.local:80 (i know a bit stupid but logical for me and it works)

ServerName www.server.local
ServerAlias server.local
DocumentRoot /var/www/html/

ServerName qtp.server.local
DocumentRoot /var/www/qtp/


Edit: Actually only the root works, neither virtualhost resolves. ie www.server.local doesn't resolve though server.local does

share|improve this question

Remove the ServerName directive outside of your <VirtualHost> containers.

share|improve this answer

You seem to be missing NameVirtualHost directive:

At the moment you're using IP-based virtual hosting in your configuration, which doesn't make sense as you use the same IP:port combinations.

share|improve this answer
Sorry, my bad. I thought I put that in. I used that link and changed what I had but no success, also updated original question – Rudiger Apr 21 '10 at 20:28
What response do you get from the subdomains? Are you able to ping through your subdomains? Or are you always getting the main page? – Karol Piczak Apr 22 '10 at 10:45

Your Answer


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