<?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>Thorsten&#039;s Blog</title>
	<atom:link href="http://www.schmalenegger.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.schmalenegger.com</link>
	<description>...about Linux and other (un)interesting stuff</description>
	<lastBuildDate>Thu, 25 Aug 2011 08:34:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>0-Day Exploit &#8220;Apache-Killer&#8221;</title>
		<link>http://www.schmalenegger.com/0-day-exploit-apache-killer/</link>
		<comments>http://www.schmalenegger.com/0-day-exploit-apache-killer/#comments</comments>
		<pubDate>Thu, 25 Aug 2011 08:33:00 +0000</pubDate>
		<dc:creator>Thorsten</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.schmalenegger.com/?p=210</guid>
		<description><![CDATA[Today I read about a 0-day exploit for the apache webserver on golem.de. A quick test if the webserver on my debian VPS is also vulnerable was successful. But the proposed workaround works quite well for me. Here are the steps, that I did to prevent my own apache webserver from being exploited (default apache2 [...]]]></description>
			<content:encoded><![CDATA[<p>Today I read about a <a href="http://lists.grok.org.uk/pipermail/full-disclosure/attachments/20110820/848b4dca/attachment.obj">0-day exploit for the apache webserver</a> on <a href="http://www.golem.de/1108/85965.html">golem.de</a>.</p>
<p>A quick test if the webserver on my debian VPS is also vulnerable was successful. <img src='http://www.schmalenegger.com/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' /> </p>
<p>But the <a href="http://lists.grok.org.uk/pipermail/full-disclosure/2011-August/082377.html">proposed workaround</a> works quite well for me.<br />
Here are the steps, that I did to prevent my own apache webserver from being exploited (default apache2 installation debian squeeze):</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">#edit /etc/apache2/conf.d/security and add the following line (e.g. at the end of the file):<br />
RequestHeader unset Range<br />
#reload apache<br />
/etc/init.d/apache2 reload</div></div>
<p>Testresults:<br />
Before:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">perl apachekiller.pl 62.75.151.120 50<br />
host seems vuln<br />
ATTACKING 62.75.151.120 [using 50 forks]</div></div>
<p>After:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">perl apachekiller.pl 62.75.151.120 50<br />
Host does not seem vulnerable</div></div>
<p>GREAT! <img src='http://www.schmalenegger.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  Simply trick, but works fine.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.schmalenegger.com/0-day-exploit-apache-killer/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Ubuntu Surfstation</title>
		<link>http://www.schmalenegger.com/ubuntu-surfstation-kiosk/</link>
		<comments>http://www.schmalenegger.com/ubuntu-surfstation-kiosk/#comments</comments>
		<pubDate>Fri, 05 Aug 2011 09:48:09 +0000</pubDate>
		<dc:creator>Thorsten</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[kiosk]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[surfstation]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.schmalenegger.com/?p=194</guid>
		<description><![CDATA[For a public surfstation available for free we needed to have a system, that just simply always works. No user should be able to reset any configuration-settins, change the wallpaper, modify favorites or anything like that. The decision of the operating system was easy: Linux! The needed tasks to install this system are the following: [...]]]></description>
			<content:encoded><![CDATA[<p>For a public surfstation available for free we needed to have a system, that just simply always works. No user should be able to reset any configuration-settins, change the wallpaper, modify favorites or anything like that. The decision of the operating system was easy: Linux! <img src='http://www.schmalenegger.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>The needed tasks to install this system are the following:</p>
<p>- Download and install Ubuntu (the &#8220;Gnome Edition&#8221;) with all updates (there should be tons of howtos for this in the net)</p>
<p>- During the installation create a user that will be automatically logged in.</p>
<p>- Disable all keyboard-shortcuts in the system-settings dialogue.</p>
<p>- Install the following two addons in Firefox: <a href="https://addons.mozilla.org/de/firefox/addon/3145/">BlockSite</a> and <a href="https://mozdevgroup.com/clients/bm/">OpenKiosk</a><br />
In the OpenKiosk Adminscreen (can be started directly from Firefox) you can customize your &#8220;hardened&#8221; Firefox. I personally set fullscreen mode, increased the reset interval to 3 minutes, enabled a 30 seconds warning before the reset and removed the Print button and zoom controls.</p>
<p>- Configure Firefox to start automatically when the user logs in.</p>
<p>- Create the file /etc/X11/xorg.conf with the following content. This disables the Ctrl+Alt+F1,Ctrl+Alt+F2, etc. shortcuts for switching through the gettys.</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Section <span style="color: #ff0000;">&quot;ServerFlags&quot;</span><br />
&nbsp;Option <span style="color: #ff0000;">&quot;DontVTSwitch&quot;</span> <span style="color: #ff0000;">&quot;true&quot;</span><br />
EndSection</div></div>
<p>- Mount the root Filesystem readonly with the aufs Filesystem. This ensures that a reboot of the Surfstation/Terminal resets everything to default settings (although there shouldn&#8217;t be many changes besides the browser history) <a href="http://wiki.ubuntuusers.de/Nur-Lesen_Root-Dateisystem_mit_aufs">Here is a great Tutorial</a> for that.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.schmalenegger.com/ubuntu-surfstation-kiosk/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VMWare: Debian NICs don&#8217;t come up after removing and adding virtual network card</title>
		<link>http://www.schmalenegger.com/vmware-debian-nics-dont-come-up/</link>
		<comments>http://www.schmalenegger.com/vmware-debian-nics-dont-come-up/#comments</comments>
		<pubDate>Fri, 29 Jul 2011 06:00:07 +0000</pubDate>
		<dc:creator>Thorsten</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[vmware]]></category>

		<guid isPermaLink="false">http://www.schmalenegger.com/?p=202</guid>
		<description><![CDATA[A long time has passed after the last post to this blog. But I&#8217;m still alive and today there will be another. Yesterday I stumbled upon some problems in our virtual infrastructure regarding the Debian Linux Servers. For several reasons (most important is a dedicated network for NFS) i needed to add another virtual network [...]]]></description>
			<content:encoded><![CDATA[<p>A long time has passed after the last post to this blog. But I&#8217;m still alive and today there will be another. <img src='http://www.schmalenegger.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>Yesterday I stumbled upon some problems in our virtual infrastructure regarding the Debian Linux Servers. For several reasons (most important is a dedicated network for NFS) i needed to add another virtual network card to those servers. I also removed the existing card, because the type of that card was still &#8220;Flexible&#8221; and I wanted to change that to &#8220;E1000&#8243; anyway.</p>
<p>So in short: 1 card (Flexible) was removed, 2 cards (E1000) were added. Sounds easy, but it wasn&#8217;t! <img src='http://www.schmalenegger.com/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' /> </p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">SIOCSIFADDR: No such device<br />
eth0: ERROR <span style="color: #000000; font-weight: bold;">while</span> getting interface flags: No such device<br />
SIOCSIFADDR: No such device<br />
SIOCSIFADDR: No such device<br />
eth0: ERROR <span style="color: #000000; font-weight: bold;">while</span> getting interface flags: No such device<br />
eth0: ERROR <span style="color: #000000; font-weight: bold;">while</span> getting interface flags: No such device</div></div>
<p>The interfaces don&#8217;t come up and i had no idea why!</p>
<p>After some investigation this issue seemed to be related to udev. The MAC address of the old NIC was still in the file <em>/etc/udev/rules.d/z25_persistent-net.rules</em>, but of course the MAC has changed after migrating to the new E1000 card.</p>
<p>The solution is to edit the above mentioned file and replace the wrong MAC address value(s) with the new ones.</p>
<p>After that the appropriate servies need to be restarted:</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>udev restart<br />
<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>networking restart</div></div>
<p>or in short:</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">reboot</div></div>
<p>That&#8217;s it! <img src='http://www.schmalenegger.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.schmalenegger.com/vmware-debian-nics-dont-come-up/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Klar, ich hab ja auch sonst nichts zu tun&#8230;</title>
		<link>http://www.schmalenegger.com/klar-ich-hab-ja-auch-sonst-nichts-zu-tun/</link>
		<comments>http://www.schmalenegger.com/klar-ich-hab-ja-auch-sonst-nichts-zu-tun/#comments</comments>
		<pubDate>Tue, 02 Nov 2010 12:09:59 +0000</pubDate>
		<dc:creator>Thorsten</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[vmware]]></category>

		<guid isPermaLink="false">http://www.schmalenegger.com/?p=188</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.schmalenegger.com/wp-content/uploads/2010/11/update-manager.png" rel="lightbox[188]"><img src="http://www.schmalenegger.com/wp-content/uploads/2010/11/update-manager-300x226.png" alt="" title="VMware Update-manager" width="300" height="226" class="aligncenter size-medium wp-image-189" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.schmalenegger.com/klar-ich-hab-ja-auch-sonst-nichts-zu-tun/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to create Colorkey images with GIMP</title>
		<link>http://www.schmalenegger.com/how-to-create-colorkey-images-with-gimp/</link>
		<comments>http://www.schmalenegger.com/how-to-create-colorkey-images-with-gimp/#comments</comments>
		<pubDate>Tue, 27 Apr 2010 10:17:50 +0000</pubDate>
		<dc:creator>Thorsten</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[colorkey]]></category>
		<category><![CDATA[gimp]]></category>

		<guid isPermaLink="false">http://www.schmalenegger.com/?p=180</guid>
		<description><![CDATA[Note to myself: 1. File => Open 2. Image => Mode => Grayscale 3. Edit => Copy 4. Edit => Undo 5. Layer => New => Transparency => ok 6. Edit => Paste 7. Layer => Anchor Layer 8. Layer => Mask => Add Layer Mask => White (full opacitiy) => Add 9. Now use [...]]]></description>
			<content:encoded><![CDATA[<p>Note to myself:</p>
<p>1. File => Open<br />
2. Image => Mode => Grayscale<br />
3. Edit => Copy<br />
4. Edit => Undo<br />
5. Layer => New => Transparency => ok<br />
6. Edit => Paste<br />
7. Layer => Anchor Layer<br />
8. Layer => Mask => Add Layer Mask => White (full opacitiy) => Add<br />
9. Now use the Paintbrush-Tool to (re)color the parts of the image you like</p>
<p>Here&#8217;s a sample image:<br />
<div id="attachment_185" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.schmalenegger.com/wp-content/uploads/2010/04/colorkey-small.jpg" rel="lightbox[180]"><img src="http://www.schmalenegger.com/wp-content/uploads/2010/04/colorkey-small-300x225.jpg" alt="Colorkey image made with GIMP" title="colorkey-small" width="300" height="225" class="size-medium wp-image-185" /></a><p class="wp-caption-text">Colorkey image made with GIMP</p></div></p>
]]></content:encoded>
			<wfw:commentRss>http://www.schmalenegger.com/how-to-create-colorkey-images-with-gimp/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Chive as an alternative to phpMyAdmin</title>
		<link>http://www.schmalenegger.com/chive-as-an-alternative-to-phpmyadmin/</link>
		<comments>http://www.schmalenegger.com/chive-as-an-alternative-to-phpmyadmin/#comments</comments>
		<pubDate>Mon, 22 Mar 2010 21:20:18 +0000</pubDate>
		<dc:creator>Thorsten</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[chive]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[phpmyadmin]]></category>

		<guid isPermaLink="false">http://www.schmalenegger.com/?p=178</guid>
		<description><![CDATA[Most of the mysql-admins out there will know phpmyadmin as a very helpful and reliable database administration tool. It&#8217;s available in most linux distros, can easily be installed and is for sure a very nice tool. Today I stumbled upon an alternative mysql administration-tool driven by php called chive. From the project-website you can quickly [...]]]></description>
			<content:encoded><![CDATA[<p>Most of the mysql-admins out there will know phpmyadmin as a very helpful and reliable database administration tool. It&#8217;s available in most linux distros, can easily be installed and is for sure a very nice tool. Today I stumbled upon an alternative mysql administration-tool driven by php called chive.</p>
<p>From the <a href="http://www.chive-project.com/">project-website </a> you can quickly see, that it already has a vast feature list and doesn&#8217;t need to hide after phpmyadmin.<br />
My first impression is absolutely great and i think this tool can drain off phpmyadmin one day, but that&#8217;s of course a very subjective opinion.</p>
<p>More screenshots can be found here: <a href="http://www.chive-project.com/Screenshots">http://www.chive-project.com/Screenshots</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.schmalenegger.com/chive-as-an-alternative-to-phpmyadmin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Switching to nginx and php-fpm, so LAMP becomes LEMP</title>
		<link>http://www.schmalenegger.com/switching_to_nginx_and_php-fpm/</link>
		<comments>http://www.schmalenegger.com/switching_to_nginx_and_php-fpm/#comments</comments>
		<pubDate>Wed, 20 Jan 2010 07:18:09 +0000</pubDate>
		<dc:creator>Thorsten</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[lamp]]></category>
		<category><![CDATA[lemp]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[php-fpm]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.schmalenegger.com/?p=166</guid>
		<description><![CDATA[About two and a half years ago i ordered a virtual server for private purposes at Server4you. That was quite a long time ago and in the meantime you can get the same server for less money or a better server for the same price As migrating from an old productline to a new one [...]]]></description>
			<content:encoded><![CDATA[<p>About two and a half years ago i ordered a virtual server for private purposes at Server4you. That was quite a long time ago and in the meantime you can get the same server for less money or a better server for the same price <img src='http://www.schmalenegger.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /><br />
As migrating from an old productline to a new one isn&#8217;t possible at Server4you I decided to order a new server and migrate all my services to it so that i can quit the old machine afterwards.</p>
<p>And here we go:<br />
LAMP (Linux, Apache, MySQL and PHP) is quite common and i also used this setup (Apache with mod_php) for hosting some small websites on my old server. The planned migration made me think about alternatives and I crawled through many blogposts about <a href="http://nginx.org/">NGINX</a> &#8211; a webserver which gains more and more popularity in our days (see <a href="http://news.netcraft.com/archives/2010/01/07/january_2010_web_server_survey.html">this survey</a> for more details).<br />
Therefor i decided to give it a try and that&#8217;s where LEMP comes from (NGINX is pronounced as Engine-X)</p>
<p>Another new thing i wanted to try out is the integration of PHP in a different way. A project called <a href="http://php-fpm.org/">PHP-FPM (FastCGI Process Manager)</a> adds some new features to the &#8216;normal&#8217; FastCGI implementation. It&#8217;s more or less a patch for the PHP sourcecode and it seems like it will go directly to the PHP core with PHP version 5.3.3.</p>
<p>After a bit of compilation and writing some scripts to automate this for future use all the websites (mostly WordPress) run on my LEMP setup. To get SEO-friendly URLs with WordPress on nginx is a bit more tricky than before, because .htaccess files are not beeing parsed by nginx, but the effort is really worth it.</p>
<p>Here is a related snippet from my nginx configuration file for this blog (slightly modified):</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">server <span style="color: #7a0874; font-weight: bold;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; listen &nbsp; <span style="color: #000000;">80</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; server_name www.schmalenegger.com;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; access_log <span style="color: #000000; font-weight: bold;">/</span>logs<span style="color: #000000; font-weight: bold;">/</span>schmalenegger.com_access.log;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; error_log <span style="color: #000000; font-weight: bold;">/</span>logs<span style="color: #000000; font-weight: bold;">/</span>schmalenegger.com_error.log;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; location <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; root &nbsp; <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>schmalenegger.com<span style="color: #000000; font-weight: bold;">/</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; index &nbsp;index.php index.html;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;"># Basic version of Wordpress parameters, supporting nice permalinks.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; include <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>nginx<span style="color: #000000; font-weight: bold;">/</span>wordpress_params.regular;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;"># pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">#</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; location ~ \.php$ <span style="color: #7a0874; font-weight: bold;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fastcgi_pass 127.0.0.1:<span style="color: #000000;">9999</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fastcgi_index index.php;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; include <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>nginx<span style="color: #000000; font-weight: bold;">/</span>fastcgi_params;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; include <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>nginx<span style="color: #000000; font-weight: bold;">/</span>fastcgi_params.default;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fastcgi_param SCRIPT_FILENAME <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>schmalenegger.com<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$fastcgi_script_name</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">&#125;</span></div></div>
<p>And this is the content from /etc/nginx/wordpress_params.regular:</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;"># WordPress pretty URLs:</span><br />
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>-f <span style="color: #007800;">$request_filename</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span><br />
<span style="color: #7a0874; font-weight: bold;">break</span>;<br />
<span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>-d <span style="color: #007800;">$request_filename</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span><br />
<span style="color: #7a0874; font-weight: bold;">break</span>;<br />
<span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
rewrite ^<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;">/</span>index.php?<span style="color: #007800;">q</span>=<span style="color: #007800;">$1</span> <span style="color: #c20cb9; font-weight: bold;">last</span>;</div></div>
<p>To be honest, I didn&#8217;t measure the differences between the performances of both setups, but I can really feel, that the webpages are being loaded much faster than before and also the memory consumption of nginx is absolutly awesome. So I&#8217;m quite happy with this new setup, but sometimes there are still some pitfalls to deal with.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.schmalenegger.com/switching_to_nginx_and_php-fpm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Recovering a lost root password for MySQL</title>
		<link>http://www.schmalenegger.com/recovering-a-lost-root-password-for-mysql/</link>
		<comments>http://www.schmalenegger.com/recovering-a-lost-root-password-for-mysql/#comments</comments>
		<pubDate>Mon, 28 Dec 2009 09:56:28 +0000</pubDate>
		<dc:creator>Thorsten</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[password]]></category>

		<guid isPermaLink="false">http://www.schmalenegger.com/?p=163</guid>
		<description><![CDATA[Once in a while (hopefully not to often) you need to recover the root password of a mysql database. Here is a quick guide how I do this normally: 1. Stop the running database (if it isn&#8217;t stopped already) /etc/init.d/mysql stop 2. Start the database with the &#8216;skip-grant-tables&#8217; option mysqld_safe –skip-grant-tables &#38; 3. Open the [...]]]></description>
			<content:encoded><![CDATA[<p>Once in a while (hopefully not to often) you need to recover the root password of a mysql database. Here is a quick guide how I do this normally:</p>
<p>1. Stop the running database (if it isn&#8217;t stopped already)</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>mysql stop</div></div>
<p>2. Start the database with the &#8216;skip-grant-tables&#8217; option</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">mysqld_safe –skip-grant-tables <span style="color: #000000; font-weight: bold;">&amp;</span></div></div>
<p>3. Open the mysql console</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">mysql <span style="color: #660033;">-u</span> root</div></div>
<p>4. Set a new password for root (replace yournewpassword with a password of your choice)</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">mysql<span style="color: #000000; font-weight: bold;">&gt;</span> UPDATE user SET <span style="color: #007800;">Password</span>=PASSWORD<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #ff0000;">'yournewpassword'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> WHERE user = <span style="color: #ff0000;">'root'</span>;</div></div>
<p>5. Make the changes work immediately</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">mysql<span style="color: #000000; font-weight: bold;">&gt;</span> FLUSH PRIVILEGES;</div></div>
<p>6. Stop the database again</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">kill</span> <span style="color: #000000; font-weight: bold;">`/</span>path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>mysql.pid<span style="color: #000000; font-weight: bold;">`</span> <span style="color: #000000; font-weight: bold;">||</span> <span style="color: #c20cb9; font-weight: bold;">killall</span> mysqld</div></div>
<p>7. Start it up again the usual way</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>mysql start</div></div>
<p>That&#8217;s it <img src='http://www.schmalenegger.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.schmalenegger.com/recovering-a-lost-root-password-for-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Connecting to MSSQL databases with PHP from Linux</title>
		<link>http://www.schmalenegger.com/connecting-to-mssql-databases-with-php-from-linux/</link>
		<comments>http://www.schmalenegger.com/connecting-to-mssql-databases-with-php-from-linux/#comments</comments>
		<pubDate>Thu, 22 Oct 2009 07:06:36 +0000</pubDate>
		<dc:creator>Thorsten</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[freetds]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mssql]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.schmalenegger.com/?p=161</guid>
		<description><![CDATA[I needed to get some data from existing MSSQL databases with PHP. Connecting to such servers is a bit more tricky than mysql, because the mssql extension from php needs also a correctly configured TDS installation. But we&#8217;re lucky, there is an opensource implementation of the tds protocoll called FreeTDS. If you don&#8217;t want to [...]]]></description>
			<content:encoded><![CDATA[<p>I needed to get some data from existing MSSQL databases with PHP. Connecting to such servers is a bit more tricky than mysql, because the mssql extension from php needs also a correctly configured TDS installation. But we&#8217;re lucky, there is an opensource implementation of the tds protocoll called FreeTDS. If you don&#8217;t want to use tds you can also try to get it to work with ODBC, but ODBC is very slow and that&#8217;s why it&#8217;s also not part of this blog post.</p>
<p>So here we go&#8230;</p>
<p>1. Installation of FreeTDS:<br />
- Get the latest release of FreeTDS from here: <a href="http://freetds.org/">http://freetds.org/</a> (the time i write this it&#8217;s 0.82)<br />
- Extract and compile it:</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">tar</span> xzvf freetds-stable.tgz <br />
<span style="color: #7a0874; font-weight: bold;">cd</span> freetds-<span style="color: #000000;">0.82</span><span style="color: #000000; font-weight: bold;">/</span><br />
.<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>freetds <span style="color: #660033;">--with-tdsver</span>=<span style="color: #000000;">8.0</span><br />
<span style="color: #c20cb9; font-weight: bold;">make</span><br />
<span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></div></div>
<p>- Edit /opt/freetds/etc/freetds.conf and add your MSSQL server like this:</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #7a0874; font-weight: bold;">&#91;</span>MSSQLserver<span style="color: #7a0874; font-weight: bold;">&#93;</span><br />
host = <span style="color: #c20cb9; font-weight: bold;">hostname</span> or <span style="color: #c20cb9; font-weight: bold;">ip</span><br />
port = <span style="color: #000000;">1433</span><br />
tds version = <span style="color: #000000;">8.0</span></div></div>
<p>MSSQLserver is used in your php code afterwards, so it might be a good idea to think of an appropriate name.</p>
<p>2. Installation of PHP<br />
- Get the latest release of PHP from here: <a href="http://www.php.net/downloads.php">http://www.php.net/downloads.php</a><br />
- Extract and compile it:</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">tar</span> xjvf php-5.3.0.tar.bz2<br />
<span style="color: #7a0874; font-weight: bold;">cd</span> php-5.3.0<span style="color: #000000; font-weight: bold;">/</span><br />
.<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>php <span style="color: #660033;">--with-apxs2</span> <span style="color: #660033;">--with-mssql</span>=<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>freetds<br />
<span style="color: #c20cb9; font-weight: bold;">make</span><br />
<span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></div></div>
<p>This is a very limited version of PHP just to show the required options in order to get PHP to work with MSSQL. If you have additional requirements like mysql-support or gd processing stuff you need to add those options to the configure call.</p>
<p>After that you need to tell Apache to load the appropriate module (libphp5.so). Add the following line to your httpd.conf file:</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">LoadModule php5_module &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>httpd<span style="color: #000000; font-weight: bold;">/</span>modules<span style="color: #000000; font-weight: bold;">/</span>libphp5.so</div></div>
<p>The location of the module may vary.</p>
<p>If everything went fine, you can now start to &#8216;CRUD&#8217; your MSSQL data. Have fun&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.schmalenegger.com/connecting-to-mssql-databases-with-php-from-linux/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>NIC bonding (aka NIC teaming) with Debian Lenny</title>
		<link>http://www.schmalenegger.com/nic-bonding-aka-nic-teaming-with-debian-lenny/</link>
		<comments>http://www.schmalenegger.com/nic-bonding-aka-nic-teaming-with-debian-lenny/#comments</comments>
		<pubDate>Mon, 05 Oct 2009 13:28:12 +0000</pubDate>
		<dc:creator>Thorsten</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[howto]]></category>

		<guid isPermaLink="false">http://www.schmalenegger.com/?p=157</guid>
		<description><![CDATA[In order to move our Nagios installation from a virtual server to a dedicated hardware machine i installed Debian Lenny on a HP Proliant DL 380 G5. This server has two integrated NICs which can easily be used together as a network bond. So if one way to or from the server failes, the machine [...]]]></description>
			<content:encoded><![CDATA[<p>In order to move our Nagios installation from a virtual server to a dedicated hardware machine i installed Debian Lenny on a HP Proliant DL 380 G5. This server has two integrated NICs which can easily be used together as a network bond. So if one way to or from the server failes, the machine is still available through the other card.</p>
<p>All the necessary requirements such as the bonding module and stuff are available in the debain standard kernel (the time i wrote this: 2.6.26-2-amd64)</p>
<p>What&#8217;s still left to do is to install the ifenslave package:</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp;<span style="color: #c20cb9; font-weight: bold;">apt-get install</span> ifenslave-<span style="color: #000000;">2.6</span></div></div>
<p>and to modify some configuration files<br />
/etc/modprobe.d/arch/i386 or /etc/modprobe.d/arch/i386 (depending on your architecture):</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #7a0874; font-weight: bold;">alias</span> bond0 bonding<br />
options bonding <span style="color: #007800;">mode</span>=<span style="color: #000000;">1</span> <span style="color: #007800;">miimon</span>=<span style="color: #000000;">100</span> <span style="color: #007800;">downdelay</span>=<span style="color: #000000;">200</span> <span style="color: #007800;">updelay</span>=<span style="color: #000000;">200</span></div></div>
<p>Mode 1 (also called: active-backup) means, that only one interface is active. The other one comes only into play, when the first (active) card fails. So this mode is only for fault tolerance and not for loadbalancing, but the configuration of this mode is very simple, because it doesn&#8217;t require additional switch configuration.</p>
<p>Edit /etc/network/interfaces and configure the bond0 interface:</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">auto bond0<br />
iface bond0 inet static<br />
&nbsp; &nbsp;address 10.10.0.25<br />
&nbsp; &nbsp;netmask 255.255.255.0<br />
&nbsp; &nbsp;gateway 10.10.0.1<br />
&nbsp; &nbsp;up <span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>ifenslave bond0 eth0 eth1<br />
&nbsp; &nbsp;down <span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>ifenslave <span style="color: #660033;">-d</span> bond0 eth0 eth1</div></div>
<p>Don&#8217;t configure any additional network settings for eth0 and eth1!</p>
<p>For testing purposes you can now load the bonding module (will also be done automatically when the servers boots):</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">modprobe bonding</div></div>
<p>and restart your network:</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>networking restart</div></div>
<p>Now you should be able to ping the server from another host and plug/unplug the cables of the two integrated NICs while the server always answers the ping requests.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.schmalenegger.com/nic-bonding-aka-nic-teaming-with-debian-lenny/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

