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

Possible Duplicate:
Setting up httpd-vhosts.conf for multiple virtual hosts

Say I have dedicated ip I have all of the dns setup properly for two domains and

In my apache directory I have /var/www/a/ /var/www/b/

How do I setup the apache vhosts.conf file so that The ip ( goes to /var/www/, goes to /var/www/a, goes to /var/www/b ?

share|improve this question

marked as duplicate by splattne Dec 14 '11 at 6:53

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

gonna have to flag this questiona as it's been answered many times on SF already mate – iainlbc Dec 14 '11 at 4:59
up vote 1 down vote accepted

Use Name based virtual hosts

NameVirtualHost *:80

<VirtualHost *:80>
DocumentRoot /var/www/a

<VirtualHost *:80>
DocumentRoot /var/www/b

Depending on your distro the virtual hosts go in /etc/apache2/sites-enabled/ or just the bottom of /etc/httpd/conf/httpd.conf.

The slicehost articles are great for starting out with linux sysadmin/apache/etc.

share|improve this answer
Really appreciate the help. Was wondering how I might get the ip to go to the root directory? – tester Dec 14 '11 at 6:01

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