httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joshua Slive <jsl...@gmail.com>
Subject Re: [users@httpd] DocumentRoot for Name-based Virtual Host
Date Wed, 14 Sep 2005 17:23:05 GMT
On 9/14/05, matt-nc <ncmail@triad.rr.com> wrote:
> I've created a name-based virtual host in Apache 2.0.54 and am trying to
> get it to serve docs out of a directory under /home instead of the default
> directory for localhost: /var/www/html.
> 
> I put the following in httpd.conf:
> 
> NameVirtualHost *:80
> 
> <VirtualHost *:80>
>         DocumentRoot /home/amos/local-web/php
>         ServerName php-web
> </VirtualHost>
> 
> 
> then I added the following to the hosts file:
> 
> 127.0.0.1       php-web
> 
> 
> I created a file, welcome.php and put it in /home/amos/local-web/php but
> when I put http://php-web/welcome.php into the browser I get an Access
> forbidden! Error 403.

And what does the error_log say?

> 
> And now when I put localhost or 127.0.0.1 or localhost/phpinfo.php into the
> browser they no longer work either.  I get the Access forbidden! Error 403
> message.
> 
> Can someone tell me how to get this set up correctly?  I would like to have
> some different name-based virtual hosts that will serve documents out of
> different directories under /home/amos/...

First, it looks like you haven't read the big box labled "Main host
goes away" on this page:
http://httpd.apache.org/docs/2.0/vhosts/name-based.html

Second, you have some permissions problem.  If you are using Fedora,
then you can't do what you want without turning off or modifying the
SELinux configuration.

Joshua.

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