<?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>info.michael-simons.eu &#187; Webdevelopment</title>
	<atom:link href="http://info.michael-simons.eu/category/webdevelopment/feed/" rel="self" type="application/rss+xml" />
	<link>http://info.michael-simons.eu</link>
	<description>Just another nerd blog</description>
	<lastBuildDate>Wed, 08 Feb 2012 10:26:00 +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>Creating a better PathMatcher for Spring 3</title>
		<link>http://info.michael-simons.eu/2011/03/09/creating-a-better-pathmatcher-for-spring-3/</link>
		<comments>http://info.michael-simons.eu/2011/03/09/creating-a-better-pathmatcher-for-spring-3/#comments</comments>
		<pubDate>Wed, 09 Mar 2011 08:14:35 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[English posts]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Webdevelopment]]></category>
		<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[Spring]]></category>
		<category><![CDATA[URL Mapping]]></category>

		<guid isPermaLink="false">http://info.michael-simons.eu/?p=507</guid>
		<description><![CDATA[Spring 3 has excellent support for mapping URLs to @Controller methods through the @RequestMapping annotation. This works quite well and i especially like the fact having the mapping right next to the method and not in some other config file like routes.rb. My goal was to have urls like http://foobar.com/resource, http://foobar.com/resource.html, http://foobar.com/resource.zip etc. This is [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.springframework.org/">Spring 3</a> has excellent support for mapping URLs to @Controller methods through the <a href="http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/mvc.html#mvc-ann-requestmapping">@RequestMapping</a> annotation. This works quite well and i especially like the fact having the mapping right next to the method and not in some other config file like routes.rb.</p>
<p>My goal was to have urls like <em>http://foobar.com/resource</em>, <em>http://foobar.com/resource.html</em>, <em>http://foobar.com/resource.zip</em> etc. This is no problem at all thanks to the <a href="http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/mvc.html#mvc-multiple-representations"> ContentNegotiatingViewResolver</a>.</p>
<p>The solution has only one draw back: The format is not known to the controller. Yes, this shouldn&#8217;t be a controller concern in most cases but what if you have a format that you don&#8217;t want to be available to all users? Maybe an nice zip download of your resources? Handling authentication in a view? I don&#8217;t think so.</p>
<p>So my first attempt looked like this</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">@RequestMapping<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/resource.{format}&quot;</span><span style="color: #009900;">&#41;</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">String</span> resource<span style="color: #009900;">&#40;</span>
		<span style="color: #000000; font-weight: bold;">final</span> @PathVariable <span style="color: #003399;">String</span> format,
		<span style="color: #000000; font-weight: bold;">final</span> HttpServletRequest request,
		<span style="color: #000000; font-weight: bold;">final</span> Model model
<span style="color: #009900;">&#41;</span></pre></div></div>

<p>That didn&#8217;t work because it wouldn&#8217;t work for the default text/html resource http://foobar.com/resource so i added</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">@RequestMapping<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/resource&quot;</span><span style="color: #009900;">&#41;</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">String</span> resource<span style="color: #009900;">&#40;</span>
		<span style="color: #000000; font-weight: bold;">final</span> Model model
<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">resource</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'html'</span>, model<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>That worked for http://foobar.com/resource but not for http://foobar.com/resource.zip… &#8220;format&#8221; was always html. Hmmm…</p>
<p>After much googling and reading StackOverflow.com i found the &#8220;useDefaultSuffixPattern&#8221; option on <em>org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping</em>. If set to true (which is the default) the mapping &#8220;/resource/&#8221; will also map to &#8220;/resource/&#8221; and &#8220;/resource.*&#8221;. Although both useful i tried disabling it through my spring-cfg.xml like</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bean</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;order&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;useDefaultSuffixPattern&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;false&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bean<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Enter the next problem: First, i didn&#8217;t work either. Second, all urls where mapped twice. Without the default suffix pattern and with. I spend 2 hours trying to locate the place where the spring config was loaded twice. In the end it was that one line that caused me trouble:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mvc:annotation-driven</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span></pre></div></div>

<p>That tag enables a lot of stuff in Spring 3, like the @Controller programming model and many other <a href="http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/mvc.html#mvc-annotation-driven">goodies</a>. What it also does is establishing an AnnotationHandlerMapping that cannot be overwritten. So the next thing i did was browsing through the Spring sources to see what it does and redid with Spring beans in my config file (code follows later).</p>
<p>With that implemented, my urls still didn&#8217;t work, for all cases the URL without .{format} was called.</p>
<p>As i was already deep down in the Spring sources i had a look at the default path parser and matcher called <a href="http://static.springsource.org/spring/docs/3.0.x/javadoc-api/">AntPathMatcher</a>. There is nothing wrong with the parsing code but the &#8220;getPatternComparator&#8221; method that &#8220;Given a full path, returns a Comparator suitable for sorting patterns in order of explicitness.&#8221; had some flaws, at least for my use case.</p>
<p>It sorts the patterns by explicitness and that explicitness is (among others) defined by how many placeholders for path variables are present. So my &#8220;/resource&#8221; is more explicit that &#8220;/resource.{format}&#8221;. With that in mind, i extend the path matcher like so:</p>
<p><script src="https://gist.github.com/861852.js?file=ExtendedAntPathMatcher.java"></script></p>
<p>This PathMatcher delegates most of his methods to the default AntPathMatcher but overwrites the getPatternComparator. If you have a look at the sources you&#8217;ll see that it is also partly copied. In the last else branch you&#8217;ll see that i sort both patterns by length, strip the default suffix (.*) and check wether the longer pattern starts with the other one. If it does i check wether the difference is just a .{format} (hardcoded). If that&#8217;s true, than the pattern with the format suffix is more explicit. Otherwise, i&#8217;ll use the default algorithm.</p>
<p>To get this to work, you cannot use the mvc:annotation-driven tag as the PathMatcher is a property of the AnnotationMappingHandler which in turn cannot be overwritten. So to get the same functionality like in Spring 3.0.5 with my PathMatcher use </p>
<p><script src="https://gist.github.com/861863.js?file=gistfile1.xml"></script></p>
<p>As you can see i left the useDefaultSuffixPattern option enabled as it works very well with my PathMatcher and i didn&#8217;t want to care about mapping &#8220;/resource&#8221;, &#8220;/resource/&#8221; etc…</p>
<p>I really hope that the gists will save someone some time. I cannot imagine that i&#8217;m the only one having this kind of requirement. The solution is really simple but the way to it was not that easy.</p>
<p class="akst_link"><a href="http://info.michael-simons.eu/?p=507&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_507" class="akst_share_link " rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://info.michael-simons.eu/2011/03/09/creating-a-better-pathmatcher-for-spring-3/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>HTML Entity Character Lookup</title>
		<link>http://info.michael-simons.eu/2007/06/16/html-entity-character-lookup/</link>
		<comments>http://info.michael-simons.eu/2007/06/16/html-entity-character-lookup/#comments</comments>
		<pubDate>Sat, 16 Jun 2007 08:22:59 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Webdevelopment]]></category>
		<category><![CDATA[Dashboard]]></category>
		<category><![CDATA[Mac OS X]]></category>

		<guid isPermaLink="false">http://info.michael-simons.eu/2007/06/16/html-entity-character-lookup/</guid>
		<description><![CDATA[On Retrax Bloggy i found a great widget for looking up HTML Entities: HTML Entity Character Lookup Best of all: the widget doesn&#8217;t need a online connection. The whole thing works like a charm, great! Share This]]></description>
			<content:encoded><![CDATA[<p>On <a href="http://www.retrax.de/Bloggy/html-entity-lookup">Retrax Bloggy</a> i found a great widget for looking up HTML Entities:</p>
<p><a href="http://leftlogic.com/lounge/articles/entity-lookup">HTML Entity Character Lookup</a></p>
<p>Best of all: the widget doesn&#8217;t need a online connection. The whole thing works like a charm, great!</p>
<p class="akst_link"><a href="http://info.michael-simons.eu/?p=94&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_94" class="akst_share_link " rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://info.michael-simons.eu/2007/06/16/html-entity-character-lookup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I wanna visit some spamers with a chrome axe&#8230;</title>
		<link>http://info.michael-simons.eu/2007/06/06/i-wanna-visit-some-spamers-with-a-chrome-axe/</link>
		<comments>http://info.michael-simons.eu/2007/06/06/i-wanna-visit-some-spamers-with-a-chrome-axe/#comments</comments>
		<pubDate>Wed, 06 Jun 2007 16:03:05 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Webdevelopment]]></category>
		<category><![CDATA[Rants]]></category>

		<guid isPermaLink="false">http://info.michael-simons.eu/2007/06/06/i-wanna-visit-some-spamers-with-a-chrome-axe/</guid>
		<description><![CDATA[and replay a book by Bret Easton Ellis. Or at least smack them in the face. This blog received &#8220;just&#8221; ~1500 Comment- and trackbackspams since last thursday. On the 2nd place is my dailyfratze project and right behind, planet-punk. The quintessence: You must do some math if you wanna comment here, trackbacks are validated and [...]]]></description>
			<content:encoded><![CDATA[<p>and replay a book by Bret Easton Ellis. Or at least smack them in the face. </p>
<p>This blog received &#8220;just&#8221; ~1500 Comment- and trackbackspams since last thursday. On the 2nd place is my dailyfratze project and right behind, planet-punk.</p>
<p>The quintessence: You must do some math if you wanna comment here, trackbacks are validated and i&#8217;ve joined <a href="http://projecthoneypot.org/">Project Honeypot</a>. If there are any questions regarding the latter, just ask me. A handfull of plugins, more internet traffic etc. pp. just to keep idiots destroying modern mediums of communication.</p>
<p>Best of all: My own URL planet-punk.de just got blacklisted by Akismet. Damn it. I&#8217;m really curious how that happened. I really never ever spammed anything. *sigh*</p>
<p class="akst_link"><a href="http://info.michael-simons.eu/?p=89&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_89" class="akst_share_link " rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://info.michael-simons.eu/2007/06/06/i-wanna-visit-some-spamers-with-a-chrome-axe/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Projektdokumentationen und Anwendungsdesign</title>
		<link>http://info.michael-simons.eu/2007/05/19/projektdokumentationen-und-anwendungsdesign/</link>
		<comments>http://info.michael-simons.eu/2007/05/19/projektdokumentationen-und-anwendungsdesign/#comments</comments>
		<pubDate>Sat, 19 May 2007 07:12:04 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Webdevelopment]]></category>
		<category><![CDATA[Lesetipps]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://info.michael-simons.eu/2007/05/19/projektdokumentationen-und-anwendungsdesign/</guid>
		<description><![CDATA[In den letzten Tagen habe ich einige ganz interessante, deutsche Projektdokumentationen gefunden. Zum einen die zur Zeiterfassung Mite gehörende Diplomarbeit, die hier zum Download angeboten wird. Zum anderen einen Aufsatz von Thomas Bachem, einem der Macher von sevenload.de Ich finde beide Dokumentationen hochgradig interessant zu lesen, nichts desto habe ich einige Anmerkungen und Gedanken dazu: [...]]]></description>
			<content:encoded><![CDATA[<p>In den letzten Tagen habe ich einige ganz interessante, deutsche Projektdokumentationen gefunden.</p>
<p>
Zum einen die zur Zeiterfassung <a href="http://bemite.de/">Mite</a> gehörende Diplomarbeit, die <a href="http://bemite.de/hintergrund.html">hier zum Download</a> angeboten wird. <br />
Zum anderen einen <a href="http://blog.thomasbachem.com/2007/05/07/mein-artikel-im-php-magazin-52006/">Aufsatz</a> von <a href="http://blog.thomasbachem.com/">Thomas Bachem</a>, einem der Macher von <a href="http://www.sevenload.de">sevenload.de</a>
</p>
<p>Ich finde beide Dokumentationen hochgradig interessant zu lesen, nichts desto habe ich einige Anmerkungen und Gedanken dazu:</p>
<p>
Mite ist ein Projekt mit Ruby on Rails. Die Macher hatten am Anfang Lastprobleme, konnten das aber durch einen Umzug auf einen performanteren Server lösen.</p>
<p>
Sevenload ist ein PHP Projekt. Leider nutze ich es nicht so häufig wie Youtube, daher kann ich keine definitive Aussage zur Geschwindigkeit treffen. Dennoch frage ich mich, ob es wirklich nötig ist, in einem Grundlagenartikel direkt mit kontrollierten Redundanzen für die einfachsten Sachen wie &#8220;durchschnittliche Bewertung eines Bildes&#8221; loszulegen? Ich meine, bin ich der einzige, der so etwas für Überflüssig hält? Letzten Endes ist es ein Einzeiler in SQL, der mit korrekter Indexerstellung kein DBMS in die Knie zwingen sollte:
</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SELECT</span> avg<span style="color: #66cc66;">&#40;</span>rating<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">/</span><span style="color: #993333; font-weight: bold;">COUNT</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">*</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span> rateable_id <span style="color: #993333; font-weight: bold;">FROM</span> ratings <span style="color: #993333; font-weight: bold;">GROUP</span> <span style="color: #993333; font-weight: bold;">BY</span> rateable_id <span style="color: #993333; font-weight: bold;">ORDER</span> <span style="color: #993333; font-weight: bold;">BY</span> <span style="color: #cc66cc;">1</span> <span style="color: #993333; font-weight: bold;">ASC</span>;</pre></div></div>

<p>Das dann noch mit einem inner join über die zu bewertenden Dinger verknüpft und gut.</p>
<p>Welcher Ansatz würde ich wählen? Ich selber würde jederzeit Standards vorziehen, im obigen Fall auf ein sauberes ER &lt;-&gt;Objekt Mapping und auf Normalisierung in der DB (witzigerweise erwähnt Thomas Bachem das im nächsten Absatz bzgl. Tagging Schema) setzen. In anderen Worten: Lieber den Railsweg gehen und sauberes Design erhalten und dann im Zweifelsfall etwas mehr Hardware hinter her werfen.</p>
<p>Tatsächlich redundate Informationen zu speichern würde ich generell nicht ausschliessen, in diesem Fall allerdings schon. Ich denke, wenn man soweit unten bereits diesen Bedarf hat, wird es eng mit Optimierungen, wenn die Luft unter Last dünner wird.</p>
<p class="akst_link"><a href="http://info.michael-simons.eu/?p=82&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_82" class="akst_share_link " rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://info.michael-simons.eu/2007/05/19/projektdokumentationen-und-anwendungsdesign/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby On Rails native MySQL Bindings Vs. RMagick</title>
		<link>http://info.michael-simons.eu/2007/01/02/ruby-on-rails-native-mysql-bindings-vs-rmagick/</link>
		<comments>http://info.michael-simons.eu/2007/01/02/ruby-on-rails-native-mysql-bindings-vs-rmagick/#comments</comments>
		<pubDate>Tue, 02 Jan 2007 08:26:05 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[Webdevelopment]]></category>
		<category><![CDATA[ImageMagick]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[RMagick]]></category>

		<guid isPermaLink="false">http://info.michael-simons.eu/2007/01/02/ruby-on-rails-native-mysql-bindings-vs-rmagick/</guid>
		<description><![CDATA[I&#8217;m writing this post in english in hope that more people find it useful&#8230; Some times ago i really had bad problems installing the MySQL Gem 2.7 with Ruby 1.8.2 or 1.8.5 in conjunction with Rails 1.1.6 on Mac OS X 10.4 Compilation failed with: Building native extensions. This could take a while… mysql.c: In [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m writing this post in english in hope that more people find it useful&#8230;</p>
<p>Some times ago i really had bad problems installing the MySQL Gem 2.7 with Ruby 1.8.2 or 1.8.5 in conjunction with Rails 1.1.6 on Mac OS X 10.4</p>
<p>Compilation failed with:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">Building native extensions. This could take a <span style="color: #000000; font-weight: bold;">while</span>…
mysql.c: In <span style="color: #000000; font-weight: bold;">function</span> ‘Init_mysql’:
mysql.c:<span style="color: #000000;">2015</span>: error: ‘ulong’ undeclared <span style="color: #7a0874; font-weight: bold;">&#40;</span>first use <span style="color: #000000; font-weight: bold;">in</span> this <span style="color: #000000; font-weight: bold;">function</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
mysql.c:<span style="color: #000000;">2015</span>: error: <span style="color: #7a0874; font-weight: bold;">&#40;</span>Each undeclared identifier is reported only once
mysql.c:<span style="color: #000000;">2015</span>: error: <span style="color: #000000; font-weight: bold;">for</span> each <span style="color: #000000; font-weight: bold;">function</span> it appears in.<span style="color: #7a0874; font-weight: bold;">&#41;</span>
mysql.c:<span style="color: #000000;">2015</span>: error: parse error before numeric constant
mysql.c:<span style="color: #000000;">2018</span>: error: parse error before numeric constant
<span style="color: #c20cb9; font-weight: bold;">make</span>: <span style="color: #000000; font-weight: bold;">***</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>mysql.o<span style="color: #7a0874; font-weight: bold;">&#93;</span> Error <span style="color: #000000;">1</span>
mysql.c: In <span style="color: #000000; font-weight: bold;">function</span> ‘Init_mysql’:
mysql.c:<span style="color: #000000;">2015</span>: error: ‘ulong’ undeclared <span style="color: #7a0874; font-weight: bold;">&#40;</span>first use <span style="color: #000000; font-weight: bold;">in</span> this <span style="color: #000000; font-weight: bold;">function</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
mysql.c:<span style="color: #000000;">2015</span>: error: <span style="color: #7a0874; font-weight: bold;">&#40;</span>Each undeclared identifier is reported only once
mysql.c:<span style="color: #000000;">2015</span>: error: <span style="color: #000000; font-weight: bold;">for</span> each <span style="color: #000000; font-weight: bold;">function</span> it appears in.<span style="color: #7a0874; font-weight: bold;">&#41;</span>
mysql.c:<span style="color: #000000;">2015</span>: error: parse error before numeric constant
mysql.c:<span style="color: #000000;">2018</span>: error: parse error before numeric constant
<span style="color: #c20cb9; font-weight: bold;">make</span>: <span style="color: #000000; font-weight: bold;">***</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>mysql.o<span style="color: #7a0874; font-weight: bold;">&#93;</span> Error <span style="color: #000000;">1</span>
ruby extconf.rb <span style="color: #c20cb9; font-weight: bold;">install</span> mysql — –with-mysql-dir=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>mysql
checking <span style="color: #000000; font-weight: bold;">for</span> mysql_query<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000; font-weight: bold;">in</span> -lmysqlclient… no
checking <span style="color: #000000; font-weight: bold;">for</span> main<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000; font-weight: bold;">in</span> -lm… <span style="color: #c20cb9; font-weight: bold;">yes</span>
checking <span style="color: #000000; font-weight: bold;">for</span> mysql_query<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000; font-weight: bold;">in</span> -lmysqlclient… no
checking <span style="color: #000000; font-weight: bold;">for</span> main<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000; font-weight: bold;">in</span> -lz… <span style="color: #c20cb9; font-weight: bold;">yes</span>
checking <span style="color: #000000; font-weight: bold;">for</span> mysql_query<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000; font-weight: bold;">in</span> -lmysqlclient… <span style="color: #c20cb9; font-weight: bold;">yes</span>
checking <span style="color: #000000; font-weight: bold;">for</span> mysql_ssl_set<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>… <span style="color: #c20cb9; font-weight: bold;">yes</span>
checking <span style="color: #000000; font-weight: bold;">for</span> mysql.h… <span style="color: #c20cb9; font-weight: bold;">yes</span>
creating Makefile</pre></div></div>

<p>The gem would then install with <em>Successfully installed mysql-2.7</em>. Creepy!!! But that damn thing just didn&#8217;t work.</p>
<p>After quite some googling i found this one:</p>
<p><a href="http://i.nfectio.us/articles/2006/09/12/running-rails-on-os-x-with-mysql-5-0-24"> Running Rails on OS X with MySQL 5.0.24</a></p>
<p>It&#8217;s all about puting a little</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #339933;">#ifndef ulong </span>
<span style="color: #339933;">#define ulong unsigned long</span>
<span style="color: #339933;">#endif</span></pre></div></div>

<p>somewhere in &#8220;/usr/include/stdlib.h&#8221;.</p>
<p>This tipp is still necessary for MySQL 5.0.24+. Thanks again mate!!</p>
<p>But here the trouble starts&#8230;.</p>
<p>I put the define in a nice little conditional just in case but bah&#8230; It would come down to hunt me&#8230;</p>
<p>For my project <a href="http://dailyfratze.de">DailyFratze.de</a> i also need <a href="http://rmagick.rubyforge.org/">RMagick</a>. Again, the gem (1.14.1, 1.14.0 and 1.13) failed to compile but didn&#8217;t tell (on runtime it said &#8220;require &#8220;RMagick&#8221; LoadError: No such file to load &#8212; RMagick.so&#8221; &#8230; ) and installation from source did fail as well with:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">setup.rb:<span style="color: #000000;">655</span>:<span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">command</span><span style="color: #ff0000;">': system(&quot;make&quot;) failed (RuntimeError)
from setup.rb:664:in `make'</span>
from setup.rb:<span style="color: #000000;">1258</span>:<span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">`</span>setup_dir_ext<span style="color: #ff0000;">'
from setup.rb:1532:in `__send__'</span>
from setup.rb:<span style="color: #000000;">1532</span>:<span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">`</span>traverse<span style="color: #ff0000;">'
from setup.rb:1530:in `dive_into'</span>
from setup.rb:<span style="color: #000000;">1530</span>:<span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">`</span>traverse<span style="color: #ff0000;">'
from setup.rb:1534:in `traverse'</span>
from setup.rb:<span style="color: #000000;">1533</span>:<span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">`</span>each<span style="color: #ff0000;">'
... 8 levels...
from setup.rb:826:in `__send__'</span>
from setup.rb:<span style="color: #000000;">826</span>:<span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">`</span>invoke<span style="color: #ff0000;">'
from setup.rb:772:in `invoke'</span>
from setup.rb:<span style="color: #000000;">1578</span>
<span style="color: #c20cb9; font-weight: bold;">make</span>: <span style="color: #000000; font-weight: bold;">***</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>all<span style="color: #7a0874; font-weight: bold;">&#93;</span> Error <span style="color: #000000;">1</span></pre></div></div>

<p>Damn! After banging my head against the walls, reinstalling ImageMagick and all it&#8217;s depencies either direct from source, via i-installer and finally as mentioned <a href="http://rmagick.rubyforge.org/install-osx.html">here</a> i took a break, visited some porn sites and stuff like that and though, hmm&#8230; stdlib.h&#8230;.</p>
<p>I removed the little define and bam! It&#8217;s that easy, RMagick compiles just fine&#8230; </p>
<p>From the forums i found i guess other people with the same error message may have the same problem as i had&#8230;</p>
<p>I really wish installing a ruby on rails environment would be a less pain in the ass&#8230;. somewhere near as easy as developing with rails.</p>
<p class="akst_link"><a href="http://info.michael-simons.eu/?p=53&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_53" class="akst_share_link " rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://info.michael-simons.eu/2007/01/02/ruby-on-rails-native-mysql-bindings-vs-rmagick/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Kaputte UTF-8 Daten im Servlet</title>
		<link>http://info.michael-simons.eu/2006/10/05/kaputte-utf-8-daten-im-servlet/</link>
		<comments>http://info.michael-simons.eu/2006/10/05/kaputte-utf-8-daten-im-servlet/#comments</comments>
		<pubDate>Thu, 05 Oct 2006 09:31:09 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Webdevelopment]]></category>
		<category><![CDATA[J2EE]]></category>
		<category><![CDATA[Spring]]></category>
		<category><![CDATA[Tomcat]]></category>

		<guid isPermaLink="false">http://info.michael-simons.eu/2006/10/05/kaputte-utf-8-daten-im-servlet/</guid>
		<description><![CDATA[Beruflich habe ich gerade mit einer Webanwendung zu tun, die mit Spring realisiert ist. Spring macht ähnlich viel Spaß wie Ruby und ist bis jetzt das erste J2EE Framework, dass mir von Anfang zusagte und es auch schaffte, mich zu begeistern. Die Webanwendung ist komplett UTF-8 basiert. Soweit so gut. Leider mußte ich feststellen, dass [...]]]></description>
			<content:encoded><![CDATA[<p>Beruflich habe ich gerade mit einer Webanwendung zu tun, die mit <a href="http://springframework.org/">Spring</a> realisiert ist. Spring macht ähnlich viel Spaß wie Ruby und ist bis jetzt das erste J2EE Framework, dass mir von Anfang zusagte und es auch schaffte, mich zu begeistern.</p>
<p>Die Webanwendung ist komplett UTF-8 basiert. Soweit so gut. Leider mußte ich feststellen, dass Eingaben per form nicht so ankamen, wie ich mir das vorgestellt hatte, irgendwo ging das Characterset verloren.</p>
<p>Ich nutze zur Zeit Java 1.5.0.8, Apache Tomcat 5.5.17, Spring 1.2.8 sowie Hibernate 3.1.x. Irgendwo im Zusammenspiel der ersten drei Komponenten trat der Fehler auf, obwohl ich in allen beteiligten JSP Dateien den Content Type angegeben habe. Ich habe mir jetzt mit folgenden Filter beholfen, der dafür sorgt, dass UTF-8 auch als solches ankommt:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">filter</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.io.IOException</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.servlet.Filter</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.servlet.FilterChain</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.servlet.FilterConfig</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.servlet.ServletException</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.servlet.ServletRequest</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.servlet.ServletResponse</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> CharsetFilter <span style="color: #000000; font-weight: bold;">implements</span> Filter <span style="color: #009900;">&#123;</span>
	FilterConfig config<span style="color: #339933;">;</span>
	<span style="color: #003399;">String</span> encoding <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;UTF-8&quot;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #008000; font-style: italic; font-weight: bold;">/**
	 * @see javax.servlet.Filter#destroy()
	 */</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> destroy<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #008000; font-style: italic; font-weight: bold;">/**
	 * Sets the character encoding on the request
	 * @see javax.servlet.Filter#doFilter(javax.servlet.Servle tRequest, javax.servlet.ServletResponse, javax.servlet.FilterChain)
	 */</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> doFilter<span style="color: #009900;">&#40;</span>ServletRequest request, ServletResponse response,
			FilterChain chain<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> <span style="color: #003399;">IOException</span>, ServletException <span style="color: #009900;">&#123;</span>
		request.<span style="color: #006633;">setCharacterEncoding</span><span style="color: #009900;">&#40;</span>encoding<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		chain.<span style="color: #006633;">doFilter</span><span style="color: #009900;">&#40;</span>request, response<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #008000; font-style: italic; font-weight: bold;">/**
	 * @see javax.servlet.Filter#init(javax.servlet.FilterConf ig)
	 */</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> init<span style="color: #009900;">&#40;</span>FilterConfig config<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> ServletException <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">config</span> <span style="color: #339933;">=</span> config<span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">encoding</span> <span style="color: #339933;">=</span> config.<span style="color: #006633;">getInitParameter</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;requestEncoding&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Der Filter kann im web.xml einfach konfiguriert werden:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		charsetFilter
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filter-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter-class<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		filter.CharsetFilter
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filter-class<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;init-param<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;param-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>requestEncoding<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/param-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;param-value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>UTF-8<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/param-value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/init-param<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter-mapping<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>charsetFilter<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filter-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;url-pattern<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>/app/html/*<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/url-pattern<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filter-mapping<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p class="akst_link"><a href="http://info.michael-simons.eu/?p=39&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_39" class="akst_share_link " rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://info.michael-simons.eu/2006/10/05/kaputte-utf-8-daten-im-servlet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Spring und JNDI Datasources</title>
		<link>http://info.michael-simons.eu/2006/09/21/spring-und-jndi-datasources/</link>
		<comments>http://info.michael-simons.eu/2006/09/21/spring-und-jndi-datasources/#comments</comments>
		<pubDate>Thu, 21 Sep 2006 07:44:12 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Webdevelopment]]></category>
		<category><![CDATA[J2EE]]></category>
		<category><![CDATA[Spring]]></category>
		<category><![CDATA[Tipps]]></category>

		<guid isPermaLink="false">http://info.michael-simons.eu/2006/09/21/spring-und-jndi-datasources/</guid>
		<description><![CDATA[Ich nutze gerade das J2EE Framework Spring zusammen mit Hibernate und Oracle für eine Webanwendung. Die Hibernate DataSource kann entweder über eine DriverManagerDataSource und Angabe der Verbindungsparameter innerhalb der Webanwendung gesteuert werden, oder es kann eine JNDI Datasource des Application Containers (in dem Fall Tomcat) genutzt werden: &#60;bean id=&#34;serverDataSource&#34; class=&#34;org.springframework.jndi.JndiObjectFactoryBean&#34;&#62; &#60;property name=&#34;jndiName&#34; value=&#34;java:comp/env/jdbc/blah&#34;/&#62; &#60;/bean&#62; Der [...]]]></description>
			<content:encoded><![CDATA[<p>Ich nutze gerade das J2EE Framework Spring zusammen mit Hibernate und Oracle für eine Webanwendung. </p>
<p>Die Hibernate DataSource kann entweder über eine DriverManagerDataSource und Angabe der Verbindungsparameter innerhalb der Webanwendung gesteuert werden, oder es kann eine JNDI Datasource des Application Containers (in dem Fall Tomcat) genutzt werden:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bean</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;serverDataSource&quot;</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;org.springframework.jndi.JndiObjectFactoryBean&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;jndiName&quot;</span>  <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;java:comp/env/jdbc/blah&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bean<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Der Trick dabei ist, den vollständigen Namen der DataSource anzugeben, also &#8220;java:comp/env/jdbc/blah&#8221; statt &#8220;jdbc/blah&#8221;, ansonsten bekommt nur &#8220;javax.naming.NameNotFoundException: Name jdbc is not bound in this Context&#8221; um die Ohren geschlagen, auch wenn man die DataSource im Tomcat konfiguriert hat.</p>
<p>Bah, das sowas immer soviel Zeit kosten muss&#8230;.</p>
<p class="akst_link"><a href="http://info.michael-simons.eu/?p=37&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_37" class="akst_share_link " rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://info.michael-simons.eu/2006/09/21/spring-und-jndi-datasources/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Der virtuelle Nachsendeauftrag</title>
		<link>http://info.michael-simons.eu/2006/09/09/der-virtuelle-nachsendeauftrag/</link>
		<comments>http://info.michael-simons.eu/2006/09/09/der-virtuelle-nachsendeauftrag/#comments</comments>
		<pubDate>Sat, 09 Sep 2006 11:15:43 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Webdevelopment]]></category>
		<category><![CDATA[mod_rewrite]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://info.michael-simons.eu/2006/09/09/der-virtuelle-nachsendeauftrag/</guid>
		<description><![CDATA[Passend zum vorherigen Eintrag Der Umzug ein kleiner HTTP Redirect Tipp: Ich habe mich ein bisschen schlau gemacht, wie man der Welt im allgemeinen und Suchmaschinen im speziellen am besten mitteilt, dass sich eine URL geändert hat. Der goldene Weg ist der entsprechende HTTP Header: 301, permanently moved. Das ist mit wenigen Zeilen PHP schnell [...]]]></description>
			<content:encoded><![CDATA[<p>Passend zum vorherigen Eintrag <a href="http://info.michael-simons.eu/2006/09/08/umzug/">Der Umzug</a> ein kleiner HTTP Redirect Tipp:</p>
<p>Ich habe mich ein bisschen schlau gemacht, wie man der Welt im allgemeinen und Suchmaschinen im speziellen am besten mitteilt, dass sich eine URL geändert hat.</p>
<p>Der goldene Weg ist der entsprechende HTTP Header: 301, permanently moved. Das ist mit wenigen Zeilen PHP schnell erledigt:</p>

<div class="wp_syntax"><div class="code"><pre class="php-brief" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
	<span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;HTTP/1.1 301 Moved Permanently&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Location: http://info.michael-simons.eu&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #990000;">exit</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Diese Methode ist auf jedenfall einem Refresh über Meta Tags vorzuziehen, da die Bots der Suchmaschinen so ihre Indizes aktualisieren.</p>
<p>In dem Zusammen stieß ich auf folgenden Artikel: <a href="http://ekstreme.com/webmaster/301-redirection.php" rel="external">Redirects using HTTP 301 headers</a>. Dort wird anschaulich dagelegt, dass es für das Suchmaschinen Ranking einer Seite nicht gut ist, wenn z.B. www.michael-simons.eu auf www.michael-simons.eu zeigt, michael-simons.eu auf michael-simons.eu. Suchmaschinenbetreiber stufen dadurch teilweise beide Seiten schlechter ein, weil identischer Content über unterschiedliche Domains zu erreichen sind.</p>
<p>Das kann vermieden werden, indem entweder beide Domains auf michael-simons.eu verweisen oder beide auf www.michael-simons.eu. Beispiel: Wird www.michael-simons.eu als Zieladresse in den Browser eingegeben, landet man genauso auf michael-simons.eu, als wenn man es direkt eingibt.  Umgekehrt ist es genauso in Ordnung.</p>
<p>Das Problem lässt sich durch einen Eintrag in die .htaccess Datei mit aktivierten mod_rewrite leicht lösen:</p>

<div class="wp_syntax"><div class="code"><pre class="apache" style="font-family:monospace;"><span style="color: #00007f;">RewriteEngine</span> <span style="color: #0000ff;">on</span>
<span style="color: #00007f;">RewriteCond</span> %{HTTP_HOST} ^www\.michael-simons\.eu [nc]
<span style="color: #00007f;">RewriteRule</span> (.*) http://michael-simons.eu/$1 [R=<span style="color: #ff0000;">301</span>,L]</pre></div></div>

<p class="akst_link"><a href="http://info.michael-simons.eu/?p=31&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_31" class="akst_share_link " rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://info.michael-simons.eu/2006/09/09/der-virtuelle-nachsendeauftrag/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Suchphrasen speichern mit BBClone</title>
		<link>http://info.michael-simons.eu/2006/05/11/suchphrasen-speichern-mit-bbclone/</link>
		<comments>http://info.michael-simons.eu/2006/05/11/suchphrasen-speichern-mit-bbclone/#comments</comments>
		<pubDate>Thu, 11 May 2006 16:20:45 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Webdevelopment]]></category>
		<category><![CDATA[BBClone]]></category>
		<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[Hacks]]></category>

		<guid isPermaLink="false">http://info.michael-simons.eu/2006/05/11/suchphrasen-speichern-mit-bbclone/</guid>
		<description><![CDATA[Seit geraumer Zeit nutze ich BBClone für Statistiken. Einfach und gut zu bedienen, wie ich finde. Leider speichert BBClone in den Top n nur einzelne Suchwörter und keine Phrasen. Das kann man aber leicht ändern, wie ich in diesem Blog gefunden habe. Gleichzeit wird dort auch beschrieben, wie man BBClone die Zusammenarbeit mit WordPress nahe [...]]]></description>
			<content:encoded><![CDATA[<p>Seit geraumer Zeit nutze ich <a href="http://www.bbclone.de" rel="external">BBClone</a> für Statistiken. Einfach und gut zu bedienen, wie ich finde.</p>
<p>Leider speichert BBClone in den Top n nur einzelne Suchwörter und keine Phrasen. Das kann man aber leicht ändern, wie ich in diesem <a href="http://jei.afraid.org/wordpress/index.php?tag=bbclone">Blog</a> gefunden habe. Gleichzeit wird dort auch beschrieben, wie man BBClone die Zusammenarbeit mit WordPress nahe bringt.</p>
<p>Ich habe den <a id="p35" rel="attachment" href="http://info.michael-simons.eu/2006/05/11/suchphrasen-speichern-mit-bbclone/log_processorphptxt/" title="log_processor.php.txt">BBClone Log Processor</a> entsprechend angepasst. Um ihn im eigenem BBClone zu verwenden, einfach runterladen, die Endung .txt entfernen und die entsprechende log_processor.php im BBClone Verzeichnis ersetzen.<br />
Die Datei basiert auf dem Log Processor von BBClone 0.4.8b.</p>
<p class="akst_link"><a href="http://info.michael-simons.eu/?p=36&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_36" class="akst_share_link " rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://info.michael-simons.eu/2006/05/11/suchphrasen-speichern-mit-bbclone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.700 seconds -->

