This is a discussion on Access apache virtual hosts within the Apache Web Server forums, part of the Web Server and Related Forums category; Hello, I have a network at home with 2 PCs with WinXp. On PC1 run's apache with some virtual ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hello,
I have a network at home with 2 PCs with WinXp. On PC1 run's apache with some virtual hosts. (see config below) If I write demo or demo1 or demo2 into the browser on PC1 it works fine. But how can I access them from the other computer? Thanks! NameVirtualHost 127.0.0.1 <VirtualHost 127.0.0.1> DocumentRoot "h:\web\demo" ServerName demo </VirtualHost> <VirtualHost 127.0.0.1> DocumentRoot "h:\web\demo1" ServerName demo1 </VirtualHost> <VirtualHost 127.0.0.1> DocumentRoot "h:\web\demo2" ServerName demo2 </VirtualHost> |
|
|||
|
You modify
C:\Windows\System32\drivers\etc\HOSTS and add an entry starting with the ip of the Apache server, then a tab, then demo1.. .Repeat but with demo2 in the last step.. :) -- // DvDmanDT MSN: dvdmandt€hotmail.com Mail: dvdmandt€telia.com ########################## Please, if you are using windows, you may be infected by Swen. Please go here to find out more: http://us.mcafee.com/virusInfo/defau...er&hcName=swen http://securityresponse.symantec.com...swen.a@mm.html ########################## "John M" <bali1a@freemail.hu> skrev i meddelandet news:Wwyrb.1049$ky5.42154@news.chello.at... > Hello, > > I have a network at home with 2 PCs with WinXp. On PC1 run's apache with > some virtual hosts. (see config below) > If I write demo or demo1 or demo2 into the browser on PC1 it works fine. > But how can I access them from the other computer? > > Thanks! > > NameVirtualHost 127.0.0.1 > > <VirtualHost 127.0.0.1> > DocumentRoot "h:\web\demo" > ServerName demo > </VirtualHost> > > <VirtualHost 127.0.0.1> > DocumentRoot "h:\web\demo1" > ServerName demo1 > </VirtualHost> > > <VirtualHost 127.0.0.1> > DocumentRoot "h:\web\demo2" > ServerName demo2 > </VirtualHost> > > |
|
|||
|
Change the IP address in you VirtualHost section to your LAN address.
127.0.0.1 is localhost. That is why the PC running Apache can see the pages and the other cannot. Give the PC running Apache a static IP address if possible. Chris DePetro RHCT "John M" <bali1a@freemail.hu> wrote in message news:Wwyrb.1049$ky5.42154@news.chello.at... > Hello, > > I have a network at home with 2 PCs with WinXp. On PC1 run's apache with > some virtual hosts. (see config below) > If I write demo or demo1 or demo2 into the browser on PC1 it works fine. > But how can I access them from the other computer? > > Thanks! > > NameVirtualHost 127.0.0.1 > > <VirtualHost 127.0.0.1> > DocumentRoot "h:\web\demo" > ServerName demo > </VirtualHost> > > <VirtualHost 127.0.0.1> > DocumentRoot "h:\web\demo1" > ServerName demo1 > </VirtualHost> > > <VirtualHost 127.0.0.1> > DocumentRoot "h:\web\demo2" > ServerName demo2 > </VirtualHost> > > |