<?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/"
	
	xmlns:georss="http://www.georss.org/georss"
	xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
	>

<channel>
	<title>Debian — Jürgen Kreileder</title>
	<atom:link href="/articles/category/linux/debian/feed/" rel="self" type="application/rss+xml" />
	<link>/</link>
	<description>Software Engineer and Consultant</description>
	<lastBuildDate>Sat, 29 Oct 2016 01:51:03 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
<site xmlns="com-wordpress:feed-additions:1">5303222</site><image><title>Jürgen Kreileder</title><url>/jk-rss.jpg</url><link>/</link><width>144</width><height>114</height><description>Software Engineer and Consultant</description></image>	<item>
		<title>Chrooting Recent MySQL Versions on Debian and Ubuntu</title>
		<link>/articles/chrooting-recent-mysql-versions-on-debian-and-ubuntu/</link>
					<comments>/articles/chrooting-recent-mysql-versions-on-debian-and-ubuntu/#comments</comments>
		
		<dc:creator><![CDATA[Jürgen Kreileder]]></dc:creator>
		<pubDate>Sat, 30 Dec 2006 15:58:22 +0000</pubDate>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<guid isPermaLink="false">http://blog.blackdown.de/2006/12/30/47/</guid>

					<description><![CDATA[I&#8217;ve posted a recipe for chrooting MySQL on Debian sarge a while ago. These instructions no longer work out of the box for newer MySQL packages from Debian and Ubuntu. The main problem is that the startup script added a few extra checks and script invocations that don&#8217;t understand the chroot environment. So here&#8217;s an<br />[&#8594; <a href="/articles/chrooting-recent-mysql-versions-on-debian-and-ubuntu/" class="more-link">Read the rest of this entry</a>]]]></description>
										<content:encoded><![CDATA[<p>I&#8217;ve posted a <a href="/2005/03/04/chrooting-mysql-on-debian/">recipe</a> for chrooting MySQL on Debian sarge a while ago. These instructions no longer work out of the box for newer MySQL packages from Debian and Ubuntu. The main problem is that the startup script added a few extra checks and script invocations that don&#8217;t understand the chroot environment. So here&#8217;s an updated plan:</p>
<ul>
<li>Prepare the chroot directory. It&#8217;s recommended to use an extra partition/filesystem for it. I will use <code>/srv/mysql</code> (which is an <a href ="http://sourceware.org/lvm2/">LVM2</a> partition with an ext3 filesystem on my system) for the rest of the text.</li>
<li>Stop MySQL:
<pre>/etc/init.d/mysql stop</pre>
</li>
<li>Copy the databases to new location:
<pre>mkdir -p /srv/mysql/var/lib
cp -a /var/lib/mysql /srv/mysql/var/lib</pre>
</li>
<li>Copy <a href="/static/mysql-chroot">this script</a> to <code>/etc/default/mysql-chroot</code></li>
<li>Edit <code>/etc/init.d/mysql</code>:
<ul>
<li>Source the <code><a href="/static/mysql-chroot">mysql-chroot</a></code> script somewhere at the top:
<pre>&hellip;
test -x /usr/sbin/mysqld || exit 0

<strong>. /etc/default/mysql-chroot</strong>

SELF=$(cd $(dirname $0); pwd -P)/$(basename $0)
&hellip;</pre>
</li>
<li>Fix the disk space check:
<pre style="overflow:scroll;width:93%;">
&hellip;
# check for diskspace shortage
datadir=`mysqld_get_param datadir`
if LC_ALL=C BLOCKSIZE= df --portability <strong>$CHROOT_DIR</strong>$datadir/. | tail -n 1 | awk &apos;{ exit ($4&gt;4096) }&apos;; then
  log_failure_msg &quot;$0: ERROR: The partition with $datadir is too full!&quot;
&hellip;</pre>
</li>
<li>Run <code>setup_chroot</code> right in the start section:
<pre>&hellip;
if mysqld_status check_alive nowarn; then
  echo &quot;...already running.&quot;
else
<strong>  setup_chroot</strong>
  /usr/bin/mysqld_safe &gt; /dev/null 2&gt;&amp;1 &amp;
&hellip;</pre>
</li>
<li>Somehow <code>/var/run/mysqld/mysqld.pid</code> disappears after each start.  We have to create it each time, otherwise the <code>stop</code> command won&#8217;t work properly:
<pre>&hellip;
if mysqld_status check_alive warn; then
  log_end_msg 0
<strong>  ln -sf $CHROOT_DIR/var/run/mysqld/mysqld.pid \
                 /var/run/mysqld</strong>
  # Now start mysqlcheck or whatever the admin wants.
  output=$(/etc/mysql/debian-start)
&hellip;</pre>
</li>
</ul>
</li>
<li>In <code>/etc/mysql/debian.cnf</code>, change the two <code>socket</code> lines to:
<pre>socket = /srv/mysql/var/run/mysqld/mysqld.sock</pre>
</li>
<li>In <code>/etc/mysql/my.cnf</code>:
<ul>
<li>Change the <code>socket</code> line in the <code>[client]</code> section to:
<pre>socket = /srv/mysql/var/run/mysqld/mysqld.sock</pre>
<p>Don&#8217;t change the <code>socket</code> lines in the other sections!</p>
</li>
<li>Add
<pre>chroot = /srv/mysql</pre>
<p> to the <code>[mysqld]</code> section.</p>
</li>
</ul>
</li>
<li>Prepend <code>/srv/mysql</code> to the log files listed in <code>/etc/logrotate.d/mysql-server</code></li>
<li>Make <code>/usr/bin/mysql_upgrade_shell</code> use the chrooted socket. <strong>Note: Currently these changes must be made each time mysql gets upgraded because upgrades override this file!</strong>
<pre style="overflow:scroll;width:93%;">&hellip;
&#45;&#45;password=*) password=`echo &quot;$arg&quot; | sed -e &apos;s/^[^=]*=//&apos;` ;;
<strong>&#45;&#45;socket=*) socket=`echo &quot;$arg&quot; | sed -e &apos;s/^[^=]*=//&apos;` ;;</strong>
&#45;&#45;ldata=*|&#45;&#45;data=*|&#45;&#45;datadir=*) DATADIR=`echo &quot;$arg&quot; | sed -e &apos;s/^[^=]*=//&apos;` ;;
&hellip;
fi
$bindir/mysql_fix_privilege_tables &#45;&#45;silent &#45;&#45;user=$user &#45;&#45;password=$password <strong>&#45;&#45;socket=$socket</strong> $args
exit 0
&hellip;
check_args=&quot;&#45;&#45;check-upgrade &#45;&#45;all-databases &#45;&#45;auto-repair &#45;&#45;user=$user &#45;&#45;password=$password <strong>&#45;&#45;socket=$socket</strong>&quot;
&hellip;
$bindir/mysql_fix_privilege_tables &#45;&#45;silent &#45;&#45;user=$user &#45;&#45;password=$password <strong>&#45;&#45;socket=$socket</strong> $args
&hellip;</pre>
</li>
<li>Start MySQL:
<pre>/etc/init.d/mysql start</pre>
</li>
<li>Check <code>/var/log/syslog</code> for errors ;-)</li>
</ul>
]]></content:encoded>
					
					<wfw:commentRss>/articles/chrooting-recent-mysql-versions-on-debian-and-ubuntu/feed/</wfw:commentRss>
			<slash:comments>23</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">47</post-id>	</item>
		<item>
		<title>Sun Java Packages for Debian and Ubuntu</title>
		<link>/articles/sun-java-packages-for-debian-and-ubuntu/</link>
					<comments>/articles/sun-java-packages-for-debian-and-ubuntu/#comments</comments>
		
		<dc:creator><![CDATA[Jürgen Kreileder]]></dc:creator>
		<pubDate>Wed, 17 May 2006 19:42:31 +0000</pubDate>
				<category><![CDATA[Blackdown]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[sun]]></category>
		<guid isPermaLink="false">http://blog.blackdown.de/2006/05/17/sun-java-packages-for-debian-and-ubuntu/</guid>

					<description><![CDATA[Sun now allows redistribution of Java by Linux and Open-Solaris distributions. As a result of this move, there are now packages of Sun&#8217;s Java for Debian and Ubuntu. The packaging code is largely based on the code we are using for Blackdown Java for some years. The code is available under the MIT license from<br />[&#8594; <a href="/articles/sun-java-packages-for-debian-and-ubuntu/" class="more-link">Read the rest of this entry</a>]]]></description>
										<content:encoded><![CDATA[<p>Sun now <a href="http://www.sun.com/smi/Press/sunflash/2006-05/sunflash.20060516.4.xml">allows</a>  redistribution of Java by Linux and Open-Solaris distributions.</p>
<p>As a result of this move, there are now <a href="https://jdk-distros.dev.java.net/#use_it">packages</a> of Sun&#8217;s Java for Debian and Ubuntu.<br />
The packaging code is largely based on the code we are using for Blackdown Java for some years. The code is <a href="https://jdk-distros.dev.java.net/source/browse/jdk-distros/">available</a> under the <a href="http://www.opensource.org/licenses/mit-license.php">MIT license</a> from the <a href="https://jdk-distros.dev.java.net/">jdk-distros</a> project on <a href="http://java.net/">java.net</a>. (More info on Tom Marble&#8217;s <a href="http://blogs.sun.com/roller/page/tmarble#java_hot_and_spicy_for">blog</a>.)</p>
<p>I&#8217;m glad Sun finally <a href="http://weblogs.java.net/blog/calvinaustin/archive/2006/05/javaone_news_hi.html">opens</a> Java up a bit after years of <a href="http://weblogs.java.net/blog/calvinaustin/archive/2006/05/javaone_news_ja.html">restrictive</a> licensing.</p>
]]></content:encoded>
					
					<wfw:commentRss>/articles/sun-java-packages-for-debian-and-ubuntu/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">46</post-id>	</item>
		<item>
		<title>LVM Snapshots With Debian Sarge and Linux 2.6.16</title>
		<link>/articles/lvm-snapshots-with-debian-sarge-and-linux-2616/</link>
					<comments>/articles/lvm-snapshots-with-debian-sarge-and-linux-2616/#comments</comments>
		
		<dc:creator><![CDATA[Jürgen Kreileder]]></dc:creator>
		<pubDate>Sun, 09 Apr 2006 17:53:58 +0000</pubDate>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Linux Kernel]]></category>
		<guid isPermaLink="false">http://blog.blackdown.de/2006/04/09/lvm-snapshots-with-debian-sarge-and-linux-2616/</guid>

					<description><![CDATA[I have upgraded this server to kernel 2.6.16.2. The next backup cycle resulted in a minor disaster: The backup process deadlocked at removing the first LVM2 snapshot and the snapshot source volumes were blocking write accesses. A cleanup shutdown was impossible and I had to hard-reset the machine. After some searching I found out that<br />[&#8594; <a href="/articles/lvm-snapshots-with-debian-sarge-and-linux-2616/" class="more-link">Read the rest of this entry</a>]]]></description>
										<content:encoded><![CDATA[<p>I have upgraded this server to kernel 2.6.16.2. The next backup cycle resulted in a minor disaster: The backup process deadlocked at removing the first <a href="http://sources.redhat.com/lvm2/">LVM2</a> snapshot and the snapshot source volumes were blocking write accesses. A cleanup shutdown was impossible and I had to hard-reset the machine.</p>
<p>After some searching I found out that you <a href="http://www.ussg.iu.edu/hypermail/linux/kernel/0601.2/2055.html">apparently</a> need lvm2 2.02.01 or later and devmapper 1.02.02 or later to successfully remove snapshot volumes now. Unfortunately neither of these versions is available for sarge from Debian or <a href="http://backports.org/">backports.org</a> yet, so I had to make my own backports.<br />
As it turned out (see below), it is also necessary to use 2.6.16.12 or to apply the patch from this <a href="http://lkml.org/lkml/2006/4/20/261">email</a> to older 2.6.16 versions in order to reliably remove snapshots.</p>
<p>If you are brave enough, you can get the backported packages by adding</p>
<pre>deb http://blog.blackdown.de/static/debian/lvm/ sarge main
deb-src http://blog.blackdown.de/static/debian/lvm/ sarge main</pre>
<p>to <code>/etc/apt/sources.list</code>.</p>
<p>The repository contains debs for devmapper, dlm, lvm2, and lvm-common. The <code>Release</code> files is signed with my GPG <a href="/static/gpg.asc">key</a>. If you have a recent <code>apt</code> version, you can authenticate the packages after importing the key with <code>apt-key</code>:</p>
<pre>wget http://blog.blackdown.de/static/gpg.asc -O - | &#92;
    sudo apt-key add -</pre>
<p><em><strong>April 15th, 2006:</strong> In about 40 backup cycles I&#8217;ve <a href="http://www.ussg.iu.edu/hypermail/linux/kernel/0604.1/1643.html">seen</a> three lockups with 2.6.16.2 now. Until snapshots get fixed in 2.6.16, I&#8217;d recommend to stay with 2.6.15. I&#8217;m using 2.6.15.3 again now.</em></p>
<p><em><strong>April 24th, 2006:</strong> Added note about &#8220;<a href="http://lkml.org/lkml/2006/4/20/261">dm snapshot: fix kcopyd destructor</a>&#8221; patch from Alasdair G Kergon. With this patch snapshots work fine for me again.</em></p>
<p><em><strong>May 2nd, 2006:</strong> Alasdair G Kergon&#8217;s patch has been included in 2.6.16.12.</em></p>
]]></content:encoded>
					
					<wfw:commentRss>/articles/lvm-snapshots-with-debian-sarge-and-linux-2616/feed/</wfw:commentRss>
			<slash:comments>13</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">45</post-id>	</item>
		<item>
		<title>Securing WordPress 2 Admin Access With SSL</title>
		<link>/articles/securing-wordpress-2-admin-access-with-ssl/</link>
					<comments>/articles/securing-wordpress-2-admin-access-with-ssl/#comments</comments>
		
		<dc:creator><![CDATA[Jürgen Kreileder]]></dc:creator>
		<pubDate>Sun, 22 Jan 2006 20:34:42 +0000</pubDate>
				<category><![CDATA[Config]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[WordPress]]></category>
		<guid isPermaLink="false">http://blog.blackdown.de/2006/01/22/securing-wordpress-2-admin-access-with-ssl/</guid>

					<description><![CDATA[A few people have asked for an updated version of my Securing WordPress Admin Access With SSL guide. So here is an updated version for WordPress 2! The situation has not changed much since WordPress 1.5: WordPress 2.0 still does not support HTTPS access to the admin area when the rest of the blog is<br />[&#8594; <a href="/articles/securing-wordpress-2-admin-access-with-ssl/" class="more-link">Read the rest of this entry</a>]]]></description>
										<content:encoded><![CDATA[<p>A few people have asked for an updated version of my <a href="/2005/05/18/securing-wordpress-admin-access-with-ssl/">Securing WordPress Admin Access With SSL</a> guide. So here is an updated version for <a href="http://wordpress.org/" rel="tag">WordPress</a> 2!</p>
<p>The situation has not changed much since WordPress 1.5: WordPress 2.0 still does not support HTTPS access to the admin area when the rest of the blog is served via normal HTTP and I still do not like logging in to my server over unencrypted connections, especially not when using public WLANs. Getting around this WordPress limitation requires quite a few steps:</p>
<h3>The Goal</h3>
<p>All communication involving passwords or authentication cookies should be done over HTTPS connections. <code>wp-login.php</code> and the <code>wp-admin</code> directory should only be accessible over HTTPS.<br />
Normal reading access, as well as comments, tracebacks, and pingbacks still should go over ordinary HTTP.</p>
<h3>The Plan</h3>
<ul>
<li>Add an HTTPS virtual host that forwards requests to the HTTP virtual host</li>
<li>Modify WordPress to send <em>secure</em> authentication cookies, so cookies never get sent over insecure connections accidentally</li>
<li>Require a valid certificate on HTTPS clients. That means to log in to WordPress you need both a valid certificate and a valid password.  If someone manages to get your password, he still can not login because he does not have a valid certificate.</li>
</ul>
<h3>The Implementation</h3>
<p>Note: This documentation assumes a <a href="http://www.debian.org/">Debian</a> sarge installation with <a href="http://httpd.apache.org/" rel="tag">Apache</a> 2. Some things, in particular Apache module related ones, will be different on other systems.<br />
The server used throughout the instructions is example.org/192.0.34.166. The server&#8217;s <code>DocumentRoot</code> is /blog and WordPress resides in /blog/wp. The value of WordPress&#8217; <code>home</code> option is &#8216;http://example.org&/#8217; and the value of its <code>site_url</code> option is &#8216;http://example.org/wp&#8217;.</p>
<ul>
<li>Prepare the SSL certificates:
<ul>
<li>Generate your own certificate authority (CA) if you don&#8217;t have one already (I&#8217;m using the makefile from <a href="http://sial.org/howto/openssl/ca/">OpenSSL Certificate Authority Setup</a> for managing mine) and import it into your browser.</li>
<li>Generate a certificate for the SSL server and certify it with your private CA.</li>
<li>Generate a certificate for your browser and certify it with your private CA. Most browsers expect a <abbr title="Public-Key Cryptography Standard">PKCS</abbr>#12 file, so generate one with
<pre>$ openssl pkcs12 -export -clcerts &#92;
    -in blogclient.cert &#92;
    -inkey blogclient.key &#92;
    -out blogclient.p12</pre>
<p>Then import <code>blogclient.p12</code> into your browser.</p>
</li>
</ul>
</li>
<li>Make WordPress SSL-ready:<br />
Apply this <a href="/static/wp/wp2-ssl.patch">patch</a> to the WordPress code. It makes the following changes:</p>
<ul>
<li>Use <em>secure</em> authentication cookies in <code>wp_setcookie()</code></li>
<li>Make <code>check_admin_referer()</code> work with HTTPS URLs</li>
<li>Use HTTPS URLs for notification mails</li>
<li>Use HTTPS URLS for redirects to <code>wp-login.php</code></li>
<li>Only allow XML-RPC logins from the local host (ie. the HTTPS proxy)</li>
<li>Add the <em>Mark-as-Spam</em> feature from trunk</li>
</ul>
<p>The patch is against <a href="http://subversion.tigris.org/">svn</a> version 3825 of WordPress (ie. WordPress 2.0.3), when you apply it to a newer version, you will likely get some harmless ‘<code>Hunk succeeded</code>’ message. If you are getting ‘<code>Hunk FAILED</code>’ message, just send me note and I&#8217;ll update the patch.</p>
</li>
<li>Enable the necessary Apache modules:
<ul>
<li>Install <a href="http://apache.webthing.com/mod_proxy_html/">mod_proxy_html</a>.  It will be used to replace absolute &#8216;http://example.org&/#8217; HTTP URLs in the WordPress output with &#8216;https://example.org&/#8217; HTTPS URLs:
<pre>$ aptitude install libapache2-mod-proxy-html</pre>
<p>The module gets enabled automatically after installation.</p>
</li>
<li>Enable mod_proxy and mod_ssl
<pre>$ a2enmod proxy
$ a2enmod ssl</pre>
<p>Debian provides sane default configurations for both modules. You might want to take a look at the configuration files (<code>ssl.conf</code> and <code>proxy.conf</code>) nevertheless.<br />
I have changed <code>SSLCipherSuite</code> to</p>
<pre style="overflow:scroll;width:93%;">TLSv1:SSLv3:!SSLv2:!aNULL:!eNULL:!NULL:!EXP:!DES:!MEDIUM:!LOW:@STRENGTH</pre>
<p>in <code>ssl.conf</code> in order to just allow TLS v1 and SSL v3 ciphers which provide strong encryption and authentication (see <a href="http://www.openssl.org/docs/apps/ciphers.html">ciphers(1)</a>).</p>
</li>
<li>If you are compressing WordPress output (that is if you enabled the <em>&#8216;WordPress should compress articles (gzip) if browsers ask for them&#8217;</em> option) then also enable mod_headers:
<pre>$ a2enmod headers</pre>
</li>
</ul>
</li>
<li>Configure Apache to listen on the HTTPS port
<pre>$ cat &gt; /etc/apache2/conf.d/ssl.conf &lt;&lt; EOF
&lt;IfModule mod_ssl.c&gt;
	Listen 443
&lt;/IfModule&gt;
EOF</pre>
</li>
<li>Modify the blog virtual host to limit access to <code>wp-login.php</code> and <code>wp-admin</code> to the local host. Also completely deny access to files which should never be accessed directly. Here is an example: <a href="/static/wp/10-wp2-example.org"><code>10-wp2-example.org</code></a></li>
<li>Now setup the HTTPS virtual server: <a href="/static/wp/20-wp2-example.org-ssl"><code>20-wp2-example.org-ssl</code></a><br />
If you are compressing WordPress output you have to enable the <code>RequestHeader</code> line.
</li>
<li>Enable the site and restart Apache
<pre>$ a2ensite 20-blog-ssl
$ /etc/init.d/apache2 restart</pre>
</li>
<li>Remove the old WP cookies from your browser</li>
<li>Test the new setup!</li>
</ul>
<p><em><strong>February 1st, 2006:</strong> <a href="/static/wp/wp2-ssl.patch">wp2-ssl.patch</a> updated for WordPress <a href="http://wordpress.org/development/2006/01/201-release/">2.0.1</a></em></p>
<p><em><strong>March 11st, 2006:</strong> WordPress <a href="http://wordpress.org/development/2006/03/security-202/">2.0.2</a> has been released, fixing some security issues. The HTTPS patch still applies fine to that version.</em></p>
<p><em><strong>March 19th, 2006:</strong> Updated <a href="/static/wp/wp2-ssl.patch">wp2-ssl.patch</a>. Changes: Fix bug in list-manipulation.php, use HTTPS for &#8216;Login&#8217; and &#8216;Register&#8217; links, backport &#8216;Mark-as-Spam&#8217; feature from trunk</em></p>
<p><em><strong>May 1st, 2006:</strong> WordPress <a href="http://wordpress.org/development/2006/06/wordpress-203/">2.0.3</a> has been released. Here is the updated <a href="/static/wp/wp2-ssl.patch">wp2-ssl.patch</a>.</em></p>
<p><em><strong>July 29th, 2006:</strong> WordPress <a href="http://wordpress.org/development/2006/07/wordpress-204/">2.0.4</a> has been released, fixing some security issues. Here is an updated version of the <a href="/static/wp/wp2-ssl.patch">wp2-ssl.patch</a>.</em></p>
<p><em><strong>January 12st, 2007:</strong> <a href="/static/wp/wp2-ssl.patch">wp2-ssl.patch</a> updated for 2.0.6 and 2.0.7-RC1</em></p>
<p><em><strong>January 15st, 2007:</strong> WordPress <a href="http://wordpress.org/development/2007/01/wordpress-207/">2.0.7</a> has been released. The patch still applies fine to that version.</em></p>
]]></content:encoded>
					
					<wfw:commentRss>/articles/securing-wordpress-2-admin-access-with-ssl/feed/</wfw:commentRss>
			<slash:comments>32</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">43</post-id>	</item>
		<item>
		<title>XOrg 6.9 evdev Fix for Big-Endian Machines</title>
		<link>/articles/xorg-69-evdev-fix-for-big-endian-machines/</link>
		
		<dc:creator><![CDATA[Jürgen Kreileder]]></dc:creator>
		<pubDate>Wed, 18 Jan 2006 20:01:27 +0000</pubDate>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<guid isPermaLink="false">http://blog.blackdown.de/2006/01/18/xorg-69-evdev-fix-for-big-endian-machines/</guid>

					<description><![CDATA[The new evdev driver in XOrg 6.9 is broken on big-endian machines (e.g. powerpc). Here&#8217;s a patch that fixes the problem.]]></description>
										<content:encoded><![CDATA[<p>The new <em>evdev</em> driver in XOrg 6.9 is broken on big-endian machines (e.g. powerpc). Here&#8217;s a <a href="/static/x11/evdev.patch">patch</a> that fixes the problem.</p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">42</post-id>	</item>
		<item>
		<title>Debian Testing Gets Security Support</title>
		<link>/articles/debian-testing-gets-security-support/</link>
		
		<dc:creator><![CDATA[Jürgen Kreileder]]></dc:creator>
		<pubDate>Fri, 09 Sep 2005 23:41:09 +0000</pubDate>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security]]></category>
		<guid isPermaLink="false">http://blog.blackdown.de/2005/09/10/debian-testing-gets-security-support/</guid>

					<description><![CDATA[The Debian Testing Security Team just announced the beginning of full security support for Debian&#8217;s &#8220;testing&#8221; distribution! The lack of security support was one of the main problems with &#8220;testing&#8221;. You had to pull security fixes from &#8220;unstable&#8221; or even build your own packages to keep it secure. I hope they have the manpower to<br />[&#8594; <a href="/articles/debian-testing-gets-security-support/" class="more-link">Read the rest of this entry</a>]]]></description>
										<content:encoded><![CDATA[<p>The <a href="http://secure-testing-master.debian.net/">Debian Testing Security Team</a> just <a href="http://lists.debian.org/debian-devel-announce/2005/09/msg00006.html">announced</a> the beginning of full security support for <a href="http://www.debian.org/">Debian&#8217;s</a> <a href="http://www.debian.org/releases/testing/">&#8220;testing&#8221;</a> distribution!</p>
<p>The lack of security support was one of the main problems with &#8220;testing&#8221;. You had to pull security fixes from &#8220;unstable&#8221; or even build your own packages to keep it secure.</p>
<p>I hope they have the manpower to keep up with security issues. Debian&#8217;s main security team, which only provides updates for the &#8220;stable&#8221; distribution, had some problems over the last months.</p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">39</post-id>	</item>
		<item>
		<title>Debian Installer With Kernel 2.6.11</title>
		<link>/articles/debian-installer-with-kernel-2611/</link>
					<comments>/articles/debian-installer-with-kernel-2611/#comments</comments>
		
		<dc:creator><![CDATA[Jürgen Kreileder]]></dc:creator>
		<pubDate>Sun, 26 Jun 2005 09:43:04 +0000</pubDate>
				<category><![CDATA[Config]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Linux Kernel]]></category>
		<guid isPermaLink="false">http://blog.blackdown.de/2005/06/26/debian-installer-with-kernel-2611/</guid>

					<description><![CDATA[As mentioned recently, Debian Sarge&#8217;s installer doesn&#8217;t work on my Dell Inspiron 9300. I like Debian but I think it&#8217;s a shame that the sarge installer was already outdated on the day of its release. The official sarge installer still uses a 2.4 kernel by default but includes a 2.6 kernel that can be used<br />[&#8594; <a href="/articles/debian-installer-with-kernel-2611/" class="more-link">Read the rest of this entry</a>]]]></description>
										<content:encoded><![CDATA[<p>As <a href="/2005/06/06/the-sky-is-falling/">mentioned</a> recently, <a href="http://debian.org/">Debian</a> Sarge&#8217;s installer doesn&#8217;t work on my Dell Inspiron 9300. I like Debian but I think it&#8217;s a shame that the sarge installer was already outdated on the day of its release.</p>
<p>The official sarge installer still uses a 2.4 kernel by default but includes a 2.6 kernel that can be used by booting with &quot;<code>install26</code>&quot; or &quot;<code>expert26</code>&quot;.  But even that kernel, 2.6.8, is too old for the Inspiron 9300. It still doesn&#8217;t recognize the hard disk.</p>
<p>Ubuntu&#8217;s installer, which uses a 2.6.11 kernel, works fine on the machine. Although <a href="http://ubuntu.com/">Ubuntu</a> is a nice distribution, I like pure Debian better. Unfortunately I wasn&#8217;t able to find any 2.6.11 based Debian installer on the net, even a question on <a href="http://lists.debian.org/debian-boot/">debian-boot</a> yielded nothing.</p>
<p>Anyhow, I finally had the time to build one myself:<br />
<a href="/static/debian/debian-2.6.11-i386-businesscard.iso">debian-2.6.11-i386-businesscard.iso</a> (<a href="/static/debian/debian-2.6.11-i386-businesscard.iso.sign">GPG signature</a>)</p>
<p>The image is basically a sarge businesscard ISO with a 2.6.11 kernel from Debian testing instead of the original 2.6.8 kernel.</p>
<p>Unlike with Ubuntu, installation on the Inspiron 9300 still doesn&#8217;t work out of the box but with a few tricks I was able to install Debian sarge:</p>
<ul>
<li>Boot with <code>expert26</code></li>
<li>When the installer starts up, switch to the second console (Alt-F2) and enter these commands:
<pre>
~ # modprobe ide_generic
~ # modprobe ata_piix</pre>
<p>Without this the installer won&#8217;t find the CD-ROM.</p>
</li>
<li>If network configuration via DHCP fails, just retry &#8212; worked for me</li>
<li>When asked what version of Debian you would like to install, choose <em>stable</em>.  Installing <em>testing</em> or <em>unstable</em> directly doesn&#8217;t work.</li>
<li>It doesn&#8217;t matter which kernel you choose to install, we have to replace it with a 2.6.11 kernel later anyway</li>
<li>Just before the first reboot, that means right after the installer ejects the CD-ROM, switch back to console two. Now download and install the latest available Debian kernel. I&#8217;ve used <a href="/static/debian/kernel-image-2.6.11-1-686_2.6.11-7_i386.deb">2.6.11-1-686</a>:
<pre style="overflow:auto;width:100%;">~ # mount -t proc proc /target/proc
~ # chroot /target
sh-2.05b# cd /root
sh-2.05b# wget http://blog.blackdown.de/static/debian/kernel-image-2.6.11-1-686_2.6.11-7_i386.deb
sh-2.05b# dpkg -i kernel-image-2.6.11-1-686_2.6.11-7_i386.deb
&hellip;
sh-2.05b# exit
~ # umount /target/proc</pre>
</li>
<li>Reboot (using the kernel just installed) and complete the installation</li>
<li>Upgrade to <em>testing</em> or <em>unstable</em></li>
<li>Build a custom kernel (2.6.12 or newer). It&#8217;s probably a good idea to include some additional libata <a href="http://www.kernel.org/pub/linux/kernel/people/jgarzik/libata/">patches</a>. To get the DVD drive working you have to apply this <a href="/static/kernel/ata-atapi.patch">patch</a>.</li>
</ul>
]]></content:encoded>
					
					<wfw:commentRss>/articles/debian-installer-with-kernel-2611/feed/</wfw:commentRss>
			<slash:comments>22</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">35</post-id>	</item>
		<item>
		<title>Debian Packages for J2SE 1.4.2-02</title>
		<link>/articles/debian-packages-for-j2se-142-02/</link>
		
		<dc:creator><![CDATA[Jürgen Kreileder]]></dc:creator>
		<pubDate>Thu, 16 Jun 2005 04:15:40 +0000</pubDate>
				<category><![CDATA[Blackdown]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<guid isPermaLink="false">http://blog.blackdown.de/2005/06/16/debian-packages-for-j2se-142-02/</guid>

					<description><![CDATA[Thanks to Matthias Klose, Debian packages for Blackdown J2SE-1.4.2-02 are available now. Just add something like deb ftp://ftp.tux.org/java/debian/ sarge non-free to your /etc/apt/sources.list. Upgrading is recommended as 1.4.2-02 contains an important security fix.]]></description>
										<content:encoded><![CDATA[<p>Thanks to Matthias Klose, Debian packages for <a href="ftp://ftp.tux.org/java/JDK-1.4.2/">Blackdown J2SE-1.4.2-02</a> are available now.  Just add something like</p>
<pre>deb ftp://ftp.tux.org/java/debian/ sarge non-free</pre>
<p>to your <code>/etc/apt/sources.list</code>.</p>
<p>Upgrading is recommended as 1.4.2-02 contains an important security <a href="http://www.blackdown.org/java-linux/java2-status/security/Blackdown-SA-2005-02.txt">fix</a>.</p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">34</post-id>	</item>
		<item>
		<title>The Sky Is Falling</title>
		<link>/articles/the-sky-is-falling/</link>
					<comments>/articles/the-sky-is-falling/#comments</comments>
		
		<dc:creator><![CDATA[Jürgen Kreileder]]></dc:creator>
		<pubDate>Mon, 06 Jun 2005 19:39:01 +0000</pubDate>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<guid isPermaLink="false">http://blog.blackdown.de/2005/06/06/the-sky-is-falling/</guid>

					<description><![CDATA[Debian Sarge is released (unfortunately the installer doesn&#8217;t like my Inspiron 9300) Apple is switching to Intel CPUs]]></description>
										<content:encoded><![CDATA[<ul>
<li>Debian Sarge is <a href="http://ftp.debian.org/dists/stable/Release">released</a> (unfortunately the installer doesn&#8217;t like my Inspiron 9300)</li>
<li>Apple is <a href="http://www.apple.com/pr/library/2005/jun/06intel.html">switching</a> to Intel CPUs</li>
</ul>
]]></content:encoded>
					
					<wfw:commentRss>/articles/the-sky-is-falling/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">32</post-id>	</item>
		<item>
		<title>Securing WordPress Admin Access With SSL</title>
		<link>/articles/securing-wordpress-admin-access-with-ssl/</link>
					<comments>/articles/securing-wordpress-admin-access-with-ssl/#comments</comments>
		
		<dc:creator><![CDATA[Jürgen Kreileder]]></dc:creator>
		<pubDate>Tue, 17 May 2005 23:11:24 +0000</pubDate>
				<category><![CDATA[Config]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[WordPress]]></category>
		<guid isPermaLink="false">http://blog.blackdown.de/2005/05/18/securing-wordpress-admin-access-with-ssl/</guid>

					<description><![CDATA[January 22nd, 2006: There&#8217;s an updated version of this guide for WordPress 2 now: Securing WordPress 2 Admin Access With SSL As one can guess from the look of this site, I&#8217;m using WordPress as my blog engine. At this time WordPress does not support HTTPS access to the admin area when the rest of<br />[&#8594; <a href="/articles/securing-wordpress-admin-access-with-ssl/" class="more-link">Read the rest of this entry</a>]]]></description>
										<content:encoded><![CDATA[<p><em><strong>January 22nd, 2006:</strong> There&#8217;s an updated version of this guide for WordPress 2 now: <a href="/2006/01/22/securing-wordpress-2-admin-access-with-ssl/">Securing WordPress 2 Admin Access With SSL</a></em></p>
<p>As one can guess from the look of this site, I&#8217;m using <a href="http://wordpress.org/" rel="tag">WordPress</a> as my blog engine. At this time WordPress does not support HTTPS access to the admin area when the rest of the blog is served via normal HTTP. This is a bit unfortunate. I do not like logging in to my server over unencrypted connections, especially not when using public WLANs. Getting around this WordPress limitation requires quite a few steps:</p>
<h3>The Goal</h3>
<p>All communication involving passwords or authentication cookies should be done over HTTPS connections. <code>wp-login.php</code> and the <code>wp-admin</code> directory should only be accessible over HTTPS.<br />
Normal reading access, as well as comments, tracebacks, and pingbacks still should go over ordinary HTTP.</p>
<h3>The Plan</h3>
<ul>
<li>Add an HTTPS virtual host that forwards requests to the HTTP virtual host</li>
<li>Modify WordPress to send <em>secure</em> authentication cookies, so cookies never get sent over insecure connections accidentally</li>
<li>Require a valid certificate on HTTPS clients. That means to log in to WordPress you need both a valid certificate and a valid password.  If someone manages to get your password, he still can not login because he does not have a valid certificate.</li>
</ul>
<h3>The Implementation</h3>
<p>Note: This documentation assumes a <a href="http://www.debian.org/">Debian</a> sarge installation with <a href="http://httpd.apache.org/" rel="tag">Apache</a> 2. Some things, in particular Apache module related ones, will be different on other systems.<br />
The server used throughout the instructions is example.org/192.0.34.166. The server&#8217;s <code>DocumentRoot</code> is /blog and WordPress resides in /blog/wp. The value of WordPress&#8217; <code>home</code> option is &#8216;http://example.org&/#8217; and the value of its <code>site_url</code> option is &#8216;http://example.org/wp&#8217;.</p>
<ul>
<li>Prepare the SSL certificates:
<ul>
<li>Generate your own certificate authority (CA) if you don&#8217;t have one already (I&#8217;m using the makefile from <a href="http://sial.org/howto/openssl/ca/">OpenSSL Certificate Authority Setup</a> for managing mine) and import it into your browser.</li>
<li>Generate a certificate for the SSL server and certify it with your private CA.</li>
<li>Generate a certificate for your browser and certify it with your private CA. Most browsers expect a <abbr title="Public-Key Cryptography Standard">PKCS</abbr>#12 file, so generate one with
<pre>$ openssl pkcs12 -export -clcerts &#92;
    -in blogclient.cert &#92;
    -inkey blogclient.key &#92;
    -out blogclient.p12</pre>
<p> Then import <code>blogclient.p12</code> into your browser.</p>
</li>
</ul>
</li>
<li>Make WordPress SSL-ready:<br />
Apply this <a href="/static/wp/wp-ssl.patch">patch</a> to the WordPress code. It makes the following changes:</p>
<ul>
<li>Use <em>secure</em> authentication cookies in <code>wp_setcookie()</code></li>
<li>Make <code>check_admin_referer()</code> working with HTTPS URLs</li>
<li>Disable login over XML-RPC</li>
</ul>
</li>
<li>Enable the necessary Apache modules:
<ul>
<li>Install <a href="http://apache.webthing.com/mod_proxy_html/">mod_proxy_html</a>.  It will be used to replace absolute &#8216;http://example.org&/#8217; HTTP URLs in the WordPress output with &#8216;https://example.org&/#8217; HTTPS URLs:
<pre>$ aptitude install libapache2-mod-proxy-html</pre>
<p>The module gets enabled automatically after installation.</p>
</li>
<li>Enable mod_proxy and mod_ssl
<pre>$ a2enmod proxy
$ a2enmod ssl</pre>
<p>Debian provides sane default configurations for both modules. You might want to take a look at the configuration files (<code>ssl.conf</code> and <code>proxy.conf</code>) nevertheless.</p>
</li>
<li>If you are compressing WordPress output (that is if you enabled the <em>&#8216;WordPress should compress articles (gzip) if browsers ask for them&#8217;</em> option) then also enable mod_headers:
<pre>$ a2enmod headers</pre>
</li>
</ul>
</li>
<li>Configure Apache to listen on the HTTPS port
<pre>$ cat &gt; /etc/apache2/conf.d/ssl.conf &lt;&lt; EOF
&lt;IfModule mod_ssl.c&gt;
	Listen 443
&lt;/IfModule&gt;
EOF</pre>
</li>
<li>Modify the blog virtual host to limit access to <code>wp-login.php</code> and <code>wp-admin</code> to the local host. Also completely deny access to files which should never be accessed directly. Here is an example: <a href="/static/wp/10-example.org"><code>10-example.org</code></a></li>
<li>Now setup the HTTPS virtual server: <a href="/static/wp/20-example.org-ssl"><code>20-example.org-ssl</code></a><br />
If you are compressing WordPress output you have to enable the <code>RequestHeader</code> line.
</li>
<li>Enable the site and restart Apache
<pre>$ a2ensite 20-blog-ssl
$ /etc/init.d/apache2 restart</pre>
</li>
<li>Remove the old WP cookies from your browser</li>
<li>Test the new setup!</li>
</ul>
]]></content:encoded>
					
					<wfw:commentRss>/articles/securing-wordpress-admin-access-with-ssl/feed/</wfw:commentRss>
			<slash:comments>20</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">28</post-id>	</item>
		<item>
		<title>cyrus_sasl patch for Exim 4</title>
		<link>/articles/cyrus_sasl-patch-for-exim-4/</link>
		
		<dc:creator><![CDATA[Jürgen Kreileder]]></dc:creator>
		<pubDate>Tue, 22 Mar 2005 00:11:32 +0000</pubDate>
				<category><![CDATA[Config]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Network]]></category>
		<guid isPermaLink="false">http://blog.blackdown.de/2005/03/22/cyrus_sasl-patch-for-exim-4/</guid>

					<description><![CDATA[The Exim 4 source code supports authentication with SASL since version 4.43. Debian started enabling this feature in exim4_4.50-2. After I&#8217;ve had upgraded to that version and replaced my saslauthd authenticators with brand-new cyrus_sasl authenticators, I&#8217;ve noticed that auth.log got flooded with entries like &#8216;exim4: OTP unavailable because can't read/write key database /etc/opiekeys: No such<br />[&#8594; <a href="/articles/cyrus_sasl-patch-for-exim-4/" class="more-link">Read the rest of this entry</a>]]]></description>
										<content:encoded><![CDATA[<p>The <a href="http://www.exim.org/">Exim 4</a> source code supports authentication with <a href="http://asg.web.cmu.edu/sasl/"><acronym title="Simple Authentication and Security Layer">SASL</acronym></a> since version 4.43. <a href="http://www.debian.org/">Debian</a> started enabling this feature in exim4_4.50-2. After I&#8217;ve had upgraded to that version and replaced my <em>saslauthd</em> authenticators with brand-new <em>cyrus_sasl</em> authenticators, I&#8217;ve noticed that <code>auth.log</code> got flooded with entries like &#8216;<code>exim4: OTP unavailable because can't read/write key database /etc/opiekeys: No such file or directory</code>.&#8217;</p>
<p>My exim configuration uses three different <em>cyrus_sasl</em> authenticators and each exim invocation resulted in three of these <abbr title="One-Time-Password">OTP</abbr> warnings because exim calls <code>sasl_listmech()</code> for each configured authenticator. It doesn&#8217;t specify a limiting <code>mech_list</code>, that means SASL will test which of all installed mechs actually can be used for authentication. Debian&#8217;s SASL package includes <code>libotp.so</code>, so it also tries to use OTP which is not configured on my system.</p>
<p>There are two ways to get rid off the warnings:</p>
<ul>
<li>Remove <code>/usr/lib/sasl2/libotp.*</code>. You&#8217;ll have to do this after each upgrade of the libsasl2-modules package.</li>
<li>Rebuild exim with this <a href="/static/exim/71_cyrus_sasl.dpatch">patch</a>. The patch specifies a limiting <code>mech_list</code> option for SASL.  This limits <code>sasl_listmech()</code> to the mechs used in the exim configuration. Other mechs won&#8217;t be tried anymore.</li>
</ul>
<p><em><strong>May 3rd, 2005:</strong> A slightly modified version of the patch has been integrated into Exim CVS and will be included in the next Debian release of exim4 (see Debian bug <a href="http://bugs.debian.org/299743">#299743</a>)</em></p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">19</post-id>	</item>
		<item>
		<title>Updated MySQL Chroot Script</title>
		<link>/articles/updated-mysql-chroot-script/</link>
					<comments>/articles/updated-mysql-chroot-script/#comments</comments>
		
		<dc:creator><![CDATA[Jürgen Kreileder]]></dc:creator>
		<pubDate>Sun, 13 Mar 2005 03:12:17 +0000</pubDate>
				<category><![CDATA[Config]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Security]]></category>
		<guid isPermaLink="false">http://blog.blackdown.de/2005/03/13/updated-mysql-chroot-script/</guid>

					<description><![CDATA[Debian&#8217;s latest MySQL packages are compiled with --with-mysqld-ldflags = -all-static. That means libc.so.6 is linked statically now. But glibc&#8217;s getpwnam and getpwuid implementations still need the shared libraries. The needed libraries must be copied into the chroot because mysqld calls those functions after calling chroot. I&#8217;ve updated the mysql-chroot script accordingly. (The rest of the<br />[&#8594; <a href="/articles/updated-mysql-chroot-script/" class="more-link">Read the rest of this entry</a>]]]></description>
										<content:encoded><![CDATA[<p><a href="http://www.debian.org/">Debian&#8217;s</a> latest <a href="http://dev.mysql.com/">MySQL</a> packages are compiled with <code>--with-mysqld-ldflags = -all-static</code>.</p>
<p>That means <code>libc.so.6</code> is linked statically now. But glibc&#8217;s <code>getpwnam</code> and <code>getpwuid</code> implementations still need the shared libraries. The needed libraries must be copied into the chroot because <code>mysqld</code> calls those functions after calling <code>chroot</code>. I&#8217;ve updated the <code><a href="/static/mysql-chroot">mysql-chroot</a></code> script accordingly.<br />
<em>(The rest of the chroot setup procedure still works as described in <a href="/2005/03/04/chrooting-mysql-on-debian/">Chrooting MySQL on Debian</a>.)</em></p>
<p>By the way, I&#8217;ve filed a wishlist bug at Debian&#8217;s BTS (<a href="http://bugs.debian.org/299265">#299265</a>). <code>mysqld</code> should do all <code>/etc/passwd</code> lookups before calling <code>chroot</code>. That way chrooting would work without <code>$CHROOT/etc/passwd</code> and with copying any libraries into the chroot. That&#8217;s how Apache and Bind 9 do it.</p>
<p><em><strong>March 17th, 2005:</strong> Debian has removed the <code>-all-static</code> flag again. I&#8217;m leaving the additional bits in the chroot script however, just in case the maintainers decide to add the flag again.</em></p>
]]></content:encoded>
					
					<wfw:commentRss>/articles/updated-mysql-chroot-script/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">12</post-id>	</item>
		<item>
		<title>PHP Error Logging to syslog from a chroot</title>
		<link>/articles/php-error-logging-to-syslog-from-a-chroot/</link>
		
		<dc:creator><![CDATA[Jürgen Kreileder]]></dc:creator>
		<pubDate>Mon, 07 Mar 2005 06:48:34 +0000</pubDate>
				<category><![CDATA[Config]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security]]></category>
		<guid isPermaLink="false">http://blog.blackdown.de/2005/03/08/php-error-logging-to-syslog-from-a-chroot/</guid>

					<description><![CDATA[Here&#8217;s a little trick to log PHP errors to syslog from an apache chroot. Instead of creating a $CHROOT/dev/log socket in the chroot and configuring syslog to listen on that, just define a bogus virtual host that logs to syslog. &#60;VirtualHost 127.0.0.2:80&#62; ServerName JustForOpeningSyslog Redirect permanent / http://127.0.0.1/ ErrorLog syslog &#60;/VirtualHost&#62; Now apache calls openlog(3)<br />[&#8594; <a href="/articles/php-error-logging-to-syslog-from-a-chroot/" class="more-link">Read the rest of this entry</a>]]]></description>
										<content:encoded><![CDATA[<p>Here&#8217;s a little trick to log <a href="http://www.php.net/">PHP</a> errors to syslog from an <a href="http://httpd.apache.org/">apache</a> chroot. Instead of creating a <code>$CHROOT/dev/log</code> socket in the chroot and configuring syslog to listen on that, just define a bogus virtual host that logs to syslog.</p>
<pre>
&lt;VirtualHost 127.0.0.2:80&gt;
        ServerName JustForOpeningSyslog
        Redirect permanent / http://127.0.0.1/
        ErrorLog syslog
&lt;/VirtualHost&gt;</pre>
<p>Now apache calls <code>openlog(3)</code> with <code>LOG_NDELAY</code> before being chrooted by libapache2-mod-chroot, and libapache2-mod-php4&#8217;s <code>syslog(3)</code> calls work just fine.<br />
(Idea stolen from <a href="http://cryptio.net/~ferlatte/blog/2004/10/01/#syslog_and_chroot">syslog(3) and chroot(2)</a>.)</p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">8</post-id>	</item>
		<item>
		<title>Chrooting MySQL on Debian</title>
		<link>/articles/chrooting-mysql-on-debian/</link>
					<comments>/articles/chrooting-mysql-on-debian/#comments</comments>
		
		<dc:creator><![CDATA[Jürgen Kreileder]]></dc:creator>
		<pubDate>Fri, 04 Mar 2005 22:46:45 +0000</pubDate>
				<category><![CDATA[Config]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Security]]></category>
		<guid isPermaLink="false">http://blog.blackdown.de/2005/03/08/chrooting-mysql-on-debian/</guid>

					<description><![CDATA[It&#8217;s quite easy to chroot bind9 and apache on Debian. (See this page for bind9 and libapache2-mod-chroot or libapache2-mod-security for apache.) But I&#8217;ve found no guide for chrooting MySQL, so here&#8217;s my short recipe: Prepare the chroot directory. It&#8217;s recommended to use an extra partition/filesystem for it. I will use /srv/mysql (which is an LVM2<br />[&#8594; <a href="/articles/chrooting-mysql-on-debian/" class="more-link">Read the rest of this entry</a>]]]></description>
										<content:encoded><![CDATA[<p>It&#8217;s quite easy to chroot <a href="http://www.isc.org/sw/bind/">bind9</a> and <a href="http://httpd.apache.org/">apache</a> on <a href="http://www.debian.org/">Debian</a>.  (See <a href="http://cryptio.net/~ferlatte/blog/config/bind9/">this page</a> for bind9 and <a href="http://packages.debian.org/libapache2-mod-chroot">libapache2-mod-chroot</a> or <a href="http://packages.debian.org/libapache2-mod-security">libapache2-mod-security</a> for apache.)</p>
<p>But I&#8217;ve found no guide for chrooting <a href="http://dev.mysql.com/">MySQL</a>, so here&#8217;s my short recipe:</p>
<ul>
<li>Prepare the chroot directory. It&#8217;s recommended to use an extra partition/filesystem for it. I will use <code>/srv/mysql</code> (which is an <a href ="http://sourceware.org/lvm2/">LVM2</a> partition with an ext3 filesystem on my system) for the rest of the text.</li>
<li>Stop MySQL:
<pre>/etc/init.d/mysql stop</pre>
</li>
<li>Copy the databases to new location:
<pre>mkdir -p /srv/mysql/var/lib
cp -a /var/lib/mysql /srv/mysql/var/lib</pre>
</li>
<li>Copy <a href="/static/mysql-chroot">this script</a> to <code>/etc/default/mysql-chroot</code></li>
<li>Edit <code>/etc/init.d/mysql</code>:
<ul>
<li>Source the <code><a href="/static/mysql-chroot">mysql-chroot</a></code> script somewhere at the top:
<pre>&hellip;
test -x /usr/sbin/mysqld || exit 0

<strong>. /etc/default/mysql-chroot</strong>

SELF=$(cd $(dirname $0); pwd -P)/$(basename $0)
&hellip;</pre>
</li>
<li>Run <code>setup_chroot</code> right in the start section:
<pre>&hellip;
if mysqld_status check_alive nowarn; then
  echo &quot;...already running.&quot;
else
<strong>  setup_chroot</strong>
  /usr/bin/mysqld_safe &gt; /dev/null 2&gt;&amp;1 &amp;
&hellip;</pre>
</li>
<li>Somehow <code>/var/run/mysqld/mysqld.pid</code> disappears after each start.  We have to create it each time, otherwise the <code>stop</code> command won&#8217;t work properly:
<pre>&hellip;
if mysqld_status check_alive warn; then
  echo &quot;.&quot;
<strong>  ln -sf $CHROOT_DIR/var/run/mysqld/mysqld.pid \
                 /var/run/mysqld</strong>
  # Now start mysqlcheck or whatever the admin wants.
  /etc/mysql/debian-start
&hellip;</pre>
</li>
</ul>
</li>
<li>In <code>/etc/mysql/debian.cnf</code>, change the <code>socket</code> line to:
<pre>socket = /srv/mysql/var/run/mysqld/mysqld.sock</pre>
</li>
<li>In <code>/etc/mysql/my.cnf</code>:
<ul>
<li>Change the <code>socket</code> line in the <code>[client]</code> section to:
<pre>socket = /srv/mysql/var/run/mysqld/mysqld.sock</pre>
<p>Don&#8217;t change the <code>socket</code> lines in the other sections!</p>
</li>
<li>Add
<pre>chroot = /srv/mysql</pre>
<p> to the <code>[mysqld]</code> section.</p>
</li>
</ul>
</li>
<li>Prepend <code>/srv/mysql</code> to the log files listed in <code>/etc/logrotate.d/mysql-server</code></li>
<li>Start MySQL:
<pre>/etc/init.d/mysql start</pre>
</li>
<li>Check <code>/var/log/syslog</code> for errors ;-)</li>
</ul>
<p><em><strong>March 13th, 2005:</strong> I&#8217;ve updated the script for newer Debian packages, see <a href="/2005/03/13/updated-mysql-chroot-script/">Updated MySQL Chroot Script</a> for more information.</em></p>
<p><em><strong>July 30th, 2006:</strong> These modifications still work fine on the current stable Debian release (3.1, &#8220;sarge&#8221;).  The mysql packages in the testing (&#8220;etch&#8221;) and unstable (&#8220;sid&#8221;) distributions of Debian need a few additional changes, I&#8217;ll post an updated guide in a few days.</em></p>
<p><em><strong>December 30th, 2006:</strong> I&#8217;ve made an <a href="/2006/12/30/chrooting-recent-mysql-versions-on-debian-and-ubuntu/">updated guide</a> on how to chroot more recent MySQL packages on Debian and Ubuntu</em></p>
]]></content:encoded>
					
					<wfw:commentRss>/articles/chrooting-mysql-on-debian/feed/</wfw:commentRss>
			<slash:comments>16</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">7</post-id>	</item>
		<item>
		<title>Exim 4 and Dynamic IP-Addresses</title>
		<link>/articles/exim-4-and-dynamic-ip-addresses/</link>
		
		<dc:creator><![CDATA[Jürgen Kreileder]]></dc:creator>
		<pubDate>Sat, 26 Feb 2005 11:38:29 +0000</pubDate>
				<category><![CDATA[Config]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Network]]></category>
		<guid isPermaLink="false">http://blog.blackdown.de/2005/03/08/exim-4-and-dynamic-ip-addresses/</guid>

					<description><![CDATA[I&#8217;ve recently changed my network connection at home to a provider which assigns dynamic addresses. Exim always provided a broken HELO/EHLO name to my smarthost since then because my externally visible hostname changes each time I connect. I&#8217;m now using Exim&#8217;s Perl interface to lookup the assigned hostname when connecting my smarthost: /etc/exim4/exim.pl: Don&#8217;t forget<br />[&#8594; <a href="/articles/exim-4-and-dynamic-ip-addresses/" class="more-link">Read the rest of this entry</a>]]]></description>
										<content:encoded><![CDATA[<p>I&#8217;ve recently changed my network connection at home to a provider which assigns dynamic addresses. <a href="http://www.exim.org/">Exim</a> always provided a broken HELO/EHLO name to my smarthost since then because my externally visible hostname changes each time I connect. I&#8217;m now using Exim&#8217;s Perl interface to lookup the assigned hostname when connecting my smarthost:</p>
<ul>
<li><code>/etc/exim4/exim.pl</code>:<br />
<em>Don&#8217;t forget to change <code>ppp0</code> to the interface you want to handle!</em></p>
<pre>
#! /usr/bin/perl

# Requires libio-interface-perl

use strict;
use IO::Socket;
use IO::Interface;

sub get_remote_helo_data()
{
    my $s = IO::Socket::INET-&gt;new(Proto =&gt; 'udp');
    my $addr = inet_aton($s-&gt;if_addr('ppp0'));
    my $hostname = gethostbyaddr($addr, AF_INET);

    $hostname = '' if (!$hostname);

    return $hostname;
}
</pre>
</li>
<li><code>/etc/exim4/conf.d/main/50_exim4-localconfig_perl</code>:
<pre>
#main/50_exim4-localconfig_perl
perl_at_start = true
perl_startup = do '/etc/exim4/exim.pl'
</pre>
</li>
<li>Add the following code to the appropriate transport, e.g. <code>remote_smtp_smarthost</code>:
<pre>
helo_data = \
  ${if &gt;{${strlen:${perl{get_remote_helo_data}}}}{0} \
                 {${perl{get_remote_helo_data}}} \
                 {$primary_hostname}}
</pre>
</li>
</ul>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">4</post-id>	</item>
	</channel>
</rss>
