Re: apache virtual host on a private machine
"sweet_cheex" <sweet_cheeks_sf_nofriedspam42@pacbell.net> wrote in message
news:zFYug.68901$Lm5.34971@newssvr12.news.prodigy. com...
> I would just like to run some virtual hosts on my local machine for
> development purposes. I am not interested in anyone accessing these
> servers from the public, at all.
Thanks for your answers everyone. I figured out exactly what to do. This is
for:
OS: Windows XP
Web Server: Apache
Network: Small DHCP network (on larger networks YMMV)
Scenario: I want to run virtual hosts on my machine but I do not care about
them being accessible from the internet.
Caveats: I wouldn't mess with this method on a large internal network where
you don't know what IPs other devices/people are using. I also ONLY
guarantee this will work on a small internal network, and if you port your
machine around to various networks these settings will not work consistently
for you.
1. Open your command console and do "ipconfig." Note the IP address, subnet
mask, dns, and gateway.
2. Go into control panels>network settings>TCP/IP>properties. Click the
radio button "Use the following IP Address."
3. Add the IP address you noted above, the subnet mask, and DNS. In the same
panel, click "Advanced." This opens a panel which enables you to add more IP
addresses. Since you're on a NAT, you have a certain number of addresses
allocated by your router. Just increment the IPs. ***Again, I can't take
responsibility for how this would act on a larger DHCP network where someone
or some other device might already have been assigned the IP your are
using.*** Add however many more IP addresses you need for each apache
virtual host you want to run.
4. Click OK and close.
5. Add the IPs and names of hosts to your hosts file. In XP it's
C:\WINDOWS\system32\drivers\etc\hosts
6: The convention in the hosts file is as follows:
IP host
127.0.0.1 localhost
192.168.123.101 myServer
192.168.123.102 myOtherServer
192.168.123.103 mySpecialServer
7. Restart
8. Configure your apache httpd.conf file with IP virtual hosts using the IPs
and hostnames you just created.
Done.
|