For a while now, I have being toying with the idea to move away from a WordPress.com hosted site for this blog. The main reason: I am not really happy to have to pay for every single simple stuff.. add an additional URL to the site, take aways advertising, edit a CSS… it really stops me from playing 🙂
What had prevented me from doing this in the past was that I haven’t really got much experience setting up WordPress or MySQL. What I really needed was a save (and free) sandbox to try changes to my site, until I was happy with it, and then easily deploy it live… Can you say Juju?
With Juju you can do all your playing locally using LXC, save all the changes into a Charm and then just deploy them into a public cloud. Perfect!

The first thing I did was to set-up an Amazon AWS account and configure my juju environment to deploy to the public cloud. My rationale here was: if I can’t get vanilla WordPress in a live public site, then there is little point continuing with the experiment.
This was actually pretty easy, I just followed the Getting Started guide. The only stumbling block was that I was using my travel laptop at the time that didn’t have my launchpad ssh keys. You need to create ssh keys to use Juju, but apparently you also need to publish them into your launchpad account. Once this was done, I had a public WordPress instance in just 5 commands.
Next step: destroy the environment and stop paying 🙂 Now I needed to bring up my cheap sandbox.
Again this is pretty easy to setup, just follow the Getting Started guide. I hit another road block once my deployment instances seemed not be doing much, “juju status -e local” showed them in pending state and the logs did not display any activity…A bit of Googling later , I found that Jorge Castro had hit the same problem and found the solution in Ask Ubuntu.
With my WordPress local instance now fully up and running, now I needed to upload my own content. To do this, I just needed to upload the wordpress importer plugin. Fairly trivial to get gone by hand, thanks to the very useful “juju scp” and “juju ssh” commands, but how to do it via a Charm. I wanted to make sure that the next time a deploy wordpress, it would have already this plugin install. Crudly this is what I did:
- Using the charm-tools I got the wordpress charm loc ally (charm get wordpress)
- I then edited the install file under hooks/ to include:
apt-get -y install wordpress pwgen wget unzip
wget http://downloads.wordpress.org/plugin/wordpress-importer.0.6.zip
sudo unzip wordpress-importer.0.6 -d /usr/share/wordpress/wp-content/plugins/
- redeploy using locally stored charm. juju deploy –repository=~/charms local:precise/wordpress -e local
Guess what, it worked. I did get some warnings (WARNING Charm ‘.mrconfig’ has an error) that I am yet to iron out, but when the wordpress instance came up the new plugin was there:

That is all for today, and before I go, one last useful hint courtesy of James Page: Add “default: {name of your env}” if you have multiple environments but you normally always use one. Save me having to type “-e local” all the time.