Set a local domain to ease local development
October 28th, 2009 - Command Line, Development, Tips & Tricks
If you’re a web developer you probably do a fair amount of development on your local machine using either the built-in Mac OS X Apache server or, in my case, something like MAMP. You can make your local development life a bit easier by setting a local domain, here’s how.
from the Mac Terminal type the following:
sudo nano /etc/hosts
this will bring up the /etc/hosts file in the nano editor, it will look something like this:
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
next, you’ll want to add the hostname (in this case, local.dev) you’d like to use locally to the end of that file on a new line, in the following format:
127.0.0.1 local.dev
Save the changes to /etc/hosts file by hitting Control-O and then Control-X to exit. Now you can access your local domain via the web browser, ftp, or whatever other means.
Posted by: Bill Ellis

Order Mac OS X 10.6 Snow Leopard today from Amazon.com - $25!

Write a comment