<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Getting things done with Ubuntu</title>
	<atom:link href="http://voices.canonical.com/darryl.weaver/feed/" rel="self" type="application/rss+xml" />
	<link>http://voices.canonical.com/darryl.weaver</link>
	<description>Some musings, howtos, recipes and general useful information</description>
	<lastBuildDate>Thu, 04 Apr 2013 01:12:44 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.2</generator>
		<item>
		<title>Juju Jitsu migrating a WordPress blog between Amazon EC2 and HP Cloud</title>
		<link>http://voices.canonical.com/darryl.weaver/2013/04/04/juju-jitsu-migrating-a-wordpress-blog-between-amazon-ec2-and-hp-cloud/</link>
		<comments>http://voices.canonical.com/darryl.weaver/2013/04/04/juju-jitsu-migrating-a-wordpress-blog-between-amazon-ec2-and-hp-cloud/#comments</comments>
		<pubDate>Thu, 04 Apr 2013 00:42:50 +0000</pubDate>
		<dc:creator>Darryl Weaver</dc:creator>
				<category><![CDATA[Juju]]></category>
		<category><![CDATA[Openstack]]></category>

		<guid isPermaLink="false">http://voices.canonical.com/darryl.weaver/?p=22</guid>
		<description><![CDATA[Introduction In this article I will show you how to set up a new WordPress blog on Amazon EC2 public cloud and then migrate it to HP Public Cloud using Juju Jitsu, from Canonical, the company behind Ubuntu. Prerequisites Amazon &#8230; <a href="http://voices.canonical.com/darryl.weaver/2013/04/04/juju-jitsu-migrating-a-wordpress-blog-between-amazon-ec2-and-hp-cloud/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h1>Introduction</h1>
<p>In this article I will show you how to set up a new WordPress blog on Amazon EC2 public cloud and then migrate it to HP Public Cloud using Juju Jitsu, from Canonical, the company behind Ubuntu.</p>
<h2>Prerequisites</h2>
<ul>
<li>Amazon EC2 Account</li>
<li>HP Public Cloud Account</li>
<li>Ubuntu Desktop or Server 12.04 or above with root or sudo access</li>
</ul>
<h2>Juju Environment Setup</h2>
<p>First of all we need to install Juju and Jitsu from the PPA archive to make it available for use, so first of all add the PPA to the installation sources:</p>
<pre><code>sudo apt-get -y install python-software-properties</code></pre>
<pre>sudo add-apt-repository ppa:juju/pkgs</pre>
<p>Now update apt and install juju, charm-tools and juju-jitsu</p>
<pre>sudo apt-get update
sudo apt-get install juju charm-tools juju-jitsu</pre>
<p>You will now need to set up your ~/.juju/environments.yaml file for Amazon EC2, see here: <a href="https://juju.ubuntu.com/get-started/amazon/">https://juju.ubuntu.com/get-started/amazon/</a></p>
<p>and then for HP cloud also, so see here:</p>
<p><a href="https://juju.ubuntu.com/get-started/hp-cloud/">https://juju.ubuntu.com/get-started/hp-cloud/</a></p>
<p>So you should end up with an environments.yaml file that will look something like this:</p>
<pre>default: amazon
environments:
amazon:
 type: ec2
 control-bucket: juju-b1bb8e0313d14bf1accb8a198a389eed
 admin-secret:[any-unique-string-shared-among-admins-u-like]
 access-key: [PUT YOUR ACCESS KEY HERE]
 secret-key: [PUT YOUR SECRET KEY HERE]
 default-series: precise
 juju-origin: ppa
 ssl-hostname-verification: true
hpcloud:
 juju-origin: ppa
 control-bucket: juju-hpc-az1-cb
 admin-secret: [any-unique-string-shared-among-admins-u-like]
 default-image-id: [8419]
 region: az-1.region-a.geo-1
 project-name: [your@hp-cloud.com-tenant-name]
 default-instance-type: standard.small
 auth-url: https://region-a.geo-1.identity.hpcloudsvc.com:35357/v2.0/
 auth-mode: keypair
 type: openstack
 default-series: precise
 access-key: [PUT YOUR ACCESS KEY HERE]
 secret-key: [PUT YOUR SECRET KEY HERE]</pre>
<h2>Deploying WordPress to Amazon EC2</h2>
<p>Now we need to bootstrap the Amazon EC2 environment.</p>
<pre>juju bootstrap -e amazon</pre>
<p>Check it finishes bootstrapping correctly after a few minutes using:</p>
<pre>juju status -e amazon</pre>
<p>Which should output something like this:</p>
<pre>machines:
  0:
    agent-state: running
    dns-name: ec2-50-17-169-153.compute-1.amazonaws.com
    instance-id: i-78d4781b
    instance-state: running
services: {}</pre>
<p>To give a good view of what is going on and to also allow modification from a web control panel we can deploy juju-gui to the bootstrap node, using juju-jitsu:</p>
<pre>jitsu deploy-to 0 juju-gui -e amazon

juju expose juju-gui -e amazon</pre>
<p>This will take a few minutes to deploy.<br />
Once complete you will see this from the output of &#8220;juju status -e amazon&#8221;, which should output something like:</p>
<pre>machines:
  0:
    agent-state: running
    dns-name: ec2-50-17-169-153.compute-1.amazonaws.com
    instance-id: i-78d4781b
    instance-state: running
services:
  juju-gui:
    charm: cs:precise/juju-gui-3
    exposed: true
    relations: {}
    units:
      juju-gui/0:
        agent-state: started
        machine: 0
        open-ports:
        - 80/tcp
        - 443/tcp
        public-address: ec2-50-17-169-153.compute-1.amazonaws.com</pre>
<p>Then use the &#8220;public-address&#8221; entry in your web browser to connect to juju-gui and see what is going on visually.</p>
<p>Juju-gui currently works well on Google Chrome or Chromium, it uses a Self-signed SSL certificate so you will be prompted to connect given a security warning which you can safely ignore and proceed.</p>
<p>Initially you should see the login page, with the username already filled in as &#8220;admin&#8221; and the password is the same as your password for the admin-secret in your ~/.juju/environments.yaml file.</p>
<p>Once logged in you should see a page that looks like this showing that only juju-gui is deployed to your environment, so far:</p>
<div id="attachment_25" class="wp-caption alignnone" style="width: 594px"><a href="http://voices.canonical.com/darryl.weaver/files/2013/04/juju1.png"><img src="http://voices.canonical.com/darryl.weaver/files/2013/04/juju1-1024x800.png" alt="Juju-gui screenshot" width="584" height="456" class="size-large wp-image-25" /></a><p class="wp-caption-text">First login</p></div>
<p>First we need to deploy a MySQL Database to store your blog&#8217;s data:</p>
<pre>juju deploy mysql -e amazon</pre>
<p>This will take a few minutes to deploy, so go ahead and also deploy a wordpress application server:</p>
<pre>juju deploy wordpress -e amazon</pre>
<p>While deployment continues you should see them appear in Juju-gui too<div id="attachment_26" class="wp-caption alignnone" style="width: 594px"><a href="http://voices.canonical.com/darryl.weaver/files/2013/04/juju-2.png"><img src="http://voices.canonical.com/darryl.weaver/files/2013/04/juju-2-1024x800.png" alt="Juju gui with wordpress and mysql deployed" width="584" height="456" class="size-large wp-image-26" /></a><p class="wp-caption-text">Showing MySQL and WordPress deployed</p></div>:</p>
<p>Once deployment is complete you can check the name of the new servers with:</p>
<pre>juju status -e amazon</pre>
<p>Which should output something like this:</p>
<pre>machines:
  0:
    agent-state: running
    dns-name: ec2-50-17-169-153.compute-1.amazonaws.com
    instance-id: i-78d4781b
    instance-state: running
  1:
    agent-state: running
    dns-name: ec2-23-22-68-159.compute-1.amazonaws.com
    instance-id: i-3a9bd554
    instance-state: running
  2:
    agent-state: running
    dns-name: ec2-54-234-249-131.compute-1.amazonaws.com
    instance-id: i-f9e56696
    instance-state: running
services:
  juju-gui:
    charm: cs:precise/juju-gui-3
    exposed: true
    relations: {}
    units:
      juju-gui/0:
        agent-state: started
        machine: 0
        open-ports:
        - 80/tcp
        - 443/tcp
        public-address: ec2-50-17-169-153.compute-1.amazonaws.com
  mysql:
    charm: cs:precise/mysql-16
    relations: {}
    units:
      mysql/0:
        agent-state: started
        machine: 1
        public-address: ec2-23-22-68-159.compute-1.amazonaws.com
  wordpress:
    charm: cs:precise/wordpress-11
    exposed: false
    relations:
      loadbalancer:
      - wordpress
    units:
      wordpress/0:
        agent-state: started
        machine: 2
        public-address: ec2-54-234-249-131.compute-1.amazonaws.com
</pre>
<p>Now we need to add a relationship between the wordpress application server and the MySQL database server.  This will set up the SQL backend database for your blog and configure the usernames and passwords and database tables needed, all automatically.</p>
<pre>juju add-relation wordpress mysql -e amazon</pre>
<p>Finally, we need to expose the wordpress instance so you can connect to it using your web browser:</p>
<pre>juju expose wordpress -e amazon</pre>
<p>Now your Juju gui should look like this:<br />
<a href="http://voices.canonical.com/darryl.weaver/files/2013/04/juju-4.png"><img src="http://voices.canonical.com/darryl.weaver/files/2013/04/juju-4-1024x800.png" alt="Juju Gui showing relations" width="584" height="456" class="alignnone size-large wp-image-27" /></a></p>
<h2>Setting up WordPress and adding your first post</h2>
<p>Then connect to the wordpress server using your web browser, by using the public-address from the status output above, i.e. http://ec2-54-234-249-131.compute-1.amazonaws.com/<br />
This will then show you the initial set up page for your wordpress blog, like this:<br />
<a href="http://voices.canonical.com/darryl.weaver/files/2013/04/wordpress-1.png"><img src="http://voices.canonical.com/darryl.weaver/files/2013/04/wordpress-1-1024x800.png" alt="" width="584" height="456" class="alignnone size-large wp-image-28" /></a></p>
<p>You will need to enter some configuration details such as a site name and password:<br />
<a href="http://voices.canonical.com/darryl.weaver/files/2013/04/wordpress-2.png"><img src="http://voices.canonical.com/darryl.weaver/files/2013/04/wordpress-2-1024x800.png" alt="" width="584" height="456" class="alignnone size-large wp-image-29" /></a></p>
<p>After you have saved the new details you will get a confirmation page:<br />
<div id="attachment_30" class="wp-caption alignnone" style="width: 594px"><a href="http://voices.canonical.com/darryl.weaver/files/2013/04/wordpress-3.png"><img src="http://voices.canonical.com/darryl.weaver/files/2013/04/wordpress-3-1024x800.png" alt="" width="584" height="456" class="size-large wp-image-30" /></a><p class="wp-caption-text">Confirmation Page</p></div></p>
<p>So, click on Login to login to your new blog on Amazon EC2.</p>
<p>Now in order to make sure we are testing a live blog we need to enter some data.  So, let&#8217;s post a blog entry.<br />
First click on New Post on the top left menu:<br />
<a href="http://voices.canonical.com/darryl.weaver/files/2013/04/wordpress-new-post.png"><img src="http://voices.canonical.com/darryl.weaver/files/2013/04/wordpress-new-post-1024x803.png" alt="" width="584" height="457" class="alignnone size-large wp-image-31" /></a></p>
<p>Now, type in the details of your new blog post and click on Publish on the top right:<br />
<a href="http://voices.canonical.com/darryl.weaver/files/2013/04/wordpress-5.png"><img src="http://voices.canonical.com/darryl.weaver/files/2013/04/wordpress-5-1024x803.png" alt="" width="584" height="457" class="alignnone size-large wp-image-32" /></a></p>
<p>Now you have a new blog on Amazon EC2 with your first blog entry posted.</p>
<h2>Migrating from Amazon EC2 to HP Cloud</h2>
<p>So, now we have a live blog running on Amazon EC2 it is now time to migrate to HP Cloud.</p>
<p>We could just run the commands above but using the extension &#8220;-e hpcloud&#8221; to deploy the services to HP Cloud and then migrate the data.<br />
But a more satisfying way is to use Juju-jitsu again to export the current layout from Amazon EC2 environment and then replicate that on HP Cloud.</p>
<p>So, we can use:</p>
<pre>jitsu export -e amazon &gt; wordpress-deployment.json</pre>
<p>This will save a file in JSON format detailing the deployed services and their relationships.</p>
<p>First we need to bootstrap our HP Cloud environment:</p>
<pre>juju bootstrap -e hpcloud</pre>
<p>This will take a few minutes to deploy a new instance and install the Juju bootstrap node.<br />
Once the bootstrap is complete you should be able to check the status by using:</p>
<pre>juju status -e hpcloud</pre>
<p>The output should be something like this:</p>
<pre>machines:
  0:
    agent-state: running
    dns-name: 15.185.102.93
    instance-id: 1064649
    instance-state: running
services: {}
</pre>
<p>So, let us now deploy the replica of the environment on Amazon to HP:</p>
<pre>jitsu import -e hpcloud wordpress-deployment.json</pre>
<p>This will then deploy the replicated environment from Amazon EC2. You can check progress with:</p>
<pre>juju status -e hpcloud</pre>
<p>When completed your output should be as follows:</p>
<pre></pre>
<p>So we now have a replica of the environment from Amazon EC2 on HP Cloud, but we have no data, yet.<br />
We also need to copy the SQL data from the existing Amazon EC2 MySQL database to the HP Cloud MySQL database to get all your live blog data across to the new environment.<br />
Let&#8217;s login to the MySQL DB node on Amazon EC2:</p>
<pre>juju ssh mysql/0 -e amazon</pre>
<p>Now we are logged in we can get the root password for the Database:</p>
<pre>sudo cat /var/lib/juju/mysql.passwd</pre>
<p>This will output the root password for the MySQL DB so you can take a copy of the data with:</p>
<pre>sudo mysqldump -p wordpress &gt; wordpress.sql</pre>
<p>When prompted copy and past the password that you recovered from the previous step.</p>
<p>Now exit the login using:</p>
<pre>exit</pre>
<p>Now copy the SQL backup file from Amazon EC2 to your local machine:</p>
<pre>juju scp mysql/0:wordpress.sql ./ -e amazon</pre>
<p>This will download the wordpress.sql file.<br />
You will now need to know your new wordpress server IP address for HP Cloud.<br />
You can find this from juju status:</p>
<pre>juju status wordpress -e hpcloud</pre>
<p>The output should look like this:</p>
<pre>machines:
  3:
    agent-state: running
    dns-name: 15.185.102.121
    instance-id: 1064677
    instance-state: running
services:
  wordpress:
    charm: cs:precise/wordpress-11
    exposed: false
    relations:
      db:
      - mysql
      loadbalancer:
      - wordpress
    units:
      wordpress/0:
        agent-state: started
        machine: 3
        public-address: 15.185.102.121
</pre>
<p>In order to fix your WordPress server name you will have to replace your Amazon EC2 WordPress public-address with your HP Cloud WordPress server public-address.<br />
So, you will need to do a find and replace in the wordpress.sql file as follows:</p>
<pre>sed -e 's/ec2-54-234-249-131.compute-1.amazonaws.com/15.185.102.121/g' wordpress.sql &gt; wordpress-hp.sql</pre>
<p>Obviously you will need to customise the command to replace your server addresses from Amazon and HP Cloud in the command above.<br />
<strong>NB:</strong>This step can be problematic and if you need more detailed information on changing the server name of a wordpress installation and moving servers see this more detailed instructions here:<br />
<a href="http://codex.wordpress.org/Moving_WordPress" title="Moving WordPress" target="_blank">http://codex.wordpress.org/Moving_WordPress</a></p>
<p>Now upload to your new HP Cloud MySQL server the database backup file, fixed with the new server public-address:</p>
<pre>juju scp wordpress-hp.sql mysql/0: -e hpcloud</pre>
<p>Now let&#8217;s import the data into your wordpress database on HP Cloud.<br />
First we need to log in to the database server, as before:</p>
<pre>juju ssh mysql/0 -e hpcloud</pre>
<p>Now let&#8217;s get the root password for the Database:</p>
<pre>sudo cat /var/lib/juju/mysql.passwd</pre>
<p>Now we can import the data using:</p>
<pre>sudo mysql -p wordpress &lt; wordpress-hp.sql</pre>
<p>And when you are prompted for the password enter the password you retrieved in the previous step, and then exit.</p>
<p>Finally you will still need to expose the wordpress instance on HP Cloud to the outside world using:</p>
<pre>juju expose wordpress -e hpcloud</pre>
<p>Now connect to your new wordpress blog migrated to HP Cloud from Amazon by connecting to the public-address of the wordpress node.<br />
You can find the address from the output of juju status as follows:</p>
<pre>juju status wordpress -e hpcloud</pre>
<p>The output should look like this:</p>
<pre>machines:
  3:
    agent-state: running
    dns-name: 15.185.102.121
    instance-id: 1064677
    instance-state: running
services:
  wordpress:
    charm: cs:precise/wordpress-11
    exposed: true
    relations:
      db:
      - mysql
      loadbalancer:
      - wordpress
    units:
      wordpress/0:
        agent-state: started
        machine: 3
        open-ports:
        - 80/tcp
        public-address: 15.185.102.121
</pre>
<p>Now connect to http://15.185.102.121/ and your blog is now hosted on HP Cloud.</p>
]]></content:encoded>
			<wfw:commentRss>http://voices.canonical.com/darryl.weaver/2013/04/04/juju-jitsu-migrating-a-wordpress-blog-between-amazon-ec2-and-hp-cloud/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Privacy of online searches in the Dash</title>
		<link>http://voices.canonical.com/darryl.weaver/2012/12/08/privacy-of-online-searches-in-the-dash/</link>
		<comments>http://voices.canonical.com/darryl.weaver/2012/12/08/privacy-of-online-searches-in-the-dash/#comments</comments>
		<pubDate>Sat, 08 Dec 2012 03:14:09 +0000</pubDate>
		<dc:creator>Darryl Weaver</dc:creator>
				<category><![CDATA[Ubuntu Desktop]]></category>

		<guid isPermaLink="false">http://voices.canonical.com/darryl.weaver/?p=14</guid>
		<description><![CDATA[There has been some controversy over the features being added to the Dash to allow online searching, such as searching Amazon and Google Docs, etc. in Ubuntu 12.10 Quantal Quetzal.  But it is easy to manage. If you work in &#8230; <a href="http://voices.canonical.com/darryl.weaver/2012/12/08/privacy-of-online-searches-in-the-dash/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>There has been some controversy over the features being added to the Dash to allow online searching, such as searching Amazon and Google Docs, etc. in Ubuntu 12.10 Quantal Quetzal.  But it is easy to manage.</p>
<p>If you work in a corporate environment or just want to retain privacy then you just need to modify the privacy features in the System Settings as follows:</p>
<p>Go to the top right of your screen and click on the System Menu and select System Settings.</p>
<p>In the System Settings window click on Privacy:</p>
<p><a href="http://voices.canonical.com/darryl.weaver/files/2012/12/Screenshot-from-2012-12-08-030939.png"><img class="alignnone size-medium wp-image-15" src="http://voices.canonical.com/darryl.weaver/files/2012/12/Screenshot-from-2012-12-08-030939-300x196.png" alt="" width="300" height="196" /></a></p>
<p>Then switch the online search from ON:</p>
<p><a href="http://voices.canonical.com/darryl.weaver/files/2012/12/Screenshot-from-2012-12-08-030202.png"><img class="alignnone size-medium wp-image-16" src="http://voices.canonical.com/darryl.weaver/files/2012/12/Screenshot-from-2012-12-08-030202-300x197.png" alt="" width="300" height="197" /></a></p>
<p>&nbsp;</p>
<p>To OFF:</p>
<p><a href="http://voices.canonical.com/darryl.weaver/files/2012/12/Screenshot-from-2012-12-08-031327.png"><img class="alignnone size-medium wp-image-17" src="http://voices.canonical.com/darryl.weaver/files/2012/12/Screenshot-from-2012-12-08-031327-300x196.png" alt="" width="300" height="196" /></a></p>
<p>Simple!</p>
]]></content:encoded>
			<wfw:commentRss>http://voices.canonical.com/darryl.weaver/2012/12/08/privacy-of-online-searches-in-the-dash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
