httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vincent Bray" <nood...@gmail.com>
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 <rwhart@mchsi.com> wrote:
> Hi all,

Hi,

> 127.0.0.1    main.localhost
> 127.0.0.1    alternate.localhost

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

127.0.0.1 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).
See:

http://httpd.apache.org/docs/2.2/configuring.html#syntax

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

-- 
noodl

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