Virtual Host error
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Web Servers on Windows > Virtual Host error




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Virtual Host error  
Ashley Swinson


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-26-04 03:55 PM

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?







[ Post a follow-up to this message ]



    Re: Virtual Host error  
Jim Patterson


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-26-04 03:55 PM

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





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 08:31 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register