Jan 29th
2009

How I Develop Locally Without Using Localhost

There are a couple of reasons why I just can’t get into developing locally.  Most of them revolve around testing my front-end work in all the browsers along with updating a database with relevant data, setting up host names on my machine and in my code.  (Sean Sperte ran a great article on how to do this on a Mac, so if this isn’t for you, I would encourage you to check out Sean’s tips)  I wanted to find a way that would work for me without using Localhost. 

What I came up with may not work for everyone’s needs, but it works great for me and I’m really happy with the system so far.

The first thing I do is setup a dev environment on a server.  I’m hosted at Dreamhost, so this is relatively simple.  I usually create a subdomain, something like dev.myproject.com, and protect it with htaccess.  Once I’ve setup my environment, I connect to the server with ExpanDrive so that I can edit the entire project in TextMate as if it’s a local directory.

ExpanDrive

Once I’ve mounted the drive, I can now launch Cornerstone and checkout a working copy of the repository.  I select the ExpanDrive mounted development environment as the location for where I’d like to check out the working copy.  This downloads the repository to my development environment.

Cornerstone

Now I have a working copy that is “local” thanks to ExpanDrive but also online as if I were editing on the server, again thanks to ExpanDrive.

By simply modifying a config file, I can still point to the production database if I need access to real data (as far as I know, CodeIgniter doesn’t have anything like rake:db), test my front-end development in any browser, etc.

All my changes can be tested on a live server, and then committed back to the repository where I can then go and check them out in the production environment and push them live.  

Like I said, this may not be for everyone, but for me, this is a great work flow that meets all my needs.  Perhaps it will give you ideas for ways to improve your work flow.

Next Post → ← Previous Post