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

I'm trying to set up different domains on my vps server. The server has one ip-address and a DNS name on which it resolves.

I have created a virtual host through Webmin and configured my website for this user. Everything is working fine, except that when I add another virtualhost, I keep being redirected to the first virtualhost.

To make things a bit clearer, I have included my httpd.conf file:

ServerAdmin root@localhost
UseCanonicalName Off
DocumentRoot "/var/www/html"
<Directory />
    Options FollowSymLinks
    AllowOverride All
<Directory "/var/www/html">
    Options Indexes FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
<IfModule mod_userdir.c>
    UserDir public_html
<VirtualHost *>
DocumentRoot /home/domain2/public_html
<Directory /home/domain2/public_html>
allow from all
Options +Indexes
<VirtualHost *>
DocumentRoot "/home/domain3/public_html"
<Directory "/home/domain3/public_html">
allow from all
Options +Indexes

Any help would be more than appreciated, especially as I'm quite new around here.

share|improve this question

migrated from Oct 12 '11 at 13:19

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

You will need a

NameVirtualHost *

directive - try adding it just before you start declaring the VirtualHost sections

share|improve this answer
Great, thanks so much. This works. – Patrick Steenks Oct 12 '11 at 13:53

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.