<?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>Linux Showroom &#187; Howto</title>
	<atom:link href="http://www.linux-showroom.com/topics/howto/feed" rel="self" type="application/rss+xml" />
	<link>http://www.linux-showroom.com</link>
	<description>My daily dosis of linux usage</description>
	<lastBuildDate>Sat, 06 Mar 2010 13:48:10 +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>High available NFS4 server with drbd 0.8, pacemaker 1.0, heartbeat, openais on OpenSUSE 11.1</title>
		<link>http://www.linux-showroom.com/2009/08/08/high-available-nfs4-server-with-drbd-0-8-pacemaker-1-0-heartbeat-openais-on-opensuse-11-1.html</link>
		<comments>http://www.linux-showroom.com/2009/08/08/high-available-nfs4-server-with-drbd-0-8-pacemaker-1-0-heartbeat-openais-on-opensuse-11-1.html#comments</comments>
		<pubDate>Sat, 08 Aug 2009 14:07:42 +0000</pubDate>
		<dc:creator>Fabio</dc:creator>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[OpenSuSE]]></category>
		<category><![CDATA[administration]]></category>
		<category><![CDATA[drbd]]></category>
		<category><![CDATA[HAproxy]]></category>
		<category><![CDATA[Heartbeat]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[Openais]]></category>
		<category><![CDATA[Pacemaker]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[webserver]]></category>

		<guid isPermaLink="false">http://www.linux-showroom.com/?p=64</guid>
		<description><![CDATA[For my podcast project I got five new root servers whic [...]<p><br /><br />
This post originated from the <a href="http://www.linux-showroom.com/feed/">Linux Showroom feed</a>. Please check out <a href="http://www.linux-showroom.com">Linux Showroom</a> for more posts.<br/><br/><a href="http://www.linux-showroom.com/2009/08/08/high-available-nfs4-server-with-drbd-0-8-pacemaker-1-0-heartbeat-openais-on-opensuse-11-1.html">High available NFS4 server with drbd 0.8, pacemaker 1.0, heartbeat, openais on OpenSUSE 11.1</a></p>
]]></description>
			<content:encoded><![CDATA[<p>For my <a href="http://www.podcast.de">podcast project</a> I got five new root servers which are all connected internally through a switch. Two of the servers are connected directly over a crossover cable. Those two servers have 3 NICs, the other 2 servers have 2 NICs.</p>
<p>I share the website&#8217;s HTML, images and other resources through the NFS server to all five servers. All servers work as <a href="http://www.linux-showroom.com/2008/08/16/apache-and-lighttpd-replaced-by-nginx-for-php-application.html">webservers with nginx and PHP-fpm</a>. Each server also runs one more specific service: database master, solr master, cron jobs / crawler processes, Varnish / HAproxy.</p>
<p>The two directly connected servers share the static website resources over <a href="http://www.drbd.org">drbd</a>. <a href="http://www.clusterlabs.org">Pacemaker</a>, heartbeat and openais secure the high availability of my NFS4 server. Setting this up took quiet a bit of fiddeling as there are how-tos for so many different (and outdated) versions are floating around the internet.</p>
<p><br /><br />
This post originated from the <a href="http://www.linux-showroom.com/feed/">Linux Showroom feed</a>. Please check out <a href="http://www.linux-showroom.com">Linux Showroom</a> for more posts.<br/><br/><a href="http://www.linux-showroom.com/2009/08/08/high-available-nfs4-server-with-drbd-0-8-pacemaker-1-0-heartbeat-openais-on-opensuse-11-1.html">High available NFS4 server with drbd 0.8, pacemaker 1.0, heartbeat, openais on OpenSUSE 11.1</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.linux-showroom.com/2009/08/08/high-available-nfs4-server-with-drbd-0-8-pacemaker-1-0-heartbeat-openais-on-opensuse-11-1.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to find out user id on linux system</title>
		<link>http://www.linux-showroom.com/2009/04/03/how-to-find-out-user-id-on-linux-system.html</link>
		<comments>http://www.linux-showroom.com/2009/04/03/how-to-find-out-user-id-on-linux-system.html#comments</comments>
		<pubDate>Fri, 03 Apr 2009 13:44:40 +0000</pubDate>
		<dc:creator>Fabio</dc:creator>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[groups]]></category>
		<category><![CDATA[id]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[OpenSuSE]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[system]]></category>
		<category><![CDATA[user]]></category>
		<category><![CDATA[user id]]></category>
		<category><![CDATA[Yast]]></category>

		<guid isPermaLink="false">http://www.linux-showroom.com/?p=40</guid>
		<description><![CDATA[For a mount command I needed to find out what user id m [...]<p><br /><br />
This post originated from the <a href="http://www.linux-showroom.com/feed/">Linux Showroom feed</a>. Please check out <a href="http://www.linux-showroom.com">Linux Showroom</a> for more posts.<br/><br/><a href="http://www.linux-showroom.com/2009/04/03/how-to-find-out-user-id-on-linux-system.html">How to find out user id on linux system</a></p>
]]></description>
			<content:encoded><![CDATA[<p>For a mount command I needed to find out what user id my user account had. There are several ways to find out. As root you could look into the passwd file (most likely /etc/passwd) or on OpenSuSE use the Yast user module. But I was looking for a way to find out my user id with my ordinary user account. The command I was looking for is <strong>id</strong>. Just open up a shell (konsole on KDE4) with your active user, type id and you get all the information about your user including groups and their ids. If you just want to know the user&#8217;s id, e.g. for a shell script use</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">id</span> <span style="color: #660033;">-u</span> USERNAME</pre></div></div>

<p>and you get back just the id of the user. Simple as that!</p>
<p><br /><br />
This post originated from the <a href="http://www.linux-showroom.com/feed/">Linux Showroom feed</a>. Please check out <a href="http://www.linux-showroom.com">Linux Showroom</a> for more posts.<br/><br/><a href="http://www.linux-showroom.com/2009/04/03/how-to-find-out-user-id-on-linux-system.html">How to find out user id on linux system</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.linux-showroom.com/2009/04/03/how-to-find-out-user-id-on-linux-system.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ejabberd on GNU/Linux OpenSuSE 11.0</title>
		<link>http://www.linux-showroom.com/2008/11/24/ejabberd-on-gnulinux-opensuse-110.html</link>
		<comments>http://www.linux-showroom.com/2008/11/24/ejabberd-on-gnulinux-opensuse-110.html#comments</comments>
		<pubDate>Mon, 24 Nov 2008 13:41:39 +0000</pubDate>
		<dc:creator>Fabio</dc:creator>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[administration]]></category>
		<category><![CDATA[ejabberd]]></category>
		<category><![CDATA[erlang]]></category>
		<category><![CDATA[jabber]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[OpenSuSE]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://www.linux-showroom.com/?p=15</guid>
		<description><![CDATA[I heard about the successful usage of ejabberd from web [...]<p><br /><br />
This post originated from the <a href="http://www.linux-showroom.com/feed/">Linux Showroom feed</a>. Please check out <a href="http://www.linux-showroom.com">Linux Showroom</a> for more posts.<br/><br/><a href="http://www.linux-showroom.com/2008/11/24/ejabberd-on-gnulinux-opensuse-110.html">ejabberd on GNU/Linux OpenSuSE 11.0</a></p>
]]></description>
			<content:encoded><![CDATA[<p>I heard about the successful usage of ejabberd from <a href="http://www.weblin.com">weblin</a>&#8217;s CTO Heiner yesterday at lunch during <a href="http://barcamphamburg2008.mixxt.de">BarCamp Hamburg 08</a>. </p>
<p>I was thinking of deploying jabber services for <a href="http://www.podcast.de">podcast.de</a> for a while now but couldn&#8217;t decide which server to take. I checked the <a href="http://www.ejabberd.im">ejabberd website</a>. The software looks promising. So I give it a try.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">smart <span style="color: #c20cb9; font-weight: bold;">install</span> ejabberd</pre></div></div>

<p>Could not find any results. So I check <a href="http://software.opensuse.org/search">OpenSuSE software search</a>. Luckily it lists a source which I add to my smart sources.</p>
<p><span id="more-15"></span></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">smart channel <span style="color: #660033;">--edit</span></pre></div></div>

<p><script type="text/javascript"><!--
google_ad_client = "pub-7400231638705781";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_type = "text";
google_ad_channel = "";
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "BA6600";
google_color_text = "3F3F3F";
google_color_url = "3F3F3F";
//-->
</script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>Cyberorg<span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #7a0874; font-weight: bold;">type</span> = rpm-md
name = Cyberorg
baseurl = http:<span style="color: #000000; font-weight: bold;">//</span>download.opensuse.org<span style="color: #000000; font-weight: bold;">/</span>repositories<span style="color: #000000; font-weight: bold;">/</span>home:<span style="color: #000000; font-weight: bold;">/</span>cyberorg:<span style="color: #000000; font-weight: bold;">/</span>sugar<span style="color: #000000; font-weight: bold;">/</span>openSUSE_11.0<span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

<p>On to install the <strong>ejabberd</strong> package:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">smart <span style="color: #c20cb9; font-weight: bold;">install</span> ejabberd</pre></div></div>

<p>I get a report that I am still missing a package for <em>erlang</em> as ejabberd is written in <strong>erlang</strong>. I use the OpenSuSE software search again which lists the following source:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>NicoK<span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #7a0874; font-weight: bold;">type</span> = rpm-md
name = NicoK
baseurl = http:<span style="color: #000000; font-weight: bold;">//</span>download.opensuse.org<span style="color: #000000; font-weight: bold;">/</span>repositories<span style="color: #000000; font-weight: bold;">/</span>home:<span style="color: #000000; font-weight: bold;">/</span>NicoK<span style="color: #000000; font-weight: bold;">/</span>openSUSE_11.0<span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

<p>Now I can install ejabberd: ejabberd-2.0.0-2.11@x86_64<br />
I also need one more package: erlang-R12B4-18.11@x86_64</p>
<p>The beauty of installing pre-compiled RPMs on OpenSuSE. You almost always get a rc-file along with the RPM (for server software that is).</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">rce -<span style="color: #000000; font-weight: bold;">&gt;</span> Tab -<span style="color: #000000; font-weight: bold;">&gt;</span> rcejabberd</pre></div></div>

<p>There it is. Great! Now I want to change the default configuration. I would expect a config file to sit in /etc/sysconfig but ejabberd brings its own directory under /etc/ejabberd where two config files reside: ejabberd.cfg and ejabberdctl.cfg.</p>
<p>I read before that ejabberd.cfg is the heart of ejabberd. So I edit this for local usage only ATM.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-7400231638705781";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_type = "text";
google_ad_channel = "";
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "BA6600";
google_color_text = "3F3F3F";
google_color_url = "3F3F3F";
//-->
</script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#123;</span>hosts, <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>ip, <span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #000000;">127</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#125;</span>.</pre></div></div>

<p>I give it a try:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">rcejabberd start
Starting ejabberd    <span style="color: #000000; font-weight: bold;">done</span></pre></div></div>

<p>Looks like it started. Too bad checking <a href="http://127.0.0.1:5280/admin">http://127.0.0.1:5280/admin</a> does not work. I check for an error in the log dir <strong>/var/log/ejabberd/</strong> just to find out no files have been created. <em>ps aux</em> shows me some erlang stuff is running: <em>/usr/lib64/erlang/erts-5.6.4/bin/epmd -daemon</em> but no jabber process(es) which I would suspect.</p>
<p>I am increasing the loglevel to debug (5):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#123;</span>loglevel, <span style="color: #000000;">5</span><span style="color: #7a0874; font-weight: bold;">&#125;</span>.</pre></div></div>

<p>No change. I remove <em>-detached</em> in the run script and try again. This time I get debug messages on the shell:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">rcejabberd start
Starting ejabberd Erlang <span style="color: #7a0874; font-weight: bold;">&#40;</span>BEAM<span style="color: #7a0874; font-weight: bold;">&#41;</span> emulator version 5.6.4 <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">source</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">64</span>-bit<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>smp:<span style="color: #000000;">2</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>async-threads:<span style="color: #000000;">0</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>hipe<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>kernel-poll:<span style="color: #c20cb9; font-weight: bold;">false</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #ff0000;">&quot;init terminating in do_boot&quot;</span>,<span style="color: #7a0874; font-weight: bold;">&#123;</span>undef,<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>ejabberd,start,<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#125;</span>,<span style="color: #7a0874; font-weight: bold;">&#123;</span>init,start_it,<span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#125;</span>,<span style="color: #7a0874; font-weight: bold;">&#123;</span>init,start_em,<span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #7a0874; font-weight: bold;">&#125;</span>
Crash dump was written to: erl_crash.dump init terminating <span style="color: #000000; font-weight: bold;">in</span> do_boot<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>    failed</pre></div></div>

<p>At this point I have to give up the experiment as I have no time to fiddle around with erlang problems.</p>
<p><br /><br />
This post originated from the <a href="http://www.linux-showroom.com/feed/">Linux Showroom feed</a>. Please check out <a href="http://www.linux-showroom.com">Linux Showroom</a> for more posts.<br/><br/><a href="http://www.linux-showroom.com/2008/11/24/ejabberd-on-gnulinux-opensuse-110.html">ejabberd on GNU/Linux OpenSuSE 11.0</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.linux-showroom.com/2008/11/24/ejabberd-on-gnulinux-opensuse-110.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apache and lighttpd replaced by nginx for PHP application</title>
		<link>http://www.linux-showroom.com/2008/08/16/apache-and-lighttpd-replaced-by-nginx-for-php-application.html</link>
		<comments>http://www.linux-showroom.com/2008/08/16/apache-and-lighttpd-replaced-by-nginx-for-php-application.html#comments</comments>
		<pubDate>Sat, 16 Aug 2008 19:29:00 +0000</pubDate>
		<dc:creator>Fabio</dc:creator>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[administration]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[backend]]></category>
		<category><![CDATA[HAproxy]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[lighttpd]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[PHP-FPM]]></category>
		<category><![CDATA[Scalability]]></category>
		<category><![CDATA[Settings]]></category>
		<category><![CDATA[Squid]]></category>
		<category><![CDATA[stack]]></category>
		<category><![CDATA[Varnish]]></category>
		<category><![CDATA[webserver]]></category>

		<guid isPermaLink="false">http://www.linux-showroom.com/?p=9</guid>
		<description><![CDATA[A while back I wrote an article Switching from Apache H [...]<p><br /><br />
This post originated from the <a href="http://www.linux-showroom.com/feed/">Linux Showroom feed</a>. Please check out <a href="http://www.linux-showroom.com">Linux Showroom</a> for more posts.<br/><br/><a href="http://www.linux-showroom.com/2008/08/16/apache-and-lighttpd-replaced-by-nginx-for-php-application.html">Apache and lighttpd replaced by nginx for PHP application</a></p>
]]></description>
			<content:encoded><![CDATA[<p>A while back I wrote an article <a href="http://www.linux-showroom.com/2007/11/19/switching-from-apache-http-server-to-lighttpd-installing-lighttpd.html">Switching from Apache HTTP Server to Lighttpd &#8211; Installing Lighttpd</a>. Back then I migrated static stuff to lighttpd but left the dynamic stuff (PHP) with Apache.</p>
<p>I was never really satisfied with the speed of our system under load. I tried and tried. I optimized a lot of stuff in the backend and with the database. Most of the time I found a switch to make the system just a bit faster. Read <a href="http://www.webcoder.de/2008/01/15/retrospective-on-three-years-of-seagull-development.html">Retrospective on three years of Seagull development</a> if you are interested in the whole story.</p>
<p><span id="more-9"></span></p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-7400231638705781";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_type = "text";
google_ad_channel = "";
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "BA6600";
google_color_text = "3F3F3F";
google_color_url = "3F3F3F";
//-->
</script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p>In the last couple of weeks I ran out of ideas on where to improve next (without the need of rewriting too much code). I remembered using <a href="http://www.squid-cache.org/">Squid</a> years ago. I had a look at the newest version (3.0) and my interest in Squid stopped pretty soon after reading through the documentation. It was just not the software I needed.</p>
<p>I dived into spreading the load to multiple backends using <a href="http://haproxy.1wt.eu/">HAproxy</a> which by the way has a super active community. Check the mailinglist. The maintainer Willy is doing a great job. Learning about HAproxy I stumbled across the webserver <a href="http://wiki.codemongers.com/Main">nginx</a> (pronounced engine x) numerous times. Learning about nginx I stumbled across the reverse proxy <a href="http://varnish.projects.linpro.no/">Varnish</a> which is the proxy solution I hoped Squid would be. Furtherdown the line I ran into PHP-FPM &#8211; the PHP FastCGI Process Manager &#8211; which should not stay unmentioned.</p>
<p>So I read lots of blog posts, mails from mailinglists, documentation, articles, visited several forums and also learned many new things in a few wikis. So after getting the idea I had my stack together: Varnish -> HAproxy -> nginx -> PHP -> MySQL</p>
<p>Time to test it out! Varnish comes in a relatively uptodate package for my favorite distribution OpenSuSE (currently running 10.3 on 6 systems). HAproxy is available in a fresh version. nginx is theoretically available. It cannot install it though because of a package management conflict. So I downloaded the source for the newest stable version (0.6.3 as time of writing) and compiled it.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>sysoev.ru<span style="color: #000000; font-weight: bold;">/</span>nginx<span style="color: #000000; font-weight: bold;">/</span>nginx-0.6.32.tar.gz
.<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">--prefix</span>=<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>software<span style="color: #000000; font-weight: bold;">/</span>nginx-0.6.32 <span style="color: #660033;">--user</span>=nginx <span style="color: #660033;">--group</span>=nginx --without-mail_pop3_module --without-mail_imap_module --without-mail_smtp_module
<span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>

<p>I did not need to install any extra packages. Frankly spoken I do have all the packages for compilation of C/C++ installed.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>software
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>software<span style="color: #000000; font-weight: bold;">/</span>nginx-0.6.32 nginx</pre></div></div>

<p>I always set a symlink to the currently used package. That way it is easy to replace the package when new versions come out. I can compile and install the new version and just switch the symlink.</p>
<p>Next thing I had to compile was a patched PHP version. So download the sources at <a href="http://www.php.net">php.net</a> and the patches at the <a href="http://php-fpm.anight.org/">PHP-FPM</a> site.</p>
<p>Unpack the PHP source:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">tar</span> xjvf php-5.2.6.tar.bz2</pre></div></div>

<p>Patch the source:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">gzip</span> <span style="color: #660033;">-cd</span> php-5.2.6-fpm-0.5.8.diff.gz <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">patch</span> <span style="color: #660033;">-d</span> php-5.2.6 <span style="color: #660033;">-p1</span></pre></div></div>

<p>Configure PHP (adjust your settings accordingly):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">LDFLAGS</span>=<span style="color: #ff0000;">&quot;-L/usr/lib64&quot;</span> .<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">--with-curl</span> <span style="color: #660033;">--disable-debug</span> <span style="color: #660033;">--enable-libxml</span> <span style="color: #660033;">--enable-session</span> <span style="color: #660033;">--with-pcre-regex</span> <span style="color: #660033;">--enable-xml</span> <span style="color: #660033;">--with-bz2</span> <span style="color: #660033;">--with-zlib</span> <span style="color: #660033;">--enable-exif</span> <span style="color: #660033;">--enable-inline-optimization</span> <span style="color: #660033;">--enable-soap</span> <span style="color: #660033;">--enable-sockets</span> <span style="color: #660033;">--with-xmlrpc</span> <span style="color: #660033;">--without-pear</span> <span style="color: #660033;">--with-libdir</span>=lib64 <span style="color: #660033;">--with-mysql</span> <span style="color: #660033;">--with-mysqli</span> <span style="color: #660033;">--enable-mbstring</span> <span style="color: #660033;">--with-mcrypt</span> <span style="color: #660033;">--with-mhash</span> <span style="color: #660033;">--with-mime-magic</span> <span style="color: #660033;">--with-jpeg-dir</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib64 <span style="color: #660033;">--with-png-dir</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib64 <span style="color: #660033;">--with-gd</span> <span style="color: #660033;">--enable-gd-native-ttf</span> <span style="color: #660033;">--with-ttf</span> <span style="color: #660033;">--with-freetype-dir</span> <span style="color: #660033;">--enable-ftp</span> <span style="color: #660033;">--enable-zend-multibyte</span> <span style="color: #660033;">--with-openssl</span> <span style="color: #660033;">--enable-force-cgi-redirect</span> <span style="color: #660033;">--with-pcre-regex</span> <span style="color: #660033;">--without-sqlite</span> <span style="color: #660033;">--without-mm</span> <span style="color: #660033;">--enable-fastcgi</span> <span style="color: #660033;">--enable-bcmath</span> <span style="color: #660033;">--enable-fpm</span> <span style="color: #660033;">--quiet</span> <span style="color: #660033;">--prefix</span>=<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>software<span style="color: #000000; font-weight: bold;">/</span>php5.2.6-fpm</pre></div></div>

<p>Compile and install:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #000000; font-weight: bold;">&amp;</span> <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>

<p>Adjust the PHP-FPM settings to fit your needs. You can find more info on this and related subjects in the <a href="http://php-fpm.anight.org/docs.html">PHP-FPM documentation</a>.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">vim</span> <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>software<span style="color: #000000; font-weight: bold;">/</span>php<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>php-fpm.conf</pre></div></div>

<p>Start PHP-FPM:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>software<span style="color: #000000; font-weight: bold;">/</span>php<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>php-cgi <span style="color: #660033;">--fpm</span></pre></div></div>

<p>Have a look in the log files:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>software<span style="color: #000000; font-weight: bold;">/</span>php<span style="color: #000000; font-weight: bold;">/</span>logs<span style="color: #000000; font-weight: bold;">/</span>php-fpm.log</pre></div></div>

<p>Now you can connect through your webserver to fast-cgi processes. I use nginx as webserver (see above). Advantages and disadvantes of fast-cgi vs. mod-based approaches et al have been covered elsewhere. For me this makes perfectly sense and works extremly well.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-7400231638705781";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_type = "text";
google_ad_channel = "";
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "BA6600";
google_color_text = "3F3F3F";
google_color_url = "3F3F3F";
//-->
</script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p>After playing around with Varnish for a while I decided I do not need HAProxy ATM. Varnish can do all the decisions I need to make based on HTTP headers. I configured Varnish&#8217;s config file (here: vcl.conf) by reading lots of examples on the net and trial and error.</p>
<p>If I find more time and anyone is interested I post more details on the configuration of nginx and Varnish. But for now I want to publish this post as it has been sitting here for a while already.</p>
<p>PS: If people say content is king they are absolutely right. But never forget in the internet speed is Kaiser!</p>
<p><br /><br />
This post originated from the <a href="http://www.linux-showroom.com/feed/">Linux Showroom feed</a>. Please check out <a href="http://www.linux-showroom.com">Linux Showroom</a> for more posts.<br/><br/><a href="http://www.linux-showroom.com/2008/08/16/apache-and-lighttpd-replaced-by-nginx-for-php-application.html">Apache and lighttpd replaced by nginx for PHP application</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.linux-showroom.com/2008/08/16/apache-and-lighttpd-replaced-by-nginx-for-php-application.html/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Solved: Miro won&#8217;t start &#8211; missing video directory</title>
		<link>http://www.linux-showroom.com/2008/03/31/solved-miro-wont-start-missing-video-directory.html</link>
		<comments>http://www.linux-showroom.com/2008/03/31/solved-miro-wont-start-missing-video-directory.html#comments</comments>
		<pubDate>Sun, 30 Mar 2008 22:09:48 +0000</pubDate>
		<dc:creator>Fabio</dc:creator>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[Miro]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Podcatcher]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[TV]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://www.linux-showroom.com/2008/03/31/solved-miro-wont-start-missing-video-directory.html</guid>
		<description><![CDATA[A couple of days ago a brand new version of Miro the op [...]<p><br /><br />
This post originated from the <a href="http://www.linux-showroom.com/feed/">Linux Showroom feed</a>. Please check out <a href="http://www.linux-showroom.com">Linux Showroom</a> for more posts.<br/><br/><a href="http://www.linux-showroom.com/2008/03/31/solved-miro-wont-start-missing-video-directory.html">Solved: Miro won&#8217;t start &#8211; missing video directory</a></p>
]]></description>
			<content:encoded><![CDATA[<p>A couple of days ago a brand new version of <a href="http://www.getmiro.com/">Miro</a> the open video podcatcher was released. I was eager to try it out. It is supposed to be faster than the previous release. I had to wait a few days for a rpm for my linux distribution to be released. Thanks to the <a href="http://packman.links2linux.de/">great work of the PackMan crew</a> this happended pretty soon after the release. Bummer! Miro won&#8217;t start. It seems I cleaned up to good after uninstalling the previous release. Miro complained that the <strong>video directory is missing</strong>. I checked the <a href="http://www.getmiro.com/forum/">Miro Forums</a> but could not find anything related to Linux. There were some tips for Mac OS X but nothing for linux. I checked the <a href="https://svn.participatoryculture.org/svn/dtv/">source</a>, followed strace, used Google Linux but nothing turned up. I thought the fix would be as easy as finding what directory Miro is looking for. Finding the directory was not easy. I was close to giving up before I tried the unittest switch for Miro.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">miro  <span style="color: #660033;">--unittest</span></pre></div></div>

<p>What shall I say? That did the trick! The unittest failed but it created the missing directory (structure):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">~<span style="color: #000000; font-weight: bold;">/</span>Movies<span style="color: #000000; font-weight: bold;">/</span>Democracy<span style="color: #000000; font-weight: bold;">/</span>Incomplete Downloads<span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

<p>Now Miro starts. It still looks like it is not running properly but it is a start.</p>
<p>PS: I use OpenSuSE 10.3 and KDE3.</p>
<p><br /><br />
This post originated from the <a href="http://www.linux-showroom.com/feed/">Linux Showroom feed</a>. Please check out <a href="http://www.linux-showroom.com">Linux Showroom</a> for more posts.<br/><br/><a href="http://www.linux-showroom.com/2008/03/31/solved-miro-wont-start-missing-video-directory.html">Solved: Miro won&#8217;t start &#8211; missing video directory</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.linux-showroom.com/2008/03/31/solved-miro-wont-start-missing-video-directory.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to add a custom user-agent string to Konqueror</title>
		<link>http://www.linux-showroom.com/2008/03/29/how-to-add-a-custom-user-agent-string-to-konqueror.html</link>
		<comments>http://www.linux-showroom.com/2008/03/29/how-to-add-a-custom-user-agent-string-to-konqueror.html#comments</comments>
		<pubDate>Sat, 29 Mar 2008 14:46:17 +0000</pubDate>
		<dc:creator>Fabio</dc:creator>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[KDE]]></category>
		<category><![CDATA[Browser]]></category>
		<category><![CDATA[Konqueror]]></category>
		<category><![CDATA[Settings]]></category>
		<category><![CDATA[UA]]></category>
		<category><![CDATA[User-Agent]]></category>

		<guid isPermaLink="false">http://www.linux-showroom.com/2008/03/29/how-to-add-a-custom-user-agent-string-to-konqueror.html</guid>
		<description><![CDATA[You can easily set a custom user-agent string for a spe [...]<p><br /><br />
This post originated from the <a href="http://www.linux-showroom.com/feed/">Linux Showroom feed</a>. Please check out <a href="http://www.linux-showroom.com">Linux Showroom</a> for more posts.<br/><br/><a href="http://www.linux-showroom.com/2008/03/29/how-to-add-a-custom-user-agent-string-to-konqueror.html">How to add a custom user-agent string to Konqueror</a></p>
]]></description>
			<content:encoded><![CDATA[<p>You can easily set a custom <a href="http://www.user-agents.com/2008/03/29/mobile-browser-user-agent-strings.html">user-agent string</a> for a specific site through a predefined list of user-agent strings. If you want to define your own custom user-agent string I did not find a gui for that. The solution I found is the following. Launch your favorite text editor and open the file</p>
<blockquote><p>~/.kde/config/kio_httprc</p></blockquote>
<p>Just add two lines to the file. Here is an example. I wanted Konqueror to identify as an iPhone for m.podcast.de. The original iPhone has the following user-agent string:</p>
<blockquote><p>Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A543a Safari/419.3</p></blockquote>
<p>So I added  the following two lines to the file</p>
<blockquote><p>[m.podcast.de]</p>
<p>Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A543a Safari/419.3</p></blockquote>
<p>That&#8217;s all. Save the file. Relaunch Konqueror and you are done!</p>
<p><br /><br />
This post originated from the <a href="http://www.linux-showroom.com/feed/">Linux Showroom feed</a>. Please check out <a href="http://www.linux-showroom.com">Linux Showroom</a> for more posts.<br/><br/><a href="http://www.linux-showroom.com/2008/03/29/how-to-add-a-custom-user-agent-string-to-konqueror.html">How to add a custom user-agent string to Konqueror</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.linux-showroom.com/2008/03/29/how-to-add-a-custom-user-agent-string-to-konqueror.html/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>DNS does not resolve www.google.com &#8211; quick fix</title>
		<link>http://www.linux-showroom.com/2007/12/05/dns-does-not-resolve-wwwgooglecom-quick-fix.html</link>
		<comments>http://www.linux-showroom.com/2007/12/05/dns-does-not-resolve-wwwgooglecom-quick-fix.html#comments</comments>
		<pubDate>Wed, 05 Dec 2007 17:43:40 +0000</pubDate>
		<dc:creator>Fabio</dc:creator>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[dns]]></category>
		<category><![CDATA[hosts]]></category>

		<guid isPermaLink="false">http://www.linux-showroom.com/2007/12/05/dns-does-not-resolve-wwwgooglecom-quick-fix.html</guid>
		<description><![CDATA[Surfing the web today and already yesterday in some cas [...]<p><br /><br />
This post originated from the <a href="http://www.linux-showroom.com/feed/">Linux Showroom feed</a>. Please check out <a href="http://www.linux-showroom.com">Linux Showroom</a> for more posts.<br/><br/><a href="http://www.linux-showroom.com/2007/12/05/dns-does-not-resolve-wwwgooglecom-quick-fix.html">DNS does not resolve www.google.com &#8211; quick fix</a></p>
]]></description>
			<content:encoded><![CDATA[<p>Surfing the web today and already yesterday in some cases one website wouldn´t load: www.google.com. This makes it difficult to login to Google AdWords and impossible to login to AdSense. For searching I can use the localized version www.google.de. That works just fine. But I use my browser´s (Mozilla Firefox) integrated search box quiet frequently. Using Google there leads to the .com version. www.google.com is working just fine (When did they have their last downtime? Did they ever have one?) so things with the DNS (Domain Name System) could be messed up. The system does not find an ip address for the url www.google.com anymore. The solution could be to set a fixed ip address for the url. This is also good for having local urls, e.g. my.system.</p>
<p>Would you need to do is edit the file <strong>/etc/hosts</strong> with an editor of your choice. As you need root rights you probably have to do this using a shell. Try vim, joe, emac or whatever you prefer.</p>
<p>Add a line</p>
<blockquote><p><strong>209.85.135.103  www.google.com</strong></p></blockquote>
<p>to your hosts file and you are ready to load Google in your browser again.</p>
<p><!--adsense--></p>
<p><br /><br />
This post originated from the <a href="http://www.linux-showroom.com/feed/">Linux Showroom feed</a>. Please check out <a href="http://www.linux-showroom.com">Linux Showroom</a> for more posts.<br/><br/><a href="http://www.linux-showroom.com/2007/12/05/dns-does-not-resolve-wwwgooglecom-quick-fix.html">DNS does not resolve www.google.com &#8211; quick fix</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.linux-showroom.com/2007/12/05/dns-does-not-resolve-wwwgooglecom-quick-fix.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Switching from Apache HTTP Server to Lighttpd &#8211; Installing Lighttpd</title>
		<link>http://www.linux-showroom.com/2007/11/19/switching-from-apache-http-server-to-lighttpd-installing-lighttpd.html</link>
		<comments>http://www.linux-showroom.com/2007/11/19/switching-from-apache-http-server-to-lighttpd-installing-lighttpd.html#comments</comments>
		<pubDate>Sun, 18 Nov 2007 23:51:18 +0000</pubDate>
		<dc:creator>Fabio</dc:creator>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[cpu]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[lighttpd]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[webserver]]></category>

		<guid isPermaLink="false">http://www.linux-showroom.com/2007/11/19/switching-from-apache-http-server-to-lighttpd-installing-lighttpd.html</guid>
		<description><![CDATA[For our main web project we struggle to serve the pages [...]<p><br /><br />
This post originated from the <a href="http://www.linux-showroom.com/feed/">Linux Showroom feed</a>. Please check out <a href="http://www.linux-showroom.com">Linux Showroom</a> for more posts.<br/><br/><a href="http://www.linux-showroom.com/2007/11/19/switching-from-apache-http-server-to-lighttpd-installing-lighttpd.html">Switching from Apache HTTP Server to Lighttpd &#8211; Installing Lighttpd</a></p>
]]></description>
			<content:encoded><![CDATA[<p>For our main web project we struggle to serve the pages as fast as we want and as people aspect. Server load is too high most of the time. We did many different kinds of optimization. Starting with rewriting part of the code, squeezing the database, compiling the software we need instead of installing precompiled packages, using all kind of cache strategies (database, template, bytecode), buying servers with more powerful cpus (dual core instead of single core, 64bit instead of 32 bit), stocking up on ram (up to 8 GB RAM now) and now exchanging certain layers of software.</p>
<p>Setting up my first lighttpd server was easy. Configure runs through as wanted with just a few options:</p>
<blockquote><p>LDFLAGS=&#8221;-L/usr/lib64&#8243; ./configure &#8211;prefix=/usr/local/lighttpd-1.4.18 &#8211;with-pcre &#8211;with-bzip2 &#8211;with-rewrite &#8211;with-redirect &#8211;with-zlib &#8211;disable-ipv6</p></blockquote>
<p>I took the few configurations options I needed from the official docs. Everything works as aspected and is pretty straight forward. You can check the syntax with the -t switch:</p>
<blockquote>
<p align="left"> sbin/lighttpd -f lighttpd.config -t</p>
</blockquote>
<p><!--adsense--></p>
<p><br /><br />
This post originated from the <a href="http://www.linux-showroom.com/feed/">Linux Showroom feed</a>. Please check out <a href="http://www.linux-showroom.com">Linux Showroom</a> for more posts.<br/><br/><a href="http://www.linux-showroom.com/2007/11/19/switching-from-apache-http-server-to-lighttpd-installing-lighttpd.html">Switching from Apache HTTP Server to Lighttpd &#8211; Installing Lighttpd</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.linux-showroom.com/2007/11/19/switching-from-apache-http-server-to-lighttpd-installing-lighttpd.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
