Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

Hi I have this problem with a new rackspace cloud server.

i have an apache where the ServerName is set to the DocumentRoot is /var/www/html

and I have a few virtual hosts too which I want to have in this server

I got a seperate file called hosts.conf in the /etc/httpd/conf.d/ the content of it looks like this

NameVirtualHost *:80 

<Directory /var/domains>
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all

<VirtualHost *:80>
    DocumentRoot /var/domains/

<VirtualHost *:80>
    DocumentRoot /var/domains/

so the problem is when I add try to access the three websites,, and, all of them returns the content.

any help is appreciated


share|improve this question

migrated from Dec 25 '11 at 16:53

This question came from our site for professional and enthusiast programmers.

If your OS is debian based, you could use a2makesite – Shiplu Dec 24 '11 at 9:43
the os is centos – nivanka Dec 24 '11 at 9:46
Do you see any error? My VirtualHost entry is like <VirtualHost *> and I have NameVirtualHost * and Listen 80 in my apache configuration files. – Shiplu Dec 24 '11 at 9:52
What's the output of /usr/sbin/apache2ctl -t -DDUMP_VHOSTS? – Linus Kleen Dec 24 '11 at 10:06
Then check the access logs for each domain. If not so configured, then do this. It should tell you whether or not a request actually reaches the vhost and more importantly what the HTTP response code is. – Linus Kleen Dec 24 '11 at 11:22

Try NameVirtualHost ing each specifically:


and add the server name in the VirtualHost directive:

share|improve this answer
that didnt work – nivanka Dec 24 '11 at 10:04
@nivanka are you sure hosts.conf is being parsed? – Pekka 웃 Dec 24 '11 at 10:05
yes it is being parsed – nivanka Dec 24 '11 at 10:06

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.