• Blog
  • About
  • Contact

Setup Development Domains On OS X

Jake Bechtold | November 22, 2006

terminal_01

Back in the day, I did a lot of trial and error designing with the site (when I was working with word). However, I would have to set it up, then upload it to Geocities, then go back and fix. This, however, would have been nice, had I been running OS X.

What I’ve found today, is a way to set up a .dev domain name on your Mac for local developmemt.

1. First, fire up terminal and type in: sudo pico /etc/hosts
This will give you something like this screenshot.
2. Next, you’d want to type in: 127.0.0.1 yourdomain.dev
This basically tells your browser that yourdomain.dev should point to localhost and not try to search for it elsewhere.
3. After typing in that, you’ll want to save that file (Control+X). Keep Terminal open though.
4. Now we need to edit the httpd.conf file for Apache. For me, this is located in /private/etc/httpd/ though your setup could vary. Open up the file in your favorite code editor and do a quick search for “NameVirtualHost”. Make sure it’s not commented out. If it’s comment out, uncomment it out. If it’s not there, then add it. Either way, you should have a line with this: NameVirtualHost 127.0.0.1
5.Below that, we’ll add a VirtualHost rule to tell our yourdomain.dev where to point to.


ServerName yourdomain.dev
DocumentRoot “/Users/UserName/Development/yourdomain”

The DocumentRoot needs to be set to wherever your development folder is for whatever you are working on.
6. Finally, we need to save the file and then restart Apache. Restart Apache within Terminal by typing in something like sudo apachectl graceful (depending on your setup).

After restarting Apache, you should be good to go! Fire up your browser of choice and type in your new development domain and you should see your main index file!

Cool, uhu? Of course I won’t be able to try it out until tonight, but it’s a nice, neat trick if you’re someone who works on websites a lot.

How To Setup Development Domains On OS X [The Apple Blog via Digg]

Categories
Tech

« Ejector Use your Zune as a hard drive »

Search

Latest

  • Wired For Gadgets looking for writers!
  • Wired For Gadgets RELAUNCH coming soon!
  • Manic Monday XCIII: World Wide Web Weirdness!!
  • YouTwitFace DOES exist; Conan’s help not needed!
  • WWDC 2009: The Good, Bad, and the “Oh, I’m getting that!”

Archives

Navigation

  • Announcments
  • Downloads/Software
  • Experiments
  • Gadgets
  • Gear
  • Hardware
  • Help Desk
  • Internet
  • iPod + iTunes
  • Linux
  • Mac OS X
  • Manic Monday
  • News
  • Projects
  • Retro'd
  • Side Notes
  • Tech
  • Tips & Tricks
  • Windows

Writers

Log in

Apply to be a Writer


Terms Of Use/Privacy Policy
Wired For Gadgets is a powered by WordPress 2.8.3
This work is copyright © 2004-2010 Jake Bechtold unless otherwise noted.

A Division of Hogstroff Media