As was foretold, we've added advertisements to the forums! If you have questions, or if you encounter any bugs, please visit this thread: https://forums.penny-arcade.com/discussion/240191/forum-advertisement-faq-and-reports-thread/

Cant rename localhost

EWomEWom Registered User regular
edited July 2009 in Help / Advice Forum
Hey, I'm trying to learn PHP, and how to use it with WAMP. One thing I"m supposed to do is rename local host and access it with that new name.

C:/WINDOWS/System32/Drivers/etc/hosts is the file I'm opening and modifying. The line I"m modifying is this:(using notepad)
127.0.0.1          localhost

I've taken out localhost, and replaced it with the name, I've put a space between localhost and the name, I've put localhost after the new name, but nothing takes. Even after taking localhost completely out, and replacing it with the new name,
http://localhost/
still works, as does
127.0.0.1

but no matter what I do, I can't get the new name to take.

Any ideas?

Whether they find a life there or not, I think Jupiter should be called an enemy planet.
EWom on

Posts

  • RhinoRhino TheRhinLOL Registered User regular
    edited July 2009
    uh, what? What's wrong with accessing it via localhost?

    Changing localhost might break stuff.

    Secondly, try creating a new entry (and leave localhost alone).

    thrid, you'll probably have to flush your dns and restart your webbrowsers after the change.

    Rhino on
    93mb4.jpg
  • VulpineVulpine Registered User regular
    edited July 2009
    You really shouldn't remove or change the entry for localhost - as Rhino said, it's likely to break programs which rely upon it being the loopback address. Provided you have a TCP/IP stack up, attempting to (for example) ping localhost is guaranteed to work; by changing the name, you remove that guarantee. On Mac OS X, the host file explicitly says:
    # localhost is used to configure the loopback interface
    # when the system is booting.  Do not change this entry.
    ##
    127.0.0.1       localhost
    

    What you can do is add additional entries which also point to 127.0.0.1. This is perfectly fine:
    127.0.0.1       localhost
    127.0.0.1       forums.penny-arcade.com
    

    although will, naturally, result in my inability to access these distinguished forums.

    Vulpine on
    [SIGPIC][/SIGPIC]
  • MisterGrokMisterGrok Registered User regular
    edited July 2009
    Why are you modifying your OS hosts file instead of the Apache .conf that has your hostname?

    MisterGrok on
    GamerTag: aintnodancer
Sign In or Register to comment.