Web Servers on Windows - Virtual Host error

This is Interesting: Free IT Magazines  
Home > Archive > Web Servers on Windows > June 2004 > Virtual Host error





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Virtual Host error
Ashley Swinson

2004-06-26, 10:55 am

I added the following code to my httpd.conf file to set up a virtual host:

NameVirtualHost 192.168.21.2

<VirtualHost 192.168.21.2>
DocumentRoot "C://sites/site1"
ServerName site1.com
</VirtualHost>

Then, I put the html code (site1.html) in the DocumentRoot.

Then, I added the following line of code to my HOSTS file:

192.168.21.2 site1.com

Now, when I open a browser and type in site1.com or 192.168.21.2, it gives
me this message:

"Forbidden
You don't have permission to access / on this server"

How to I fix this so that I/clients can view the webpage?


Jim Patterson

2004-06-26, 10:55 am

Ashley Swinson wrote:
> I added the following code to my httpd.conf file to set up a virtual host:
>
> NameVirtualHost 192.168.21.2
>
> <VirtualHost 192.168.21.2>
> DocumentRoot "C://sites/site1"
> ServerName site1.com
> </VirtualHost>
>
> Then, I put the html code (site1.html) in the DocumentRoot.
>
> Then, I added the following line of code to my HOSTS file:
>
> 192.168.21.2 site1.com
>
> Now, when I open a browser and type in site1.com or 192.168.21.2, it gives
> me this message:
>
> "Forbidden
> You don't have permission to access / on this server"
>
> How to I fix this so that I/clients can view the webpage?


You just need a Directory section, e.g.

<Directory C:/sites/site1>
Order allow,deny
Allow from all
</Directory>

That should fix it. By default, the Apache configuration locks down all
directories except its own default htdocs directory, for security
reasons. You need to open up any directories that you want to serve to
the world.

--
Jim Patterson
Ottawa, CANADA
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com