httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rich Bowen <>
Subject Re: [users@httpd] Name based Virtual Hosting
Date Fri, 19 Mar 2004 19:57:09 GMT
On Fri, 19 Mar 2004, Marco Bascietto wrote:

> Hello all,
> I am having a very trivial problem with NMVH. Apache is a rather new 
> land for me and I can't figure out what I am doing wrong, even after 
> reading FAQ and manuals.
> Basically I want to set up 2 NMVH to make apache point to 2 sites I have 
> on my local machine.
> What I have done:
> 1. added the domains and to the hosts file, it 
> now looks like this:
>        localhost.localdomain localhost
> 2. added 2 VH to httpd.conf:
> NameVirtualHost http://localhost:80
> <VirtualHost http://localhost>
>     ServerName
>     DocumentRoot /var/www/html
> </VirtualHost>
> <VirtualHost  http://localhost>
>     ServerName
>     DocumentRoot /home/bask/documents/sites/foo2
> </VirtualHost>

This syntax for your vhosts is invalid. The argument to NameVirtualHost
and to <VirtualHost> is the address of the server, not the URL:

    DocumentRoot /var/www/html
    DocumentRoot /home/bask/documents/sites/foo2

> 3. called both and from the 
> browser. They both point to /var/www/html, the DocumentRoot of the first VH.
> The question is: how can I activate the second VH?

Use the syntax above.

> And secondly, when the second VH will work:
> a. what kind of file permissions should I give to its DocumentRoot? the 
> same owner:group as defined in httpd.conf?

The files need to be readable by that user, and the directory +x
(searchable) by that user. You don't want it owned by, or writeable by,
that user.

Nothing is perfect, certainly not me
Success to failure, just a matter of degrees
Working at perfect got me down on my knees
        (Working at perfekt - Geddy Lee)

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