httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bob Hartung <rwh...@mchsi.com>
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:

127.0.0.1    main.localhost
127.0.0.1    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>

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

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

In httpd.conf
   DocumentRoot "/Library/WebServer"

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


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
      127.0.0.1  main etc.
2.  Is httpd-vhost.conf set up corectly?

TIA

Bob Hartung

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message