httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vincent Bray" <>
Subject Re: [users@httpd] Named Virtual Hosts on Apache on OS X 10.5 -Apache 2
Date Tue, 11 Dec 2007 03:12:08 GMT
On 11/12/2007, Bob Hartung <> wrote:
> Hi all,


>    main.localhost
>    alternate.localhost

That's fine. You can combine them in a single line too, so main.local alt.local

> 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>

Bzzt! You've missed out the leading slash in both DocumentRoots.
Without that the path is appended to ServerRoot, so apache is going to
be looking for /usr/Library/WebServer/...
There's also no need for the quotes unless there's a space in the path
(or hostname, as this applies to both DocumentRoot and ServerName).

> The line
> "Include /private/etc/apache2/extra/httpd-vhosts.conf" has been uncommented.
> In httpd.conf
>    DocumentRoot "/Library/WebServer"
>    <Directory "/Library/Webserver">
>        . . . .
>    </Directory>

Although the typical Mac uses a case insensitive filesystem, you'd
still be better off keeping case correct. In this case you have
Webserver rather than 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.

My freshly installed 10.5 has only an empty /etc/httpd, so I would
suggest you just delete the config file in that directory.


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