HOSTS file


  1. Posts : 9
    windows 7
       #1

    HOSTS file


    I setup a hosts file in windows xp in order to use my website locally using the exact domain name by editing the hosts file by adding the line:

    127.0.0.1 www.test.com

    This should resolve my local ip address for the test.com site and if apache is running, then it should load the website into my browser. I edited the file using a web document editor that is run as the administrator and i edited the file in the c:\windows\system32\drivers\etc and i saved it with no problem. The thing is that if i try and open my test.com domain name in my browser, it says that the webpage cannot be displayed. I know from installing my apache that windows has two versions of file in the program files and if you save it, then instead of saving it to the program files folder, it instead saves it to c:\users\username\appdata\localstore.... which caused mw quite a lot of frustration. Has anyone had any success with doing this in windows 7?
      My Computer


  2. Posts : 2,737
    Windows 7 Enterprise (x64); Windows Server 2008 R2 (x64)
       #2

    So the host file is on the XP machine with apache running?? Or is apache running on another machine??

    It would be best to just use the address of the machine that has the web site on it. So if say 192.168.1.2 is where apache is then edit your host file with that IP address. You can do that in all the internal machines so they will stay on the local network and not access the internet.

    On the web server (apache) machine type ipconfig in a command prompt to get the IP address.
      My Computer


  3. Posts : 22,814
    W 7 64-bit Ultimate
       #3
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 09:31.
Find Us