<?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>Thoughts Electrique &#187; Technology</title>
	<atom:link href="http://www.sebastian.himberger.de/blog/category/technology/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sebastian.himberger.de/blog</link>
	<description>Sebastian Himbergers blog about technology and software development</description>
	<lastBuildDate>Thu, 08 Jul 2010 17:05:46 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Synchronizing and securing your work fileset</title>
		<link>http://www.sebastian.himberger.de/blog/2010/07/08/synchronizing-and-securing-your-work-fileset/</link>
		<comments>http://www.sebastian.himberger.de/blog/2010/07/08/synchronizing-and-securing-your-work-fileset/#comments</comments>
		<pubDate>Thu, 08 Jul 2010 17:05:46 +0000</pubDate>
		<dc:creator>Sebastian</dc:creator>
				<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.sebastian.himberger.de/blog/?p=610</guid>
		<description><![CDATA[If you are in software development a little bit longer or you&#8217;re just a geek, chances are high that you&#8217;re doing your development on multiple machines and also on the road. There are two (well known) problems that come with this:

Synchronization of the files on the different machines
Securing your work so in case your laptop [...]]]></description>
			<content:encoded><![CDATA[<p>If you are in software development a little bit longer or you&#8217;re just a geek, chances are high that you&#8217;re doing your development on multiple machines and also on the road. There are two (well known) problems that come with this:</p>
<ul>
<li><strong>Synchronization </strong>of the files on the different machines</li>
<li><strong>Securing your work</strong> so in case your laptop is stolen nothing is compromised (There are lot&#8217;s of high profile horror stories of stolen customer data)</li>
</ul>
<p>The usual answer to problem 1. is a centra file server or <em>NAS</em> (Network Attached Storage) which you deploy in your intranet. If you want to work on the road you most likely have to throw some <em>VPN</em> or <em>SSH</em>-Tunnel at the problem.Problem 2 is usually solved by encryption of the hard drive or at least one partition.</p>
<p>My issues with solution 1 were twofold:  I wasn&#8217;t always-on and even if I was: Access through my wireless plan was pretty slow especially for many small files. I ended up copying files on my hard disk for faster access but this defeated the purpose of the central storage completely since I sometimes forgot to copy the file back. Atfer some back and forth I came up with the following two tools:</p>
<ol>
<li><a href="http://www.cis.upenn.edu/~bcpierce/unison/" target="_blank">Unison for file synchronization</a></li>
<li><a href="http://www.truecrypt.org/" target="_blank">TrueCrypt for encryption</a></li>
</ol>
<p><strong>Unison </strong>allows synchronization of a set of files in two directions. I basically have a central server at home where all the clients synchronize with. You can think of Unison as a <em>VCS </em>(Version Control System) without the versioning. It does not store old copies of the resources. The synchronization is done using the Rsync algorithm which basically works like that:</p>
<ol>
<li>The two parties exchange a list of files. This list can include timestamps, filesizes or even hash sums.</li>
<li>If two files differ and the filesize is over a certain thereshold both parties chunk the file and submit a list of hash sums of the chunks using a rolling checksum (You can find the details on the Rsync website)</li>
<li>The  missing chunks are then transferred over the wire</li>
</ol>
<p>This allows me to sync even changes in large files quite quickly. Thanks to SSH the transfer is secure and doesn&#8217;t need special <em>VPN </em>software.</p>
<p><strong>TrueCrypt </strong>allows me to create an encrypted partition. This partition holds all my work data and this is the data I regularly sync with my central server.</p>
<p>This way I always have all the important stuff with me without compromising security or access speed. So if you ever consider setting up a VPN I would strongly suggest to give my solution a try instead. It&#8217;s much easier to maintain and doesn&#8217;t suffer from the always-on syndrome.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sebastian.himberger.de/blog/2010/07/08/synchronizing-and-securing-your-work-fileset/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Overview of OpenCms Resourcetype IDs</title>
		<link>http://www.sebastian.himberger.de/blog/2010/02/13/overview-of-opencms-resourcetype-ids/</link>
		<comments>http://www.sebastian.himberger.de/blog/2010/02/13/overview-of-opencms-resourcetype-ids/#comments</comments>
		<pubDate>Fri, 12 Feb 2010 23:37:46 +0000</pubDate>
		<dc:creator>Sebastian</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[OpenCms]]></category>

		<guid isPermaLink="false">http://www.sebastian.himberger.de/blog/?p=598</guid>
		<description><![CDATA[I constantly forget the resource type IDs of the OpenCms resource types and then have to dig into the configuration to find them. So here is a list of all resource type IDs of the OpenCms core. Maybe it is useful to someone else.
List of resource type IDs



Resourcetype
ID
Comment




Folder
0
OpenCms Core


Plain Text File
1
OpenCms Core


Binary File
2
OpenCms Core


Image
3
OpenCms Core


JSP [...]]]></description>
			<content:encoded><![CDATA[<p>I constantly forget the resource type IDs of the OpenCms resource types and then have to dig into the <a title="opencms-vfs.xml" href="http://cvs.opencms.org/viewvc.cgi/opencms/webapp/WEB-INF/config/opencms-vfs.xml?revision=1.57&amp;view=markup" target="_blank">configuration</a> to find them. So here is a list of all resource type IDs of the OpenCms core. Maybe it is useful to someone else.</p>
<h3><span id="more-598"></span>List of resource type IDs</h3>
<table style="border: 1px solid #333333;">
<thead>
<tr>
<th>Resourcetype</th>
<th>ID</th>
<th>Comment</th>
</tr>
</thead>
<tbody>
<tr>
<td>Folder</td>
<td>0</td>
<td>OpenCms Core</td>
</tr>
<tr>
<td>Plain Text File</td>
<td>1</td>
<td>OpenCms Core</td>
</tr>
<tr>
<td>Binary File</td>
<td>2</td>
<td>OpenCms Core</td>
</tr>
<tr>
<td>Image</td>
<td>3</td>
<td>OpenCms Core</td>
</tr>
<tr>
<td>JSP File</td>
<td>4</td>
<td>OpenCms Core</td>
</tr>
<tr>
<td>Pointer</td>
<td>5</td>
<td>OpenCms Core</td>
</tr>
<tr>
<td>XmlPage</td>
<td>6</td>
<td>OpenCms Core</td>
</tr>
<tr>
<td>Generic XmlContent</td>
<td>7</td>
<td>OpenCms Core</td>
</tr>
<tr>
<td>Image Gallery</td>
<td>8</td>
<td>OpenCms Core</td>
</tr>
<tr>
<td>DownloadGallery</td>
<td>9</td>
<td>OpenCms Core</td>
</tr>
<tr>
<td>Link Gallery</td>
<td>10</td>
<td>OpenCms Core</td>
</tr>
<tr>
<td>Html Gallery</td>
<td>11</td>
<td>OpenCms Core</td>
</tr>
<tr>
<td>Table Gallery</td>
<td>12</td>
<td>OpenCms Core</td>
</tr>
<tr>
<td>TemplateOne Microsite</td>
<td>19</td>
<td>Template One</td>
</tr>
<tr>
<td>TemplateOne E-Mail Form</td>
<td>60</td>
<td>Template One Form</td>
</tr>
<tr>
<td>TemplateOne News</td>
<td>30</td>
<td>Template One Modules</td>
</tr>
<tr>
<td>Template One FAQ</td>
<td>35</td>
<td>Template One Modules</td>
</tr>
<tr>
<td>Template One Event</td>
<td>40</td>
<td>Template One Modules</td>
</tr>
<tr>
<td>Template One Job</td>
<td>45</td>
<td>Template One Modules</td>
</tr>
<tr>
<td>Template One Linklist</td>
<td>50</td>
<td>Template One Modules</td>
</tr>
<tr>
<td>Template One Layout</td>
<td>51</td>
<td>Template One Modules</td>
</tr>
<tr>
<td>Template Two Preset</td>
<td>70</td>
<td>Template Two</td>
</tr>
<tr>
<td>Template Two Config</td>
<td>71</td>
<td>Template Two</td>
</tr>
<tr>
<td>Template Two Textbox</td>
<td>72</td>
<td>Template Two</td>
</tr>
<tr>
<td>Template Two Listbox</td>
<td>73</td>
<td>Template Two</td>
</tr>
<tr>
<td>Template Two Style</td>
<td>74</td>
<td>Template Two</td>
</tr>
<tr>
<td>Template Two Options</td>
<td>75</td>
<td>Template Two</td>
</tr>
<tr>
<td>Template Two Linkbox</td>
<td>76</td>
<td>Template Two</td>
</tr>
<tr>
<td>Template Two Search</td>
<td>77</td>
<td>Template Two</td>
</tr>
</tbody>
</table>
<p>I have not included other Open Source modules or the OAMP suite. I may update this list later.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sebastian.himberger.de/blog/2010/02/13/overview-of-opencms-resourcetype-ids/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Ubuntu LTS default repository problem</title>
		<link>http://www.sebastian.himberger.de/blog/2009/11/08/the-ubuntu-lts-defaultrepository-problem/</link>
		<comments>http://www.sebastian.himberger.de/blog/2009/11/08/the-ubuntu-lts-defaultrepository-problem/#comments</comments>
		<pubDate>Sun, 08 Nov 2009 04:25:20 +0000</pubDate>
		<dc:creator>Sebastian</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Opinionated]]></category>
		<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.sebastian.himberger.de/blog/?p=580</guid>
		<description><![CDATA[I&#8217;ve often seen Ubuntu being chosen instead of Debian because the LTS version offers support and security-fixes for five years. This kind of SLA is often a critical argument. But while Ubuntu is happily claiming to be enterprise-ready they yet enable the universe and multiverse software repositories per default even in the LTS server edition. [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve often seen <a href="http://www.ubuntu.com">Ubuntu </a>being chosen instead of <a href="http://www.debian.org" target="_blank">Debian </a>because the LTS version offers support and security-fixes for five years. This kind of SLA is often a critical argument. But while Ubuntu is happily claiming to be enterprise-ready they yet enable the <em>universe </em>and <em>multiverse </em>software repositories per default even in the LTS server edition. Since <a href="http://www.ubuntu.com/community/ubuntustory/components" target="_blank">these two repositories are not included in the SLA</a> you might end up with software that is not provided with patches and therefore the whole security guarantee get&#8217;s thrown out of the window. While I&#8217;m not saying community backed security is bad it basically sets Ubuntu into the same mode of operation as Debian and this even without a specific warning or even notice. To be on the safe side you should disable the <em>universe</em> and <em>multiverse</em> repositories after installation or at least be aware of this fact.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sebastian.himberger.de/blog/2009/11/08/the-ubuntu-lts-defaultrepository-problem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Decentralized categories in OpenCms 7.5</title>
		<link>http://www.sebastian.himberger.de/blog/2009/11/06/decentralized-categories-in-opencms-7-5/</link>
		<comments>http://www.sebastian.himberger.de/blog/2009/11/06/decentralized-categories-in-opencms-7-5/#comments</comments>
		<pubDate>Fri, 06 Nov 2009 19:33:26 +0000</pubDate>
		<dc:creator>Sebastian</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Content]]></category>
		<category><![CDATA[CRE]]></category>
		<category><![CDATA[OpenCms]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://www.sebastian.himberger.de/blog/?p=417</guid>
		<description><![CDATA[This feature was presented by Michael Emmerich during the OpenCms Days 2009 and caused a lot of people to grab their pen.
A short background on categories
Categories are a built-in content relation in OpenCms and allow files in the VFS to be assigned one or more topics/keywords/whatever. They can often be used as a replacement feature [...]]]></description>
			<content:encoded><![CDATA[<p>This feature was presented by <a href="http://www.opencms-days.org/en/program/sessions/t8.html" target="_blank">Michael Emmerich during the OpenCms Days 2009</a> and caused a lot of people to grab their pen.</p>
<h3>A short background on categories</h3>
<p><em>Categories </em>are a built-in content <em>relation</em> in <em>OpenCms</em> and allow files in the <em>VFS</em> to be assigned one or more topics/keywords/whatever. They can often be used as a replacement feature for siblings which are mostly misunderstood by users without a technical background. For example consider the typical example of a news site. You have a folder structure for your articles which could be the following way:</p>
<pre>/articles/2008/12-24-merry-christmas.html
/articles/2009/09-01-new-site.html
/articles/2009/10-02-a-great-article.html</pre>
<p>You now want to categorize the articles into topics so you would create another folder structure:</p>
<pre>/topic/must-read
/topic/technical</pre>
<p>The <em>sibling-way</em> would be to create a sibling (put simply: an automatically updating copy) of the articles in the desired <em>topic</em> folder. While this is a working solution it&#8217;s counterintuitive to most users. OpenCms 7 introduced the long awaited <em>Content Relation Engine</em> (<em>CRE</em>) including a default relation called categories. Similar to the sibling solution a category is effectively a folder but instead of creating it anywhere in the filesystem it&#8217;s created in the root site (&#8220;/&#8221;) under <em>/system/categories/.</em> Users can now assign categories to VFS files using the context-menu entry <em>Relations -&gt; Assign Categories</em>. This is a much easier approach although it has one caveat: Categories are globally defined in the <em>/system/</em> folder and can therefore only be created by users with access to the root site and can not be specified on a per site or even per folder basis. This can cause problems in multisite environments.</p>
<h3>Decentralization to the rescue</h3>
<p>With OpenCms 7.5 this limitation is finally gone. You can now define categories on a per-site and even per-folder basis. Simply create a folder named <em>_categories</em> in the folder where you want the categories to be available. Then create new folders inside this folder to define categories. The categories are available in the parent folder of the <em>_categories</em>-folder and all subfolders. They also cascade down. Example:</p>
<pre>/de/_categories/
/de/_categories/hot-topic
/de/_categories/support
/de/news/_categories/
/de/news/_categories/marketing
/de/news/_categories/development</pre>
<p>Inside the <em>/de/</em> folder the categories <em>hot-topic</em> and <em>support </em>are available. Inside<em> /de/news/</em> the categories <em>hot-topic</em>, <em>support</em>, <em>marketing</em> and <em>development</em> are available.</p>
<p>This feature should easily help you to get your content structured more nicely. Speaking from experience it is crucial to create an evolveable content structure upfront so your editors as well as visitors and search engines get the most out of your site.</p>
<p>See also:</p>
<ul>
<li><a href="http://www.opencms.org/en/events/opencms_days_2008/program/sessions/t2.html" target="_blank">Presentation from Michael Moossen about the CRE at OpenCms Days 2008</a></li>
<li><a href="http://www.w3.org/Provider/Style/URI" target="_blank">A guide to good URI design</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.sebastian.himberger.de/blog/2009/11/06/decentralized-categories-in-opencms-7-5/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Updating a broken SME 7.1 Server to version 7.4</title>
		<link>http://www.sebastian.himberger.de/blog/2009/10/23/updating-a-broken-sme-7-1-server-to-version-74/</link>
		<comments>http://www.sebastian.himberger.de/blog/2009/10/23/updating-a-broken-sme-7-1-server-to-version-74/#comments</comments>
		<pubDate>Fri, 23 Oct 2009 03:06:49 +0000</pubDate>
		<dc:creator>Sebastian</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[SME]]></category>
		<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://www.sebastian.himberger.de/blog/?p=542</guid>
		<description><![CDATA[The SME Server is a great Linux distribution for small to medium sized businesses. I&#8217;ve been doing some emergency sysadmin stuff quite a while ago and encountered the upgrade-hell from 7.1 to version 7.4. Since updating the operating system from 7.1 to 7.4 wasn&#8217;t easy I decided to write a quick blog post to save [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-medium wp-image-555" style="border: none; float: left; margin: 4px;" title="The SME Logo" src="http://www.sebastian.himberger.de/blog/wp-content/uploads/2009/10/sme-logo.png" alt="The SME Logo" width="150" height="141" />The <a title="SME Server website" href="http://wiki.contribs.org/Main_Page" target="_blank">SME Server</a> is a great Linux distribution for small to medium sized businesses. I&#8217;ve been doing some emergency sysadmin stuff quite a while ago and encountered the upgrade-hell from 7.1 to version 7.4. Since updating the operating system from 7.1 to 7.4 wasn&#8217;t easy I decided to write a quick blog post to save you from tinkering.</p>
<p><span id="more-542"></span></p>
<p>Updating the SME in general is pretty straighforward but if the customer made modifications to the <em>yum</em> configuration it can quickly turn into a nightmare. Luckily there <a title="Upgrading from 7.1 Tutorial" href="http://wiki.contribs.org/Updating_from_SME_7.1.x_or_earlier#Yum_Update" target="_blank">is a tutorial available in the SME Wiki</a> which can help you to get started. Unfortunately the yum installation was completly broken so I had to update the packages by hand. I pulled the packages from the SME repository at and installed them via</p>
<pre class="terminal">export SME_MIRROR_URL="http://mirror.jvsnet.ro/sme/releases/7/smeos/i386/SME/RPMS"

wget $SME_MIRROR_URL/dialog-1.0.20040731-3.i386.rpm
wget $SME_MIRROR_URL/python-sqlite-1.1.7-1.2.1.i386.rpm
wget $SME_MIRROR_URL/yum-metadata-parser-1.0-8.el4.centos.i386.rpm
wget $SME_MIRROR_URL/e-smith-formmagick-2.0.0-1.el4.sme.noarch.rpm
wget $SME_MIRROR_URL/smeserver-yum-2.0.0-4.el4.sme.noarch.rpm
wget $SME_MIRROR_URL/yum-plugin-fastestmirror-0.2.4-3.c4.noarch.rpm
wget $SME_MIRROR_URL/e-smith-lib-2.0.0-1.el4.sme.noarch.rpm
wget $SME_MIRROR_URL/sqlite-3.3.6-2.i386.rpm
wget $SME_MIRROR_URL/yum-plugin-installonlyn-0.91-1.el4.sme.noarch.rpm
wget $SME_MIRROR_URL/perl-CGI-FormMagick-0.92-16.el4.sme.noarch.rpm
wget $SME_MIRROR_URL/yum-2.4.3-4.el4.centos.noarch.rpm

rpm -Uvh --nodeps --force *.rpm</pre>
<p>You maybe have to adjust this mirror url. This is why I factored it out into a seperate variable.</p>
<p>After this you should reset your <em>yum</em> repositories and clean the <em>yum</em> cache.</p>
<pre class="terminal">cd /home/e-smith/db/
mv yum_repositories yum_repositories.po
/etc/e-smith/events/actions/initialize-default-databases
signal-event yum-modify
yum clean all</pre>
<p>After doing so, issue the following commands to let <em>SME</em> rewrite it&#8217;s config.</p>
<pre class="terminal">signal-event post-upgrade; signal-event reboot</pre>
<p>Now you can update <em>yum</em> through yum itself (I know this sounds strange but this second update helps to get all the GPG keys for the repositories right).</p>
<pre class="terminal">yum update yum
signal-event post-upgrade; signal-event reboot</pre>
<p>Now you can proceed with a normal update to get the whole system up to 7.4. I had to do this following process twice because the updates seem to have pulled in some new dependencies which in turn have to get updated.</p>
<pre class="terminal">yum update yum
signal-event post-upgrade; signal-event reboot</pre>
<p>That&#8217;s it. I&#8217;m sure there might be an easier way but at least these are the steps the helped me get the system up to date. If you have questions just leave me a comment.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sebastian.himberger.de/blog/2009/10/23/updating-a-broken-sme-7-1-server-to-version-74/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to log in a user of a specified OpenCms OU</title>
		<link>http://www.sebastian.himberger.de/blog/2009/10/12/how-to-log-in-a-user-of-a-specified-opencms-ou/</link>
		<comments>http://www.sebastian.himberger.de/blog/2009/10/12/how-to-log-in-a-user-of-a-specified-opencms-ou/#comments</comments>
		<pubDate>Mon, 12 Oct 2009 20:01:54 +0000</pubDate>
		<dc:creator>Sebastian</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[JSP]]></category>
		<category><![CDATA[OpenCms]]></category>
		<category><![CDATA[OU]]></category>

		<guid isPermaLink="false">http://www.sebastian.himberger.de/blog/?p=538</guid>
		<description><![CDATA[I recently had to login a user of a specified OU (Organizational Unit) through a JSP. This is done by simply prepending the username with the path to the OU.
Example: I want to login the user &#8220;foo&#8221; of the OU &#8220;/germany/marketing&#8220;. Simple specify the String &#8220;/germany/marketing/foo&#8221; as a username and you&#8217;re all set.
]]></description>
			<content:encoded><![CDATA[<p>I recently had to login a user of a specified OU (Organizational Unit) through a JSP. This is done by simply prepending the username with the path to the OU.</p>
<p><strong>Example</strong>: I want to login the user &#8220;<em>foo</em>&#8221; of the OU &#8220;<em>/germany/marketing</em>&#8220;. Simple specify the String &#8220;<em>/germany/marketing/foo</em>&#8221; as a username and you&#8217;re all set.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sebastian.himberger.de/blog/2009/10/12/how-to-log-in-a-user-of-a-specified-opencms-ou/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing PHP / PECL ImageMagick extension on 1&amp;1 managed server</title>
		<link>http://www.sebastian.himberger.de/blog/2009/09/26/installing-php-pecl-imagemagick-extension-on-11-managed-server/</link>
		<comments>http://www.sebastian.himberger.de/blog/2009/09/26/installing-php-pecl-imagemagick-extension-on-11-managed-server/#comments</comments>
		<pubDate>Sat, 26 Sep 2009 03:42:16 +0000</pubDate>
		<dc:creator>Sebastian</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[1und1]]></category>
		<category><![CDATA[Administration]]></category>
		<category><![CDATA[ImageMagick]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[PECL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://www.sebastian.himberger.de/blog/?p=477</guid>
		<description><![CDATA[I once had to install a custom PHP extension on a 1&#38;1 managed server. In this case the company had already purchased a managed server which was running the corporate website. They wanted to install an extranet-like webapplication which needed the ImageMagick PHP extension. In the following post I will outlike how I compiled and [...]]]></description>
			<content:encoded><![CDATA[<p>I once had to install a custom PHP extension on a <a title="1&amp;1 website" href="http://www.oneandone.com" target="_blank">1&amp;1</a> managed server. In this case the company had already purchased a managed server which was running the corporate website. They wanted to install an extranet-like webapplication which needed the <a title="ImageMagick extension" href="http://us3.php.net/manual/en/book.imagick.php">ImageMagick PHP extension</a>. In the following post I will outlike how I compiled and installed this extension on the managed server without having administrative access.</p>
<p><span id="more-477"></span></p>
<h3>Preparation</h3>
<p>To make the approach more modular we will use an environment variable pointing to our htdocs directory. I will call this variable $HTDOCS.</p>
<pre class="terminal">export HTDOCS=/kunden/homepages/.../htdocs</pre>
<p>We can check if everything is correct by changing into the htdocs directory.</p>
<pre class="terminal">cd $HTDOCS</pre>
<p>We will now create two directories:</p>
<ul>
<li><em>$HTDOCS/linux-src</em>: To hold all the data we need to compile the extensionn</li>
<li><em>$HTDOCS/linux</em>: To hold all the compiled data</li>
</ul>
<p>This setup allows us to delete the linux-src directory after we finished compiling the extension and save some diskspace.</p>
<pre class="terminal">mkdir -p $HTDOCS/linux-src
mkdir -p $HTDOCS/linux</pre>
<p>Now we will download the required sourcecode into our working directory:</p>
<pre class="terminal">mkdir -p $HTDOCS/linux-src/download
cd $HTDOCS/linux-src/download
wget ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick.tar.gz
wget http://pecl.php.net/get/imagick-2.3.0.tgz
wget ftp://ftp.remotesensing.org/pub/libtiff/tiff-3.8.2.tar.gz
wget http://us3.php.net/get/php-5.2.10.tar.gz/from/us.php.net/mirror</pre>
<p><strong>Note:</strong> The URLs to the latest versions may change over time. You will have to adjust them and also watch for changed file names in the following steps. Also be sure to use the PHP version currently active on your managed server.</p>
<h3>Extracting the sourcecode</h3>
<p>Now create a folder for the extracted sourcecode and extract the source archives:</p>
<pre class="terminal">mkdir -p $HTDOCS/linux-src/extracted/imagick
mkdir -p $HTDOCS/linux-src/extracted/php-imagick
mkdir -p $HTDOCS/linux-src/extracted/libtiff
mkdir -p $HTDOCS/linux-src/extracted/php5

cd $HTDOCS/linux-src/extracted/imagick &amp;&amp; tar xfz $HTDOCS/linux-src/download/ImageMagick.tar.gz
cd $HTDOCS/linux-src/extracted/php-imagick &amp;&amp; tar xfz $HTDOCS/linux-src/download/imagick-2.3.0.tgz
cd $HTDOCS/linux-src/extracted/libtiff &amp;&amp; tar xfz $HTDOCS/linux-src/download/tiff-3.8.2.tar.gz
cd $HTDOCS/linux-src/extracted/php5 &amp;&amp; tar xfz $HTDOCS/linux-src/download/php-5.2.10.tar.gz</pre>
<h3>Building delegate libraries</h3>
<p>ImageMagick uses different delegate libraries for certain formats. We have to build these first so they can be incorporated into our ImageMagick build. In this case we will only use libtiff to allow the usage of the TIFF image format.</p>
<h4>Building libtiff from source</h4>
<p>Building libtiff is pretty straightforward. Simply use the following commands inside the extracted source archive:</p>
<pre class="terminal">./configure --prefix=$HTDOCS/linux/
make
make install</pre>
<h3>Building ImageMagick from source</h3>
<p>Change into the extracted source directory and type in the following:</p>
<pre class="terminal">./configure --without-perl --prefix=$HTDOCS/linux \
  CPPFLAGS="-I$HTDOCS/linux/include" LDFLAGS="-L$HTDOCS/linux/lib/"
make
make install</pre>
<p>You can type the following command to test the compiled ImageMagick.</p>
<pre class="terminal">make check</pre>
<p>After ImageMagick is built we can now go on and create the PHP extension.</p>
<h3>Building the ImageMagick PHP extenstion</h3>
<p>To compile the extension we have to have a PHP development environment in place. To create one we&#8217;ll simply compile and install PHP (this sounds more scary than it is).</p>
<h4>Building PHP from source</h4>
<p>Change into the extracted PHP archive and type in the following:</p>
<pre class="terminal">./configure --prefix=$HTDOCS/linux
make
make test
make install</pre>
<p>The <em>make test</em> target will run the PHP test suite. You can expect some tests to fail but if the number of failing tests is overwhelming you should get suspicious.</p>
<h4>Building the ImageMagick PECL extension</h4>
<p>Change into the extracted source archive and type in the following:</p>
<pre class="terminal">phpize --clean
phpize
./configure --prefix=$HTDOCS/linux --with-php-config=/usr/bin/php-config5 --with-imagick=$HTDOCS/linux</pre>
<p>The configure script should go through. Unfortunately it seems that the prefix and paths will not be set correctly in the <em>Makefile</em>. We will have to adjust this and replace the /usr/local paths with the path to our $HTDOCS/linux</p>
<pre class="terminal">echo "$HTDOCS/linux" | sed -e 's/\//\\\//g' &gt; htdocs_pattern &amp;&amp; \
  export HTDOCS_PATTERN=`cat htdocs_pattern` &amp;&amp; rm htdocs_pattern
perl -pi -e "s/\/usr\/local/$HTDOCS_PATTERN/g" Makefile</pre>
<p><strong>Note</strong>: The above command looks a bit freaky and is a bit of a quick hack. What it basically does it is escaping the slashes (/) in the <em>$HTDOCS</em> path and writing this to a file. Then exporting the content of the file to an environment variable and deleting the file. After this PERL is used to replace all <em>/usr/local</em> paths in the <em>Makefile</em> to <em>$HTDOCS/linux</em></p>
<p>After that we are good to go and can build the extension:</p>
<pre class="terminal">./configure --prefix=$HTDOCS/linux
make
make install</pre>
<p>Now the extension should be build successfully and is placed in the directory <em>$HTDOCS/linux/somepath</em> (the <em>make install</em> will tell you the extact path) . The last thing we have to do is activating the extension.</p>
<h3>Activating the extension</h3>
<p>To activate the extension for a certain folder, create a file named php.ini (for example in the $HTDOCS directory) with the following content inside the folder:</p>
<pre class="file">extension_dir=$HTDOCS/linux/somepath
extension=imagick.so</pre>
<p>Also don&#8217;t forget to activate PHP 5 with using a <em>.htaccess</em> file:</p>
<pre class="file">AddType x-mapp-php5 .php
AddHandler x-mapp-php5 .php</pre>
<p>That&#8217;s all. If you have any questions feel free to comment. I hope this helps some of you.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sebastian.himberger.de/blog/2009/09/26/installing-php-pecl-imagemagick-extension-on-11-managed-server/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Yahoo! Open Hack NYC &amp; Status</title>
		<link>http://www.sebastian.himberger.de/blog/2009/09/25/yahoo-open-hack-nyc-and-status/</link>
		<comments>http://www.sebastian.himberger.de/blog/2009/09/25/yahoo-open-hack-nyc-and-status/#comments</comments>
		<pubDate>Fri, 25 Sep 2009 15:24:09 +0000</pubDate>
		<dc:creator>Sebastian</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Conference]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Yahoo Open Hack]]></category>

		<guid isPermaLink="false">http://www.sebastian.himberger.de/blog/?p=505</guid>
		<description><![CDATA[I&#8217;ll bet at the Yahoo! Open Hack NYC on October the 9th. If anyone has some cool suggestions or want to meet up there just shoot me an email. Seems like a fun thing to do. I&#8217;ll report back on this blog what comes out of it.
I&#8217;m also working on some projects so stay tuned.
&#160;
]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.sebastian.himberger.de/blog/wp-content/uploads/2009/09/ohdnyclogo_verysml.png"><img class="size-medium wp-image-506 alignleft" style="margin: 4px; float: left" title="ohdnyclogo_verysml" src="http://www.sebastian.himberger.de/blog/wp-content/uploads/2009/09/ohdnyclogo_verysml.png" border="0" alt="" width="150" height="179" /></a>I&#8217;ll bet at the <a title="Yahoo! Open Hack Day" href="http://icanhaz.com/yahoohacknyc" target="_blank">Yahoo! Open Hack NYC</a> on October the 9th. If anyone has some cool suggestions or want to meet up there just shoot me an <a href="/contact">email</a>. Seems like a fun thing to do. I&#8217;ll report back on this blog what comes out of it.</p>
<p>I&#8217;m also working on some projects so stay tuned.</p>
<div style="clear: both">&nbsp;</div>
]]></content:encoded>
			<wfw:commentRss>http://www.sebastian.himberger.de/blog/2009/09/25/yahoo-open-hack-nyc-and-status/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up XWiki in Tomcat and MySQL</title>
		<link>http://www.sebastian.himberger.de/blog/2009/09/10/setting-up-xwiki-in-tomcat-and-mysql/</link>
		<comments>http://www.sebastian.himberger.de/blog/2009/09/10/setting-up-xwiki-in-tomcat-and-mysql/#comments</comments>
		<pubDate>Thu, 10 Sep 2009 13:32:34 +0000</pubDate>
		<dc:creator>Sebastian</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Administration]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Tomcat]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[XWiki]]></category>

		<guid isPermaLink="false">http://www.sebastian.himberger.de/blog/?p=468</guid>
		<description><![CDATA[I recently set up a new XWiki 2.0 instance (with MySQL) for documentation purposes. Although some of the steps are already described in the XWiki manual I&#8217;ll document it here mainly because I keep forgetting things. Also step-by-step tutorials come in handy when you&#8217;re in a hurry.

Create the webapp directory
Since the configuration files have to [...]]]></description>
			<content:encoded><![CDATA[<p>I recently set up a new <a title="XWiki Enterprise website" href="http://enterprise.xwiki.org" target="_blank">XWiki 2.0</a> instance (with MySQL) for documentation purposes. Although some of the steps are already described in the XWiki manual I&#8217;ll document it here mainly because I keep forgetting things. Also step-by-step tutorials come in handy when you&#8217;re in a hurry.</p>
<p><span id="more-468"></span></p>
<h3><strong>Create the webapp directory</strong></h3>
<p>Since the configuration files have to be modified an exploded WAR has to be used. The webapp directory has to be created and the WAR will be extracted inside of it.</p>
<pre class="terminal">mkdir xwiki &amp;&amp; cd xwiki
unzip ../xwiki.war
rm ../xwiki.war</pre>
<h3><strong>Create and configure a database</strong></h3>
<p>Create a database including a dedicated database user. Open the file <em>WEB-INF/hibernate.cfg.xml</em> and uncomment the MySQL block. Modify the following properties:</p>
<ul>
<li>connection.username</li>
<li>connection.password</li>
<li>connection.url</li>
</ul>
<p><strong>Important:</strong> Don&#8217;t forget to add the <a title="MySQL JDBC Connector" href="http://dev.mysql.com/downloads/connector/j/" target="_blank">MySQL JDBC driver</a> to your classpath (e.g. WEB-INF/lib).</p>
<p><strong>Note: </strong>It is of course also possible to use a container managed DataSource via JNDI.</p>
<h3><strong>Configure Logfile</strong></h3>
<p>Since the security manager restricts file IO to the webapp directory the logging has to be reconfigured. To do so the <em>log4.properties</em> file has to be copied from <em>xwiki-core-2.0-milestone-4.jar</em> to the <em>WEB-INF/classes</em> directory. After this the property <em>log4j.appender.file.File</em> has to be modified to point to a writeable path.</p>
<h3><strong>Add the context file to Tomcat</strong></h3>
<p>Add a file name <em>${context}.xml</em> to the <em>/conf/Catalina/localhost</em>&#8221; directory of <em>$CATALINA_HOME</em> (the Tomcat instance) and put the following content into it:</p>
<pre class="file">&lt;Context path="<strong>${contextPath}</strong>" docBase="<strong>${pathToWebapp}</strong>" &gt;&lt;/Context&gt;</pre>
<p>Eventually put in references to resources like DataSource&#8217;s etc.</p>
<h3><strong>Create the proxy settings in Apache HTTPD</strong></h3>
<p>You can use any proxy settings. I&#8217;m currently using a very simple setup:</p>
<pre class="file">&lt;Proxy ajp://localhost:10709*&gt;
  Allow from all
&lt;/Proxy&gt;

RewriteEngine On
RewriteRule ^/$ /<em>xwiki</em>/ [R=301,L]

ProxyPass        /      ajp://localhost:10709/
ProxyPassReverse /      ajp://localhost:10709/</pre>
<p><strong>Note:</strong> <em>xwiki </em>is the contextPath</p>
<h3><strong>Test the installation</strong></h3>
<p>Surf to http://www.yourdomain.com/. An empty XWiki page should be displayed. The first step should always be to register a user so the administration area is accessible. The default content can be imported by using the page <em>/${contextPath}/bin/import/XWiki/XWikiPreferences</em>.</p>
<p>I&#8217;ll probably blog more about XWiki and how to customize it in the future.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sebastian.himberger.de/blog/2009/09/10/setting-up-xwiki-in-tomcat-and-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Don&#8217;t bind to a standard port</title>
		<link>http://www.sebastian.himberger.de/blog/2009/09/07/dont-bind-to-a-standard-port/</link>
		<comments>http://www.sebastian.himberger.de/blog/2009/09/07/dont-bind-to-a-standard-port/#comments</comments>
		<pubDate>Mon, 07 Sep 2009 19:04:52 +0000</pubDate>
		<dc:creator>Sebastian</dc:creator>
				<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.sebastian.himberger.de/blog/?p=400</guid>
		<description><![CDATA[I recently discovered that Skype (at least on Windows) grabs port 80 if it is available. This might prevent your local webserver from starting up. I really don&#8217;t understand why my VoIP client has to do this. If your applications main purpose is not associated with a standard port then it should stay away from [...]]]></description>
			<content:encoded><![CDATA[<p>I recently discovered that Skype (at least on Windows) grabs port 80 if it is available. This might prevent your local webserver from starting up. I really don&#8217;t understand why my VoIP client has to do this. If your applications main purpose is not associated with a standard port then it should stay away from it. That&#8217;s at least my take on this.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sebastian.himberger.de/blog/2009/09/07/dont-bind-to-a-standard-port/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
