[TriLUG] DocRoot for Name-based Virtual Host

Josh Vickery vickeryj at gmail.com
Wed Sep 14 09:10:22 EDT 2005


Your config snippets look ok to me.  I would check to make sure there
is not another virtual host directive that is overriding this
somewhere else.  NameVirtualHost *
<VirtualHost *>
...
for example.

On 9/12/05, matt-nc <ncmail at triad.rr.com> wrote:
> I'm trying to get a name-based virtual host to point to a directory under a
> user instead of the default directory for localhost.
> 
> I created a name-based virtual host in Apache2 by putting the following in
> httpd.conf:
> 
> NameVirtualHost *:80
> 
> <VirtualHost *:80>
>         DocumentRoot /home/amos/dev/php.dev
>         ServerName php.dev
> </VirtualHost>
> 
> then I added the following to the hosts file:
> 
> 127.0.0.1       php.dev
> 
> 
> Now when I put php.dev in the URL window of the browser it points to the
> default document root for localhost which is
> 
> /var/www/html
> 
> instead of where I want it to point:
> 
> /home/amos/dev/php.dev
> 
> Is it possible to do what I am trying to do?
> 
> Thanks,
> Matt
> 
> 
> --
> TriLUG mailing list        : http://www.trilug.org/mailman/listinfo/trilug
> TriLUG Organizational FAQ  : http://trilug.org/faq/
> TriLUG Member Services FAQ : http://members.trilug.org/services_faq/
> TriLUG PGP Keyring         : http://trilug.org/~chrish/trilug.asc
>



More information about the TriLUG mailing list