WordPress on OSX
Monday, September 7, 2009 8:26If you don’t have the luxury of a second computer or on-line Virtual Server it’s a good idea to have a local instance of WordPress for mirrored back and related development, under OSX Leopard this is quite easy to configure.
Firstly you need to install the server side of things (Apache, MySQL, php & phpMyAdmin), this is quite straightforward and I’ve a separate quick and easy ‘How To’ for that HERE.
Once you have the back-end sorted go into phpMyAdmin and create a new database called wordpress with global full privilege access for the root user
Next, download the latest version of WordPress from HERE, expand it and copy the contents (not the full folder) to your /sites directory, either into the root or to a created/named sub-folder depending on your preference for access (i.e http://localhost/ or http://localhost/<blogname>).
Look for wp-config.sample.php amongst the wordpress files and open it with a text editor, input the database name, user and password you created earlier (DB_HOST will invariably stay as localhost, I’ve never had to change it even for a server side install), re-save the file as wp-config.php.
To start the actual installation, access the location of the WP install file through your browser at either the root – http://localhost/wp-admin/install.php or at the named sub-folder location you created – i.e http://localhost/<blogname>/wp-admin/install.php), the installation will start and you’ll be presented with a login password for the admin account when it’s done, it literally takes but a few seconds.
To log in use the same URL but omit the install.php tag, once in you can manage and create just as you would for your web based version.
To mirror-import your blog out of it’s web location just use the export/import feature under the tools side menu (export from the web version & import to your local installation), you’ll have to manually set up your matched theme and plugins for a truly visual mirrored copy but the import procedure will offer the option to pull in your images which is quite cool. Bear in mind also that all pre-created hyperlinks are relational to your online instance only so won’t be relative locally, however this is merely a backup we’re working with as oppose to a fully functional live web facing version so it’s no big deal.
Even if you don’t fancy a fully mirrored local instance of your blog site it’s a VERY good idea to keep a periodic copy of just the exported .XML file for peace of mind in case the worst happens, it’s so quick and easy to do and the file takes up no space, I religiously save a fresh copy after every new post.



