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....
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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? |
|
|||
|
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 |