Bluehost.com Web Hosting $6.95

Virtual Host error

This is a discussion on Virtual Host error within the Windows Web Servers forums, part of the Web Server and Related Forums category; I added the following code to my httpd.conf file to set up a virtual host: NameVirtualHost 192.168.21....


Go Back   Usenet Forums > Web Server and Related Forums > Windows Web Servers

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 06-24-2004
Ashley Swinson
 
Posts: n/a
Default Virtual Host error

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?


  #2 (permalink)  
Old 06-26-2004
Jim Patterson
 
Posts: n/a
Default Re: Virtual Host error

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
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 10:08 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0