httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bob Hartung <>
Subject [users@httpd] Named Virtual Hosts on Apache on OS X 10.5 -Apache 2
Date Tue, 11 Dec 2007 02:22:41 GMT
Hi all,
   I am new to Os X adn Apache.  I have httpd running and would like to 
establish virtual hosts on my laptop for testing/learning.

I have done the following for virtual hosts "main" and "alternate"

Added to /etc/hosts:    main.localhost    alternate.localhost

Original htdocs known as Documents was in /Library/WebServer/

I have added:
    for "main"  :  /Library/WebServer/main/Documents
    for "alternate" : /Library/WebServer/alternate/Documents

in /etc/apache2/extra/httpd-vhosts.conf I have this

NameVirtualHost *:80

<VirtualHost *:80>
   DocumentRoot  "Library/WebServer/main/Documents"
   ServerName    main.localhost

<Virtualhost *:80>
   DocumentRoot "Library/WebServer/alternate/Documents"
   ServerName  "alternate.localhost"

The line
"Include /private/etc/apache2/extra/httpd-vhosts.conf" has been uncommented.

In httpd.conf
   DocumentRoot "/Library/WebServer"

   <Directory "/Library/Webserver">
       . . . .

Also I note that there are two httpd.conf files.  One in /etc/httpd and 
the other in /etc/apache2/.  I am not, at this point sure which is used, 
so I have edited them to be identical.

So, my question:
1.  Is /etc/hosts correct or should it be  main etc.
2.  Is httpd-vhost.conf set up corectly?


Bob Hartung

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message