<?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>Jayway Team Blog &#187; linux</title>
	<atom:link href="http://blog.jayway.com/tag/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.jayway.com</link>
	<description>Sharing Experience</description>
	<lastBuildDate>Sat, 28 Jan 2012 15:53:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Getting Android SDK working on Ubuntu 64</title>
		<link>http://blog.jayway.com/2009/10/21/getting-android-sdk-working-on-ubuntu-64/</link>
		<comments>http://blog.jayway.com/2009/10/21/getting-android-sdk-working-on-ubuntu-64/#comments</comments>
		<pubDate>Wed, 21 Oct 2009 20:22:34 +0000</pubDate>
		<dc:creator>Johan Haleby</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://blog.jayway.com/?p=2110</guid>
		<description><![CDATA[Today I was trying to setup the Android SDK (version 1.6_r1) on the 64 bit version of Ubuntu 9.04 (Jaunty Jackalope). After having installed the ADT Eclipse plugin and pointed out the Android SDK directory in the settings I immediately ran into the following error: Failed to get the adb version: Cannot run program "/home/johan/devtools/android/android-sdk-linux_x86-1.6_r1/tools/adb": [...]]]></description>
			<content:encoded><![CDATA[<p>Today I was trying to setup the Android SDK (version <a href="http://developer.android.com/sdk/download.html?v=android-sdk-linux_x86-1.6_r1.tgz">1.6_r1</a>)  on the 64 bit version of Ubuntu 9.04 (Jaunty Jackalope). After having installed the <a href="http://dl.google.com/android/ADT-0.9.3.zip">ADT</a> Eclipse plugin and pointed out the Android SDK directory in the settings I immediately ran into the following error: </p>
<pre>
Failed to get the adb version: Cannot run program "/home/johan/devtools/android/android-sdk-linux_x86-1.6_r1/tools/adb": java.io.IOException: error=2, No such file or directory
</pre>
<p>I opened the terminal and tried to manually run an Android executable but even here it said that the file couldn't be found! The problem seemed to be that the Android executables requires 32 bit libraries that are not available in Ubuntu 64 by default. To solve this I downloaded the execellent <a href="http://frozenfox.freehostia.com/cappy/getlibs-all.deb">getlibs</a> application which is a utility for automatically resolving dependencies for 32-bit programs on a 64 bit system. So I went into <code>platforms/android-1.6/tools</code> in the Android SDK installation folder and executed:</p>
<pre class="bash">&nbsp;
getlibs aapt
&nbsp;</pre>
<p>which installed and upgraded the following libraries:</p>
<pre class="bash">&nbsp;
The following NEW packages will be installed:
  ia32-libs lib32asound2 lib32gcc1 lib32ncurses5 lib32stdc+<span style="color: #000000;">+6</span> lib32z1
  libc6-i386
The following packages will be upgraded:
  libc6 libc6-dev
&nbsp;</pre>
<p>After this was done I went back into Eclipse, did a project clean and refresh and after that I was able to start the Android emulator successfully. Hopefully this may help someone who's in the same situation.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jayway.com/2009/10/21/getting-android-sdk-working-on-ubuntu-64/feed/</wfw:commentRss>
		<slash:comments>41</slash:comments>
		</item>
		<item>
		<title>Blogging Among the Clouds</title>
		<link>http://blog.jayway.com/2009/05/07/blogging-among-the-clouds/</link>
		<comments>http://blog.jayway.com/2009/05/07/blogging-among-the-clouds/#comments</comments>
		<pubDate>Thu, 07 May 2009 18:31:57 +0000</pubDate>
		<dc:creator>Henrik Bernström</dc:creator>
				<category><![CDATA[Cloud]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[amazon]]></category>
		<category><![CDATA[dreamhost]]></category>
		<category><![CDATA[ebs]]></category>
		<category><![CDATA[ec2]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[s3]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[ssl]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://79.125.9.149/?p=1619</guid>
		<description><![CDATA[Up until now this WordPress blog has been hosted by DreamHost, a company with a good reputation and a solid knowledge in hosting. Unfortunately, the server we've been located on, Trafficante, have lately had some problems with stability and performance and DreamHost have also had some MySQL stability issues. This, plus the fact that we've [...]]]></description>
			<content:encoded><![CDATA[<p>Up until now this WordPress blog has been hosted by <a href="http://dreamhost.com/aboutus.html">DreamHost</a>, a company with a good reputation and a solid knowledge in hosting. Unfortunately, the server we've been located on, Trafficante, have lately had some problems with stability and performance and DreamHost have also had some MySQL stability issues. This, plus the fact that we've had some really good experience with <a href="http://aws.amazon.com/">Amazons' Web Services</a> has made us take the leap, up among the clouds. </p>
<p>That said, I must also give credit to DreamHost for always being very helpful and supporting when needed.</p>
<p>If you want to know what we did to gain the speed needed for a lift-of, keep on reading.</p>
<h3>Exporting the Existing Database</h3>
<p>I really like MySQL, but when it comes to encoding for character sets and collations there seems to be such a complexity in the details that users often get lost and configure it the wrong way. The UTF-8 configured database we used on DreamHost worked just fine together with our WordPress installation but it turned out to be impossible to export a correct UTF-8 version for importing into our new environment. And I tried a lot of things. Really. I'm not going to go into details but to sum it up I had to sit down and do kind of manual replacements of the swedish specific characters in the database export. Lucky me this blog is in english. </p>
<p>Anyway, I had ssh access to the Trafficante server and could use this connection to export the database from the DreamHost MySQL server by issueing:</p>
<pre class="bash">&nbsp;
mysqldump --default-character-<span style="color: #007800;">set=</span>UTF8 -u <span style="color: #7a0874; font-weight: bold;">&#91;</span>user<span style="color: #7a0874; font-weight: bold;">&#93;</span> -p -h <span style="color: #7a0874; font-weight: bold;">&#91;</span>host<span style="color: #7a0874; font-weight: bold;">&#93;</span>.dreamhosters.com <span style="color: #7a0874; font-weight: bold;">&#91;</span>database<span style="color: #7a0874; font-weight: bold;">&#93;</span> -r <span style="color: #7a0874; font-weight: bold;">&#91;</span>output<span style="color: #7a0874; font-weight: bold;">&#93;</span>.sql
&nbsp;</pre>
<p>This resulted in a database dump later used for importing into the new MySQL instance.</p>
<h3>Setting up the Amazon EC2 Instance</h3>
<p>To make your Amazon life easier start with installing the Firefox plugins <a href="http://developer.amazonwebservices.com/connect/entry.jspa?externalID=609">Elasticfox</a> and <a href="http://developer.amazonwebservices.com/connect/entry.jspa?externalID=771">S3 Organizer</a>. These tools give you a GUI view of the somewhat more complex underlying details of Amazon. </p>
<p>Amazons' cloud solution is based on a user account. There are no start-up fees, you only pay for what you use. So if you still haven't got an account, <a href="http://www.amazon.com/gp/aws/registration/registration-form.html">sign-up now</a>. The rest of this article assumes you have signed up and set up accounts for <a href="http://aws.amazon.com/ec2/">Amazon EC2</a>, <a href="http://aws.amazon.com/s3/">Amazon S3</a> and <a href="http://aws.amazon.com/ebs/">Amazon EBS</a>. Start by reading the <a href="http://docs.amazonwebservices.com/AWSEC2/latest/GettingStartedGuide/">EC2 Getting Started Guide</a> and don't stop reading until you have created an ssh key pair, a security group and have a server instance running.</p>
<p>Now you should also have a private key and a certificate in your <em>${EC2_HOME}</em> (preferrably <em>${HOME}/.ec2/</em>) folder of your local computer. These two files should also be uploaded to your instance /mnt folder to make it possible to bundle and upload your images to your S3 "bucket(s)" (buckets are one level deep folders/directories). Make sure you put them in the /mnt folder to prevent them from being bundled with the image and thereby increasing the risk of having your identity revealed.</p>
<p>Bundling, by the way, should be done when you've made changes to your server instance that you don't want to loose. The result of a bundling and uploading is an image with a specific Amazon Image Id (AMI ID) reflecting the state of your server instance at the moment of bundling. You also have to register the image with the manifest file created for you. If you do that you could then safely close down your instance and have it up and running again by issuing the ec2-run-instances command with the AMI ID as parameter. A way to save money.</p>
<p>Bundling and uploading was made easier for me as I used two scripts created by my colleague <a href="/author/ulriksandberg">Ulrik</a>. I put these scripts in the /root folder.</p>
<pre class="bash">bundle-myself.<span style="color: #c20cb9; font-weight: bold;">sh</span>:
&nbsp;
<span style="color: #808080; font-style: italic;">#!/bin/sh</span>
<span style="color: #007800;">prg=</span>`<span style="color: #c20cb9; font-weight: bold;">basename</span> $<span style="color: #000000;">0</span>`
<span style="color: #007800;">dest=</span>/mnt
<span style="color: #007800;">image=</span>blog-image
&nbsp;
<span style="color: #007800;">USAGE=</span><span style="color: #ff0000;">&quot;Usage: $prg &lt;datetime&gt;
&nbsp;
Example:
% $prg 20090415-1000
Bundling into $dest/$image-20090415-1000.manifest.xml&quot;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$#</span> -ne <span style="color: #000000;">1</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;$USAGE&quot;</span>
  <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span>
<span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #007800;">date=</span>$<span style="color: #000000;">1</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Bundling into $dest/$image-$date.manifest.xml&quot;</span>
ec2-bundle-vol --debug -k /mnt/pk-PRIVATE_KEY.pem -c /mnt/cert-CERTIFICATE.pem -u USER_ACCOUNT_ID -d <span style="color: #007800;">$dest</span> -p <span style="color: #007800;">$image</span>-<span style="color: #007800;">$dat</span>
e -r i386
&nbsp;</pre>
<pre class="bash">upload-myself.<span style="color: #c20cb9; font-weight: bold;">sh</span>:
&nbsp;
<span style="color: #808080; font-style: italic;">#!/bin/sh</span>
<span style="color: #007800;">prg=</span>`<span style="color: #c20cb9; font-weight: bold;">basename</span> $<span style="color: #000000;">0</span>`
<span style="color: #007800;">dest=</span>/mnt
<span style="color: #007800;">image=</span>blog-image
&nbsp;
<span style="color: #007800;">USAGE=</span><span style="color: #ff0000;">&quot;Usage: $prg &lt;date&gt;
&nbsp;
Example:
% $prg 20090415-1000
Uploading bundled AMI parts to https://s3.amazonaws.com:443/[S3_BUCKET] ...
Uploaded blog-image-20090415-1000.part.00 to https://s3.amazonaws.com:443/[S3_BUCKET]/blog-image-20090415-1000.part.00.
...&quot;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$#</span> -ne <span style="color: #000000;">1</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;$USAGE&quot;</span>
  <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span>
<span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #007800;">date=</span>$<span style="color: #000000;">1</span>
ec2-upload-bundle --retry -m <span style="color: #007800;">$dest</span>/<span style="color: #007800;">$image</span>-<span style="color: #007800;">$date</span>.manifest.xml -b blog-images -a <span style="color: #7a0874; font-weight: bold;">&#91;</span>PUBLIC_KEY<span style="color: #7a0874; font-weight: bold;">&#93;</span> -s <span style="color: #7a0874; font-weight: bold;">&#91;</span>PRIVATE_KEY<span style="color: #7a0874; font-weight: bold;">&#93;</span>
&nbsp;</pre>
<p>Another thing I needed was a static IP address for my instance. To solve this I used Amazons Elastic IP service which doesn't cost anything as long as the generated IP address is in use. So, I generated an Elastic IP address and assigned it to the instance.</p>
<h3>Installing Necessary Software</h3>
<p>The blog require <a href="http://httpd.apache.org/">Apache2</a>, <a href="http://www.php.net/">Php5</a>, <a href="http://www.mysql.com">MySQL</a> and the <a href="http://www.phpgd.com/">Php GD graphics package</a>, to start with. This was easily installed using <a href="http://en.wikipedia.org/wiki/Advanced_Packaging_Tool">Advanced Packaging Tool</a>, apt-get:</p>
<pre class="bash">&nbsp;
<span style="color: #808080; font-style: italic;"># <span style="color: #c20cb9; font-weight: bold;">sudo</span> apt-get update</span>
<span style="color: #808080; font-style: italic;"># <span style="color: #c20cb9; font-weight: bold;">sudo</span> apt-get <span style="color: #c20cb9; font-weight: bold;">install</span> apache2 php5 mysql-server php5-mysql php5-gd</span>
&nbsp;</pre>
<h3>Setting up the Database for EBS</h3>
<p>EBS volumes are, as you might know, more persistent than EC2 instances and will survive if instances go down. Volumes are attached to the instance and could as well be detached and re-attached to new instances. As EBS volumes are not 100% reliable you should also take snapshots of your database data and have it uploaded to an S3 bucket. All this is nicely described in <a href="http://developer.amazonwebservices.com/connect/entry.jspa?externalID=1663">Eric Hammonds' EBS and MySQL tutorial</a>, so I urge you to read it if you haven't yet. </p>
<p>The only thing I sidestepped in the tutorial was the MySQL configuration to point out the data and log directories. Instead I used symbolic links:</p>
<pre class="bash">&nbsp;
<span style="color: #808080; font-style: italic;"># <span style="color: #c20cb9; font-weight: bold;">ln</span> -s /vol/lib/mysql/ /var/lib/mysql</span>
<span style="color: #808080; font-style: italic;"># <span style="color: #c20cb9; font-weight: bold;">ln</span> -s /vol/log/mysql/ /var/log/mysql</span>
&nbsp;</pre>
<p>The tutorial also walks you through automatic snapshots which requires the EC2 command line tools. Here is <a href="https://help.ubuntu.com/community/EC2APITools">a nice tutorial on setting these tools up on Ubuntu</a>.</p>
<p>I had to tweak the environment variable settings in ec2-snapshot-xfs-mysql.pl script from</p>
<pre>
BEGIN {
  $ENV{PATH} = '/bin:/usr/bin:/usr/local/bin';
}
</pre>
<p>to</p>
<pre>
BEGIN {
  $ENV{PATH} = '/bin:/usr/bin:/usr/local/bin:/usr/sbin:/root/ec2-api-tools/bin';
  $ENV{EC2_CERT} = '/mnt/cert-CERTIFICATE.pem';
  $ENV{EC2_PRIVATE_KEY} = '/mnt/pk-PRIVATE_KEY.pem';
  $ENV{EC2_HOME} = '/root/ec2-api-tools';
  $ENV{HOME} = '/root';
  $ENV{JAVA_HOME} = '/usr/lib/jvm/java-1.5.0-sun';
}
</pre>
<p>to get the snapshotting to fully work. I also wrapped the ec2-snapshot-xfs-mysql.pl script for a more convenient way to handle the input:</p>
<pre>/root/snapshot-myself.sh

#!/bin/sh
mountpoint=/vol
volume_id=[VOLUME_ID]

su -c "/root/ec2-snapshot-xfs-mysql.pl ${mountpoint} ${volume_id} > /vol/cron.log"
</pre>
<p>To automatize the snapshotting I set up a simple crontab job by issueing:</p>
<pre class="bash">&nbsp;
<span style="color: #808080; font-style: italic;"># crontab -e</span>
&nbsp;</pre>
<p>and then edited it like this</p>
<pre>
05 */6 * * * sh /root/snapshot-myself.sh
</pre>
<p>which makes the job run five minutes past every six hours, every day.</p>
<p>I also had to set the timezone info to apply to our local time. The easiest way I've found out of setting this for a Linux server is like this:</p>
<pre class="bash">&nbsp;
<span style="color: #808080; font-style: italic;"># <span style="color: #c20cb9; font-weight: bold;">ln</span> -sf /usr/share/zoneinfo/Europe/Stockholm /etc/localtime</span>
&nbsp;</pre>
<h3>Configuring MySQL</h3>
<p>To configure MySQL for UTF-8 content make sure the <em>/etc/mysql/my.cnf</em> file contains the following:</p>
<pre>
[client]
default-character-set=utf8

[mysqld]
#
# * Basic Settings
#
init_connect='SET collation_connection = utf8_general_ci'
init_connect='SET NAMES utf8'
character-set-server=utf8
collation-server=utf8_general_ci
default-character-set=utf8
skip-character-set-client-handshake
</pre>
<p>Now, if you haven't yet, go on and start your MySQL server. You need to create your wordpress database. It's as simple as:</p>
<pre class="sql">&nbsp;
<span style="color: #808080; font-style: italic;"># mysql -u [user] -p</span>
&gt; <span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">DATABASE</span> <span style="color: #66cc66;">&#91;</span>database_name<span style="color: #66cc66;">&#93;</span>
&nbsp;</pre>
<p>To create the user with which WordPress will access the database:</p>
<pre class="sql">&nbsp;
&gt; <span style="color: #993333; font-weight: bold;">GRANT</span> <span style="color: #993333; font-weight: bold;">ALL</span> <span style="color: #993333; font-weight: bold;">ON</span> <span style="color: #66cc66;">&#91;</span>database_name<span style="color: #66cc66;">&#93;</span>.* <span style="color: #993333; font-weight: bold;">TO</span> <span style="color: #ff0000;">'[user]'</span>@<span style="color: #ff0000;">'localhost'</span> <span style="color: #993333; font-weight: bold;">IDENTIFIED</span> <span style="color: #993333; font-weight: bold;">BY</span> <span style="color: #ff0000;">'[password]'</span>;
&nbsp;</pre>
<p>And to import your database dump into the newly created database:</p>
<pre class="bash">&nbsp;
<span style="color: #808080; font-style: italic;"># mysql -u <span style="color: #7a0874; font-weight: bold;">&#91;</span>user<span style="color: #7a0874; font-weight: bold;">&#93;</span> -p <span style="color: #7a0874; font-weight: bold;">&#91;</span>database_name<span style="color: #7a0874; font-weight: bold;">&#93;</span> &lt; <span style="color: #7a0874; font-weight: bold;">&#91;</span>output<span style="color: #7a0874; font-weight: bold;">&#93;</span>.sql</span>
&nbsp;</pre>
<p>You shouldn't need to specify any character set or collation when importing thanks to the configuration done in <em>/etc/mysql/my.cnf</em>.</p>
<p>In order for us to stick with our domain name and have no downtime we needed to use the instances IP address until we were finished testing. This means I had to replace two properties in the database to prevent the blog from redirecting to the original host; the '<em>siteurl</em>' and '<em>blogurl</em>' properties residing in the <em>option_value</em> column of the <em>wp_options</em> table. The commands</p>
<pre class="sql">&nbsp;
<span style="color: #808080; font-style: italic;"># mysql -u [user] -p</span>
&gt; <span style="color: #993333; font-weight: bold;">UPDATE</span> wp_options <span style="color: #993333; font-weight: bold;">SET</span> option_value=<span style="color: #ff0000;">'http://[ip_address]/wordpress/'</span> <span style="color: #993333; font-weight: bold;">WHERE</span> option_name=<span style="color: #ff0000;">'siteurl'</span>
&gt; <span style="color: #993333; font-weight: bold;">UPDATE</span> wp_options <span style="color: #993333; font-weight: bold;">SET</span> option_value=<span style="color: #ff0000;">'http://[ip_address]/wordpress/'</span> <span style="color: #993333; font-weight: bold;">WHERE</span> option_name=<span style="color: #ff0000;">'blogurl'</span>
&nbsp;</pre>
<p>fixed this. As soon as the DNS info was propagated throughout the Internet this was reset to <em>"http://blog.jayway.com/wordpress"</em> from within the WordPress admin interface.</p>
<h3>Apache Configuration</h3>
<p>Our WordPress installation makes use of permalinks and redirects to <a href="http://feedburner.google.com/">FeedBurner</a> for RSS statistics. This is based on <em>.htaccess</em> redirects (at least that's how we've solved it) which in turn is dependent on the Apache redirect module. So, in order to make this to work I had to enable that. </p>
<pre class="bash">&nbsp;
<span style="color: #808080; font-style: italic;"># <span style="color: #c20cb9; font-weight: bold;">sudo</span> a2enmod rewrite</span>
&nbsp;</pre>
<p>Easy as that! One more thing on redirections. I had to configure Apache to allow redirection directives specified in the <em>.htaccess</em> file by changing the <em>/etc/apache2/sites-available/default</em> configuration of the <em><VirtualHost *></em> element from</p>
<pre class="xml">&nbsp;
	<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Directory</span> /var/www<span style="font-weight: bold; color: black;">/&gt;</span></span>
		Options Indexes FollowSymLinks MultiViews
		AllowOverride None
		Order allow,deny
		allow from all
	<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Directory<span style="font-weight: bold; color: black;">&gt;</span></span></span>
&nbsp;</pre>
<p>to</p>
<pre class="xml">&nbsp;
	<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Directory</span> /var/www<span style="font-weight: bold; color: black;">/&gt;</span></span>
		Options Indexes FollowSymLinks MultiViews
		AllowOverride All <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;----------</span>
		Order allow,deny
		allow from all
	<span style="font-weight: bold; color: black;">&lt;/Directory<span style="font-weight: bold; color: black;">&gt;</span></span></span>
&nbsp;</pre>
<h3>Securing the WordPress Admin Interface</h3>
<p>Again, I choose to refer to detailed and well written sources. Here are the two articles I followed to create a self-signed certificate and to configure Apache to use it.</p>
<ul>
<li><a href="http://www.tc.umn.edu/~brams006/selfsign.html">Creating a self-signed certificate</a></li>
<li><a href="http://www.tc.umn.edu/~brams006/selfsign_ubuntu.html">Configuring Apache for SSL on Ubuntu</a></li>
</ul>
<p>To enable https access from the "outside world" I also edited the group policy to open up port 443. This could easily be done via the Elasticfox Firefox plugin mentioned earlier.</p>
<h3>Installing and Configuring WordPress</h3>
<p>The default location for Apache httpd server for reading content is <em>/var/www/</em>. If you, as I did, have an existing WordPress installation you can simply copy this to the new server. I ended up having it located at <em>/var/www/wordpress/</em> on the Amazon instance.</p>
<p>Once the database connection properties in the <em>wp-config.php</em> wordpress configuration file was adapted to the new environment I was able to access the WordPress installation via a browser and the Amazon instances' IP address. Sweet!</p>
<p>And as we have our WordPress installation in a separate "<em>/wordpress</em>" folder instead of in the document root of Apache we need to specify, in WordPress admin settings, that the '<em>Site URL</em>' should be "<em>${host}/wordpress</em>" but the<em> 'Blog URL</em>' should simply say "<em>${host}</em>" to prevent the resulting URL from containing "<em>/wordpress/...</em>". This also requires that we move the <em>.htaccess</em> and <em>index.php</em> files from within our "<em>/wordpress</em>" folder and up one level to "<em>/var/www/</em>", in our case. </p>
<p>In the <em>index.php</em> file, make sure to change from</p>
<pre class="php">&nbsp;
<span style="color: #808080; font-style: italic;">/** Loads the WordPress Environment and Template */</span>
<span style="color: #b1b100;">require</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'./wp-blog-header.php'</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;</pre>
<p>to </p>
<pre class="php">&nbsp;
<span style="color: #808080; font-style: italic;">/** Loads the WordPress Environment and Template */</span>
<span style="color: #b1b100;">require</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'./wordpress/wp-blog-header.php'</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;</pre>
<p>If or when specifying the permalinks, WordPress must have write access to the <em>.htaccess</em> file, so 'chmod' that file. </p>
<pre class="bash">&nbsp;
<span style="color: #808080; font-style: italic;"># <span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">755</span> .htaccess</span>
&nbsp;</pre>
<p>Otherwise it will complain and simply print out the <em>.htaccess</em> modification it tried to modify with and you are left to change it manually, instead.</p>
<h3>Sending Mail from WordPress</h3>
<p>Mailing is used in WordPress when generating new passwords to users, among others. We also use it to send data backups to the administator of the blog. </p>
<p>Setting up a mail server isn't a trivial task. I gave it a thought but quickly put it aside in favour of the simple WordPress plugin <a href="http://wordpress.org/extend/plugins/wp-mail-smtp/">WP Mail SMTP</a> as I realized I could make use of our existing corporate mail server. It was a breeze to configure the plugin with the necessary mail user credentials.</p>
<p>So, here we are. Sailing these fluffy clouds. </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jayway.com/2009/05/07/blogging-among-the-clouds/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Working with SD cards in the Android emulator</title>
		<link>http://blog.jayway.com/2009/04/22/working-with-sd-cards-in-the-android-emulator/</link>
		<comments>http://blog.jayway.com/2009/04/22/working-with-sd-cards-in-the-android-emulator/#comments</comments>
		<pubDate>Wed, 22 Apr 2009 09:05:20 +0000</pubDate>
		<dc:creator>Mårten Österberg</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Embedded]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[sdk]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://blog.jayway.com/?p=1537</guid>
		<description><![CDATA[Working with external storage in the Android emulator could be a little tricky and the documentation is not easy to find. I'll try to give a brief walk through of the steps needed to create a SD card image, mount the image in Linux, put content on it and use it in the emulator. Creating [...]]]></description>
			<content:encoded><![CDATA[<p>Working with external storage in the Android emulator could be a little tricky and the documentation is not easy to find. I'll try to give a brief walk through of the steps needed to create a SD card image, mount the image in Linux, put content on it and use it in the emulator. </p>
<p><strong>Creating a SD card image</strong><br />
In both the 1.1 and 1.5 version of the SDK there is a tool called mksdcard located in the <code>SDK Install Dir/tools</code> folder. Simply run </p>
<pre class="bash">./mksdcard 128M my128MbCard</pre>
<p>to create a 128Mb SD card with the name my128MbCard.</p>
<p><strong>Mounting a SD card image in Linux</strong><br />
To be able to put content on to the card you can mount the card in Linux. It will then simply appear as a folder in the filesystem.<br />
First make a directory in the /media folder:
<pre class="bash"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mkdir</span> /media/mycard</pre>
<p>Then mount the card as a <a href="http://en.wikipedia.org/wiki/Loop_device">loopback device</a>:
<pre class="bash"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mount</span> -o loop my128MbCard /media/mycard</pre>
<p><strong>Adding content to the card</strong><br />
With content we usually mean media content like images and videos. Images and videos are located in a folder called <code>/dcim/Camera</code>. You could of course add any content to the card. When you are done copying your files be sure to umount the card otherwise it will not be usable from the emulator.
<pre class="bash"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">umount</span> /media/mycard/</pre>
<p><strong>Using the card in the emulator</strong><br />
Google added something called Android Virtual Device (AVD) to the SDK 1.5. To create a new AVD using our newly created SDcard image run the following:
<pre class="bash">./android create avd --name myAVD --target <span style="color: #000000;">2</span> --sdcard my128MbCard</pre>
<p>Target 2 means that we want to use the 1.5 API features in the device. Now we simply fire up the emulator and start using our content:
<pre class="bash">./emulator -avd myAVD</pre>
<p>More information about the new SDK can be found here: <a href="http://developer.android.com/sdk/preview/">SDK</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jayway.com/2009/04/22/working-with-sd-cards-in-the-android-emulator/feed/</wfw:commentRss>
		<slash:comments>32</slash:comments>
		</item>
		<item>
		<title>Android on the FreeRunner</title>
		<link>http://blog.jayway.com/2008/11/21/android-on-the-freerunner/</link>
		<comments>http://blog.jayway.com/2008/11/21/android-on-the-freerunner/#comments</comments>
		<pubDate>Fri, 21 Nov 2008 17:01:48 +0000</pubDate>
		<dc:creator>Peter Neubauer</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Embedded]]></category>
		<category><![CDATA[Events]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[oredev]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://blog.jayway.com/?p=450</guid>
		<description><![CDATA[Hi there, Øredev was great success, especially all the people and the organization - a big Thank You to Michael and Emily for making this possible, you rock! Now, it was really awesome to exchange Android games with Mike Jennings fro the Android team, and get him excited over the recent Android port to the [...]]]></description>
			<content:encoded><![CDATA[<p>Hi there,</p>
<p>Øredev was great success, especially all the people and the organization - a big Thank You to Michael and Emily for making this possible, you rock!</p>
<p>Now, it was really awesome to exchange Android games with Mike Jennings fro the Android team, and get him excited over the recent Android port to the Neo FreeRunner! Thanks Anders Hedberg for coming over to fix the FR, and to all the OpenMoko enthusiasts doing the hard work!</p>
<p><a href="http://blog.jayway.com/wordpress/wp-content/uploads/2008/11/1227281553155.jpg" rel="lightbox"><img class="alignnone size-medium wp-image-451" title="Android on the NeoFreerunner" src="http://blog.jayway.com/wordpress/wp-content/uploads/2008/11/1227281553155-225x300.jpg" alt="" width="225" height="300" /></a></p>
<p>/peter neubauer</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jayway.com/2008/11/21/android-on-the-freerunner/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting Sound Working Properly on Ubuntu 8.10</title>
		<link>http://blog.jayway.com/2008/11/10/getting-sound-to-work-on-ubuntu-810ut/</link>
		<comments>http://blog.jayway.com/2008/11/10/getting-sound-to-work-on-ubuntu-810ut/#comments</comments>
		<pubDate>Mon, 10 Nov 2008 10:35:58 +0000</pubDate>
		<dc:creator>Mattias Hellborg Arthursson</dc:creator>
				<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[alsa]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[oss]]></category>
		<category><![CDATA[sound]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[ubuntu 8.10]]></category>
		<category><![CDATA[youtube]]></category>

		<guid isPermaLink="false">http://blog.jayway.com/?p=380</guid>
		<description><![CDATA[Ever since I upgraded to Ubuntu 8.10 on my laptop (Dell Precision M90) I've been having problems with getting the sound to work properly. I could get some applications working if I would change the sound default from ALSA to OSS, but it wouldn't work in Firefox (e.g. youtube etc.) Seems this is not an [...]]]></description>
			<content:encoded><![CDATA[<p>Ever since I upgraded to Ubuntu 8.10 on my laptop (Dell Precision M90) I've been having problems with getting the sound to work properly. I could get some applications working if I would change the sound default from ALSA to OSS, but it wouldn't work in Firefox (e.g. youtube etc.)</p>
<p>Seems this is not an uncommon problem, but the solution was not easy to find - there are lots of proposed solutions on different forums and I've tried several until I finally found the one that worked. It turned out that the culprit in my setup was pulse audio. <a href="http://ubuntuforums.org/showthread.php?t=973637">The solution that worked for me</a> was simply to remove that:</p>
<pre>
killall pulseaudio
sudo apt-get remove pulseaudio
sudo apt-get install esound esound-clients libao2
sudo rm /etc/X11/Xsession.d/70pulseaudio
</pre>
<p>After the above I just changed back to ALSA in sound settings, restarted Firefox and everything worked like a charm. Note that executing the <code>apt-get remove</code> statement above will display a prompt to stating that it will remove Ubuntu desktop. This is just a meta-package so it will NOT remove the ubuntu desktop for real. </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jayway.com/2008/11/10/getting-sound-to-work-on-ubuntu-810ut/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
	</channel>
</rss>

