Testing a Mac OS X web site using a local hostname on a mobile device

If you have a locally-hosted version of a web site for testing or development, you’ll almost certainly want to test it on a mobile device.

Let’s say the local site is hosted on Mac OS X, and you access it with a URL containing a hostname defined locally in the Mac’s “hosts” file, such as http://exampledev.com.

How can you test the site using the same URL on a mobile device (that is, a real mobile device, not an emulator)—without jailbreaking the device, using a DNS server, or paying for additional software? In this post I’ll describe a way to do exactly that.

Continue reading

Cloning a live WordPress site to a local Mac test environment

As you customize WordPress and extend its functionality with various plugins, and the usual barrage of software updates starts arriving, it becomes increasingly useful to have a local environment to try things out.

A local environment allows you to safely test new plugins and themes, new versions of existing plugins and themes, new versions of WordPress, and all sorts of other changes, without affecting the live site. If anything goes wrong, you can always roll the local site back to a known good state.

The steps necessary to create a local WordPress environment are already well documented. There are also instructions for moving an existing WordPress site from one server to another. By combining these together, you can work out how to make a clone of an existing self-hosted WordPress site in a new local test environment.

However, many of the steps are not obvious—especially if you created your live WordPress site via a one-click install, as I did, using Fantastico or similar—and some of the existing how-tos out there aren’t all that clear. Having gone through this process myself, and cloned a live WordPress site to a local Mac OS X environment, I thought it would be useful to describe the full end-to-end process in simple ABC steps.

Continue reading