I always enjoy improving the visual and functional aspects of this blog. These improvements usually involve small format changes or the addition of a new feature via a plugin. It’s often a little dangerous doing this in a live environment as one mistake can bring the whole blog down.

I’ve been thinking it would be nice to have a “test bed” copy of this blog somewhere where I could experiment off-line and then introduce well tested results. Well, I’ve done that this week.

You might remember I recently installed two versions of Linux (Ubuntu & OpenSuse) on a spare PC. To give me a platform for this blog testbed I decided I would make the OpenSuse side into a server where I could run a duplicate copy of my blog and WordPress 2.1.  Here’s how I did it.

200702161757
To duplicate my current hosted environment would require an Apache Web Server and MySQL database and some type of FTP Server. With a little investigation I found an excellent LAMP (Linux, Apache, MySQL, PHP) package that works with OpenSuse. The package is called  XAMPP for Linux and is a project of Apache Friends.
XAMPP is an easy to install Apache distribution containing MySQL, PHP and Perl. It also comes with an FTP server ((ProFTPd).  XAMPP is very easy to install and to use – just download, extract and start.  XAMPP is free and at the moment there are distributions for Linux, Windows, Mac OS X, and Solaris.  I’m a Linux novice and I was able to install this package without any problems what so ever.

XAMPP combines many different sofware packages into one packet. Here’s an overview over all packages.

Apache, MySQL, PHP, Perl, ProFTPD, phpMyAdmin, OpenSSL, Freetype, libjpeg, libpng, gdbm, zlib, expat, ming, Sablotron, libxml2, Webalizer, pdf class, ncurses, mod_perl, FreeTDS, gettext, IMAP C-Client, OpenLDAP (client lib), eAccelerator, mcrypt, mhash, SQLite, cURL, ZZIPlib, libxslt, phpSQLiteAdmin, FPDF

Once XAMPP was install I had a local hosting environment that closely duplicated the one I’m using online.  To access these functions I used the supplied tools that come with XAMPP and a FTP client.  The test site is accessible from any of my home PC’s by using the static local IP address of this Linux PC.

My next step was to download a copy of WordPress 2.1 (same version as I’m running Meandering Passage on) and installed it to this new local environment.  This worked as it would with any other new WordPress install.  I created a database on the XAMPP MySQL server and WordPress created the tables it required in the database.  I kept all the configurations and naming standards the same as my on-line copy.

Next I copied all my WordPress plugins and themes from my online environment to my my new test environment.

I then signed on to the test Admin Dashboard and activated and configured the plugins and the theme.  Any missing files, images or configurations I copied from my live site to the test site as needed.

Once this was done I had a working test environment but no data.  Using the WordPress back-up plugin I created a back-up of my live WordPress database and copied it to my test environment where it was restored to the new test database.  This gave me all the post and comments of my live blog in my test environment.

200702161825

Now I have an exact duplicate off-line copy of my Meandering Passage blog.  I can modify and test things in this environment without worrying that I might accidently take down my live environment.  This should help prevent any costly mistakes plus it can serve as a back-up for my live site.

I’m looking at ways to keep the data in sync.  Currently when I write a post or make a change I’m simply posting it to both environments, but I think I can script an automatic process to make my live environment the master copy and update my test environment from it each night.

I’m also considering using this Linux PC as a possible media  server and work it into my photo workflow.  Perhaps more on that later.

Technorati Tags: apache, blog, linux, mysql, opensuse, php, xampp

6 Comments

  1. thx for that post. It’s really useful!

  2. I have been meaning to do this for so long. Will give it a try and see how it works out. Thanks.

  3. Hi! I was surfing and found your blog post… nice! I love your blog. :) Cheers! Sandra. R.

  4. Thanks for this. I have XAMPP running but how do I access the server from my other PCs?