|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Apache on LAN
Please forgive me if I'm in the wrong forum, or don't initially give you enough info because I'm in completly new waters here.
I have just recently networked a couple of computers with a DSL/Cable router. One of the boxes (Win2k) is running an Apache server that I'm not able to connect to from the other computer (Win XP). I can ping each computer from the other one, and I've been able to share files between them, so I don't *think* it's the network setup. I've turned off the DHCP on the router and assigned static IP's to each box. 192.168.0.2 (Win2k box) and 192.168.0.3 (XP box). Is there something I need to change in the Apache config file to get it to accept requests comming through the router? Thanks in advance. |
|
#2
|
|||
|
|||
|
You need to assign a hostname and domain name on both boxes, once you can ping yourself or the other by its FQDN, then you are ready.
Here is how to do that: Win2k -> C:\WINNT\system32\Drivers\etc\hosts WinXP -> C:\WINNT\system32\Drivers\etc\hosts (if upgraded from win2k) C:\Windows\system32\Drivers\etc\hosts Put: 127.0.0.1 localhost.YOUR_DOMAIN_HERE localhost 192.168.0.2 win2k.YOUR_DOMAIN_HERE win2k 192.168.0.3 winxp.YOUR_DOMAIN_HERE winxp |
|
#3
|
|||
|
|||
|
Thanks!
I can now ping them by name, and when I try to bring it up in the browser, I get the server root. I currently have virtual hosts setup like this: ServerName 127.0.0.1 UseCanonicalName Off NameVirtualHost 127.0.0.1 <VirtualHost 127.0.0.1> DocumentRoot C:\FoxServ/www/test.ponca ServerName test.ponca.com </VirtualHost> <VirtualHost 127.0.0.1> DocumentRoot C:\FoxServ/www/build.ponca ServerName build.ponca.com </VirtualHost> Do I need to change my VirtualHosts from 127.0.0.1 to 192.168.0.2 or just make a new virtual host container for each one for the network? Thanks again for your help. |
|
#4
|
|||
|
|||
|
1) You need to remove ServerName 127.0.0.1
2) Set NameVirtualHost to * 3) Don't use forward+backward slashs on the path. 4) Set <VirtualHost *> |
|
#5
|
|||
|
|||
|
Thanks freebsd
Just to make sure I haven't confused you in my own ignorance of these things, the line: ServerName 127.0.0.1 Is in section 1 of the config file. Should I just comment it out? |
|
#6
|
|||
|
|||
|
>> Is in section 1 of the config file
Yes, comment it out or remove that line. You don't need to define ServerName globally when your vhosts (within <VirtualHost> block) have their respective ServerName defined. |
|
#7
|
||||
|
||||
|
Thanks for your patience freebsd but I still can't seem to get it right.
I have the hosts files set up the same on both machines 127.0.0.1 localhost 127.0.0.1 test.ponca.com 127.0.0.1 build.ponca.com 192.168.0.2 Dads.com Dads win2k 192.168.0.3 family.com family winxp And I have made the changes you have suggested to the Apache config, i.e., Quote:
I can successfully ping family and family.com from the Win2k machine. I can successfully ping dads, dads.com, build.ponca.com, and teams.ponca.com from the WinXP machine. The problem still remains... when I try to bring up one of the sites on the Win2k box (Dads) from the WinXP box (family) it doesn't work. I don't know if this helps solve anything, but when I type http://dads.com into the browser on the WinXP box and check the properties of the page, under the general tab it says: Quote:
BTW, I can pull up all of the sites in question (dads, dads.com, build.ponca.com, and test.ponca.com) with no problems on the box (Win2k) that the server is running on. Thanks again! Last edited by butcher : February 19th, 2002 at 12:00 PM. |
|
#8
|
|||
|
|||
|
No, not that. You need to use the same local domain for all IPs, including 127.0.0.1 and 192.168.0.X.
Also, you can't set vhosts on loopback IP (127.0.0.1) because the other box can't reach it. Here is your hosts file: Code:
127.0.0.1 localhost.ponca.com localhost 192.168.0.2 test.ponca.com test 192.168.0.2 build.ponca.com build 192.168.0.2 dads.ponca.com dads 192.168.0.2 win2k.ponca.com win2k 192.168.0.3 family.ponca.com family 192.168.0.3 winxp.ponca.com winxp This assumes you run Apache on 192.168.0.2. Keep in mind, ponca.com resolves to 63.76.243.17 and it's a registered domain. You need to pick a nonexistence domain, that's why I was referring to local domain. If you use a registered domain, your will no longer be able to reach that site, because your hosts file intercept the requests and treat it as local. |
|
#9
|
|||
|
|||
|
Thank you freebsd!!
I appreciate your time, patience, and great wealth of knowledge. Everything seems to be working fine now. |
![]() |
| Viewing: Dev Shed Forums > System Administration > Apache Development > Apache on LAN |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|