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 have a local development server we have setup on a comcast business class connection with a single static ip. This is all routed through a DIR 655 router. Our issue is as follows: We have our main documentroot setup as /var/www/html of course, but the problem comes in when we try to setup our virtualhosts. We have a domain that resolves to the single static ip, and we need several sub domains. Normally you would just use a namevirtualhost pointed to the ip that you want to share, then setup the virtualhosts to meet your needs, but I don't see how this is possible with a single ip o nthe server. The ip is already sending everything to the /var/www/html documentroot directory. We're at a loss at this point. We figured an easy fix would be a second ip address, but how does one map two ip's to a single device on a low end router like the dir 655? Anyone out there have some advice?

Thanks in advance.

share|improve this question

migrated from Feb 3 '10 at 22:36

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

I'm not entirely sure that I understand your requirements… But, provided you don't need SSL, you can have as many virtual hosts on one IP as you'd like:

<VirtualHost *:80>
    ServerAlias foo
    DocumentRoot /var/www/example/
<VirtualHost *:80>
    DocumentRoot /var/www/spam/
share|improve this answer

This is strange... I have precisely the same setup as you do (Comcast business, DIR-655, etc...).

In your httpd.conf file, have you set the following?


share|improve this answer
I'm sorry if that seemed a little obvious, but your question is kind of vague. As long as you setup NameVirtualHost correctly and defined your VirtualHosts as David Wolever suggests, you should be set. The fact that you have only one IP address is not a problem. – tambler Feb 2 '10 at 23:32

Your Answer


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