Search code examples
macosterminalwp-calypso

mac terminal: Adding 127.0.0.1 calypso.localhost to localhost file


I am trying out wp-calypso which requires an addition to my localhost file. Via the terminal, I first typed

sudo vim /etc/localhost  

which took me here

...                                                                                                                                           

~                                                                                                                                            

~                                                                                                                                            

~                                                                                                                                            

~                                                                                                                                            

~                                                                                                                                            

"/etc/localhost" [New File]

I seem to be presented with a different screen than what's presented in the guide via https://www.howtogeek.com/howto/27350/beginner-geek-how-to-edit-your-hosts-file/

I then in the first line tried typing..

172.0.0.1      calypso.localhost                                                                                                                                          

~                                                                                                                                            

~                                                                                                                                            

~                                                                                                                                            

~                                                                                                                                            

~                                                                                                                                            

-- INSERT --

and realized I had no idea what to do next. Am I even in the right file? What would be my next steps?


Solution

  • On a mac, the file you are looking for is /etc/hosts, not /etc/localhost.

    Using nano:

    $ sudo nano /etc/hosts
    

    Enter your sudo password, then navigate your cursor to the end of the file and add the line for calypso:

    127.0.0.1    calypso.localhost
    

    Hit ctrl-x then y to save your hosts file.