A development environment using subdomains and rsync

Since the beginning of my tenure at George Eastman House, I’ve longed for the time to implement an honest-to-goodness development environment.   I’d flirted with purchasing a second hosting package to do development work, but if version of software weren’t sync’d, why bother having a development environment anyways?

Enter rsync.

rsync is an open source utility that provides fast incremental file transfer. rsync is freely available under the GNU General Public License and is currently being maintained by Wayne Davison.

I recently re-organized the files on the host, diving them up to keep library files out of the accessible document root, and to better organize files in general.

The overall layout is very similar to java source package layouts.  The home directory for the host contains directories that correspond with domain names, and each sub-domain (including www) is labeled as such inside the domain folder.  There is a mirror of this structure for any website files I wish to not ever directly serve (php libs, config files, etc.).

This yields a directory structure similar to the one depicted below:


www is, of course, mapped to www.eastmanhouse.org, and dev mapped to dev.eastmanhouse.org.

When I make a change, I make it to the files in the dev domain, and send a link to the user requesting the change. Upon their confirmation that the change is made to their liking, the result is pushed to production by calling rsync -auv, which is actually triggered by a web facing admin function (to save me from having to ssh in every time I have to make a small change.

So far, its working wonders.