<?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>Dotdeb &#187; Documentation</title>
	<atom:link href="http://www.dotdeb.org/category/documentation/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dotdeb.org</link>
	<description>The repository for Debian-based LAMP servers</description>
	<lastBuildDate>Mon, 06 Sep 2010 15:52:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>MySQL on Amazon benchmarks : RDS vs EC2</title>
		<link>http://www.dotdeb.org/2010/05/04/mysql-on-amazon-benchmarks-rds-vs-ec2/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=mysql-on-amazon-benchmarks-rds-vs-ec2</link>
		<comments>http://www.dotdeb.org/2010/05/04/mysql-on-amazon-benchmarks-rds-vs-ec2/#comments</comments>
		<pubDate>Tue, 04 May 2010 16:52:14 +0000</pubDate>
		<dc:creator>Guillaume Plessis</dc:creator>
				<category><![CDATA[Documentation]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Amazon]]></category>
		<category><![CDATA[Cloud Computing]]></category>
		<category><![CDATA[google-perftools]]></category>
		<category><![CDATA[InnoDB]]></category>

		<guid isPermaLink="false">http://www.dotdeb.org/?p=352</guid>
		<description><![CDATA[On May 3rd, I gave a talk for the french Amazon Web Ser [...]]]></description>
			<content:encoded><![CDATA[<p>On May 3rd, I gave a talk for the<a title="the french AWS user group" href="http://www.aws-ug.fr/"> french Amazon Web Services user group</a> about hosting MySQL on Amazon. Two solutions exist :</p>
<ul>
<li>using RDS, a &#8220;Database as a Service&#8221;</li>
<li>running your own MySQL server on a EC2 instance, with an EBS volume attached, a snapshot-enabled filesystem&#8230;</li>
</ul>
<p>The comparison is made on <strong>features</strong>, <strong>cost</strong> and <strong>performances</strong>. I used the same MySQL version as RDS (5.1.42) and the same config. Performances are measured by <a title="tpcc-mysql on Launchpad" href="https://code.launchpad.net/~percona-dev/perconatools/tpcc-mysql">tpcc-mysql</a> from <a title="MySQL Performance Blog" href="http://www.mysqlperformanceblog.com/">Percona</a> and they are charted using <a title="Google Fusion Tables" href="http://tables.googlelabs.com/">Google Fusion Tables</a>.</p>
<p>You&#8217;ll se that, altough MySQL + EC2 requires some additionnal DBA or sysadmin skills, it allows a lot of more tuning and a real performance boost (+270%).</p>
<p>So, if you&#8217;re planning to host MySQL databases on Amazon, feel free to take a look at these slides :</p>
<div id="__ss_4080077" style="width: 425px;"><object id="__sse4080077" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="355" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="src" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=prsentationawsug-en-100513045920-phpapp02&amp;stripped_title=mysql-on-amazon-rds-vs-ec2" /><param name="name" value="__sse4080077" /><param name="allowfullscreen" value="true" /><embed id="__sse4080077" type="application/x-shockwave-flash" width="425" height="355" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=prsentationawsug-en-100513045920-phpapp02&amp;stripped_title=mysql-on-amazon-rds-vs-ec2" name="__sse4080077" allowscriptaccess="always" allowfullscreen="true"></embed></object>
</div>
<p>Note for french-speaking people : la présentation est disponible <a title="MySQL et Amazon : RDS vs EC2" href="http://www.slideshare.net/gplessis/mysql-et-amazon-rds-vs-ec2">en français</a>.</p>
 <p>Feel free to Flattr this post at <a href="http://flattr.com/" title="Flattr" target="_blank">flattr.com</a>, if you like it.</p> <p><a href="http://flattr.com/" title="Flattr" target="_blank"><img src="http://www.dotdeb.org/wp-content/plugins/flattrss/button-compact-static-100x17.png" alt="flattr this!"/></a></p><div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.dotdeb.org/2010/05/04/mysql-on-amazon-benchmarks-rds-vs-ec2/&via=dotdeb&text=MySQL on Amazon benchmarks : RDS vs EC2&related=w_a_s_t_e:Dotdeb's maintainer&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.dotdeb.org/2010/05/04/mysql-on-amazon-benchmarks-rds-vs-ec2/&via=dotdeb&text=MySQL on Amazon benchmarks : RDS vs EC2&related=w_a_s_t_e:Dotdeb's maintainer&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>]]></content:encoded>
			<wfw:commentRss>http://www.dotdeb.org/2010/05/04/mysql-on-amazon-benchmarks-rds-vs-ec2/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Calculate statistics from your Qmail logfiles using Awstats</title>
		<link>http://www.dotdeb.org/2008/10/13/calculate-statistics-from-your-qmail-logfiles-using-awstats/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=calculate-statistics-from-your-qmail-logfiles-using-awstats</link>
		<comments>http://www.dotdeb.org/2008/10/13/calculate-statistics-from-your-qmail-logfiles-using-awstats/#comments</comments>
		<pubDate>Mon, 13 Oct 2008 15:06:35 +0000</pubDate>
		<dc:creator>Guillaume Plessis</dc:creator>
				<category><![CDATA[Documentation]]></category>
		<category><![CDATA[Mail]]></category>
		<category><![CDATA[awstats]]></category>
		<category><![CDATA[qmail]]></category>
		<category><![CDATA[statistics]]></category>

		<guid isPermaLink="false">http://www.dotdeb.org/?p=141</guid>
		<description><![CDATA[Awstats is a commonly used program to calculate web sta [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://awstats.sourceforge.net/">Awstats</a> is a commonly used program to calculate web statistics from your webserver logfiles. It can detect useragents, referers, unique visitors&#8230; But one of its another feature is to build usage reports from your mail server&#8217;s logfiles, as seen on <a href="http://awstats.sourceforge.net/awstats.mail.html">this demo</a>.</p>
<p>Here is how to quickly configure Awstats to take profit of your Qmail log files&#8230;</p>
<p> </p>
<p style="text-align: center;"><img class="size-medium wp-image-146 aligncenter" title="mailboxes" src="http://www.dotdeb.org/wp-content/uploads/2008/10/956430_23580482-300x200.jpg" alt="mailboxes" width="300" height="200" /></p>
<p> </p>
<p><span id="more-141"></span>First of all, you need to convert rour <em>/var/log/mail.log</em> file to make it readable to Awstats (supposing you&#8217;re using Qmail and Vpopmail from Dotdeb and Awstats from Debian&#8217;s official repositories).</p>
<p>Hopefully, a tool is provided with the awstats package : <em>/usr/share/doc/awstats/examples/maillogconvert.pl</em></p>
<p>You can take a look at its output by executing the following command :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>doc<span style="color: #000000; font-weight: bold;">/</span>awstats<span style="color: #000000; font-weight: bold;">/</span>examples<span style="color: #000000; font-weight: bold;">/</span>maillogconvert.pl vadmin <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>mail.log </pre></div></div>

<p>(<em>vadmin</em> is here to consider the Vpopmail&#8217;s virtualdomain translation)</p>
<p>Great! We now just have to configure awstats to produce useful reports. Here is a sample configuration file (name it <em>/etc/awstats/awstats.mail.conf</em>, for example)&#8230; Please note the space <strong>after</strong> the pipe :</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;"><span style="color: #000099;">LogFile</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #933;">&quot;/usr/share/doc/awstats/examples/maillogconvert.pl vadmin /var/log/mail.log | &quot;</span>
<span style="color: #000099;">LogType</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">M</span>
<span style="color: #000099;">LogFormat</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #933;">&quot;%time2 %email %email_r %host %host_r %method %url %code %bytesd&quot;</span>
<span style="color: #000099;">SiteDomain</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #933;">&quot;localhost&quot;</span>
<span style="color: #000099;">HostAliases</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #933;">&quot;127.0.0.1 @/etc/qmail/rcpthosts&quot;</span>
<span style="color: #000099;">LevelForBrowsersDetection</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"><span style="">0</span> # <span style="">0</span> disables Browsers detection.</span>
<span style="color: #000099;">LevelForOSDetection</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"><span style="">0</span> # <span style="">0</span> disables OS detection.</span>
<span style="color: #000099;">LevelForRefererAnalyze</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"><span style="">0</span> # <span style="">0</span> disables Origin detection.</span>
<span style="color: #000099;">LevelForRobotsDetection</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"><span style="">0</span> # <span style="">0</span> disables Robots detection.</span>
<span style="color: #000099;">LevelForSearchEnginesDetection</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"><span style="">0</span> # <span style="">0</span> disables Search engines detection.</span>
<span style="color: #000099;">LevelForKeywordsDetection</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"><span style="">0</span> # <span style="">0</span> disables Keyphrases/Keywords detection.</span>
<span style="color: #000099;">LevelForFileTypesDetection</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"><span style="">0</span> # <span style="">0</span> disables File types detection.</span>
<span style="color: #000099;">ShowSummary</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">HB</span>
<span style="color: #000099;">ShowMonthStats</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">HB</span>
<span style="color: #000099;">ShowDaysOfMonthStats</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">HB</span>
<span style="color: #000099;">ShowDaysOfWeekStats</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">HB</span>
<span style="color: #000099;">ShowHoursStats</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">HB</span>
<span style="color: #000099;">ShowDomainsStats</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">0</span>
<span style="color: #000099;">ShowHostsStats</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">HBL</span>
<span style="color: #000099;">ShowRobotsStats</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">0</span>
<span style="color: #000099;">ShowEMailSenders</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">HBML</span>
<span style="color: #000099;">ShowEMailReceivers</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">HBML</span>
<span style="color: #000099;">ShowSessionsStats</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">0</span>
<span style="color: #000099;">ShowPagesStats</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">0</span>
<span style="color: #000099;">ShowFileTypesStats</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">0</span>
<span style="color: #000099;">ShowOSStats</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">0</span>
<span style="color: #000099;">ShowBrowsersStats</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">0</span>
<span style="color: #000099;">ShowOriginStats</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">0</span>
<span style="color: #000099;">ShowKeyphrasesStats</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">0</span>
<span style="color: #000099;">ShowKeywordsStats</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">0</span>
<span style="color: #000099;">ShowMiscStats</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">0</span>
<span style="color: #000099;">ShowHTTPErrorsStats</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">0</span>
<span style="color: #000099;">ShowSMTPErrorsStats</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">1</span></pre></div></div>

<p>Now, just add this line to /etc/cron.d/awstats to compute your logfiles every 10 minutes:</p>
<pre>0,10,20,30,40,50 * * * * root [ -x /usr/lib/cgi-bin/awstats.pl ] &amp;&amp; /usr/lib/cgi-bin/awstats.pl -config=mail -update &amp;&gt;/dev/null</pre>
<p>(Let&#8217;s enjoy a 10-minutes break or brew a good coffee, waiting for the stats to be calculated&#8230;)</p>
<p>Your mailserver&#8217;s statistics will shortly be available at this URL : <a href="http://yourserver/cgi-bin/awstats.pl?config=mail">http://yourserver/cgi-bin/awstats.pl?config=mail</a>.</p>
<script type="text/javascript">
var flattr_wp_ver = '0.9.14';
var flattr_uid = '13101';
var flattr_url = 'http://www.dotdeb.org';
var flattr_lng = 'en_GB';
var flattr_cat = 'text';
var flattr_tag = 'blog,wordpress,rss,feed';
var flattr_btn = 'large';
var flattr_tle = 'Dotdeb';
var flattr_dsc = 'The repository for Debian-based LAMP servers';
</script>
<script src="https://api.flattr.com/js/0.5.0/load.js?mode=auto" type="text/javascript"></script> <p>Feel free to Flattr this post at <a href="http://flattr.com/" title="Flattr" target="_blank">flattr.com</a>, if you like it.</p> <p><a href="http://flattr.com/" title="Flattr" target="_blank"><img src="http://www.dotdeb.org/wp-content/plugins/flattrss/button-compact-static-100x17.png" alt="flattr this!"/></a></p><div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.dotdeb.org/2008/10/13/calculate-statistics-from-your-qmail-logfiles-using-awstats/&via=dotdeb&text=Calculate statistics from your Qmail logfiles using Awstats&related=w_a_s_t_e:Dotdeb's maintainer&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.dotdeb.org/2008/10/13/calculate-statistics-from-your-qmail-logfiles-using-awstats/&via=dotdeb&text=Calculate statistics from your Qmail logfiles using Awstats&related=w_a_s_t_e:Dotdeb's maintainer&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>]]></content:encoded>
			<wfw:commentRss>http://www.dotdeb.org/2008/10/13/calculate-statistics-from-your-qmail-logfiles-using-awstats/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to package PHP extensions by yourself</title>
		<link>http://www.dotdeb.org/2008/09/25/how-to-package-php-extensions-by-yourself/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=how-to-package-php-extensions-by-yourself</link>
		<comments>http://www.dotdeb.org/2008/09/25/how-to-package-php-extensions-by-yourself/#comments</comments>
		<pubDate>Thu, 25 Sep 2008 12:52:56 +0000</pubDate>
		<dc:creator>Guillaume Plessis</dc:creator>
				<category><![CDATA[Documentation]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[extension]]></category>
		<category><![CDATA[package]]></category>
		<category><![CDATA[pecl]]></category>

		<guid isPermaLink="false">http://www.dotdeb.org/?p=116</guid>
		<description><![CDATA[I often receive emails telling me that Dotdeb is a grea [...]]]></description>
			<content:encoded><![CDATA[<p>I often receive emails telling me that Dotdeb is a great tool, but that some useful packages are missing, such as some <a href="http://pecl.php.net/">PECL</a> extensions. I wish I could maintain many and many packages, but I don&#8217;t think it&#8217;s a good idea for the Dotdeb&#8217;s overall quality and for my free time <img src='http://www.dotdeb.org/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  Sorry for that.</p>
<p>Then, this article will show you how to build packages from your favorite PECL extensions in a strict Debian way, using the <a href="http://packages.debian.org/stable/dh-make-php">dh-make-php</a> package.</p>
<p><span id="more-116"></span>Imagine we want to package the <a href="http://pecl.php.net/package/Fileinfo">Fileinfo</a> extension for PHP5&#8230;</p>
<p>First, install all the needed packages (libmagic-dev is only needed here to build Fileinfo) :</p>
<pre><strong># apt-get install dh-make-php php5-dev build-essential libmagic-dev</strong></pre>
<p>Then, export some needed environment variables, download the package</p>
<pre><strong># export DEBFULLNAME="Guillaume Plessis"
# export DEBEMAIL="gui@php.net"
# pecl download fileinfo</strong>
downloading Fileinfo-1.0.4.tgz ...
Starting to download Fileinfo-1.0.4.tgz (5,835 bytes)
.....done: 5,835 bytes
File /tmp/Fileinfo-1.0.4.tgz downloaded</pre>
<p>Ok, let&#8217;s summon the magical <em>dh-make-pecl</em> command with the appropriate arguments :</p>
<pre><strong># dh-make-pecl --only 5 Fileinfo-1.0.4.tgz</strong>
Creating debian source package: php-fileinfo-1.0.4
Upstream is: Ilia Alshanetsky
Guessing Maintainer: Guillaume Plessis</pre>
<p>No error message&#8230; Great! <em>dh-make-pecl</em> did its job, e.g. unarchived the tarball and created the <em>php-fileinfo-1.0.4/debian/</em> subdirectory that contains all the packaging stuff.<br />
&#8220;<em>&#8211;only 5</em>&#8221; restricts the building process to PHP5 packages (PHP4 is obsolete!)</p>
<p>Let&#8217;s build the package!</p>
<pre><strong># cd php-fileinfo-1.0.4/
# ./debian/rules binary</strong>
xsltproc --nonet --novalid debian/changelog.xsl package.xml &gt; debian/Changelog
touch build-stamp
dh_testdir
...
dh_md5sums
dh_builddeb
dpkg-deb: building package `php5-fileinfo' in `../php5-fileinfo_1.0.4-1_i386.deb'.</pre>
<p>That&#8217;s it! Let&#8217;s take a look at the content of the package&#8230;</p>
<pre><strong># dpkg -c ../php5-fileinfo_1.0.4-1_i386.deb</strong>
drwxr-xr-x root/root         0 2008-09-20 10:10 ./
drwxr-xr-x root/root         0 2008-09-20 10:10 ./usr/
drwxr-xr-x root/root         0 2008-09-20 10:10 ./usr/lib/
drwxr-xr-x root/root         0 2008-09-20 10:10 ./usr/lib/php5/
drwxr-xr-x root/root         0 2008-09-20 10:10 ./usr/lib/php5/20060613+lfs/
-rw-r--r-- root/root     10296 2008-09-20 10:10 ./usr/lib/php5/20060613+lfs/fileinfo.so
drwxr-xr-x root/root         0 2008-09-20 10:10 ./usr/share/
drwxr-xr-x root/root         0 2008-09-20 10:10 ./usr/share/doc/
drwxr-xr-x root/root         0 2008-09-20 10:10 ./usr/share/doc/php5-fileinfo/
-rw-r--r-- root/root       202 2008-09-20 10:09 ./usr/share/doc/php5-fileinfo/README.Debian
-rw-r--r-- root/root        26 2004-02-13 01:06 ./usr/share/doc/php5-fileinfo/CREDITS
-rw-r--r-- root/root      3466 2008-09-20 10:09 ./usr/share/doc/php5-fileinfo/copyright
-rw-r--r-- root/root       159 2008-09-20 10:09 ./usr/share/doc/php5-fileinfo/changelog.Debian.gz
-rw-r--r-- root/root       865 2005-11-24 23:07 ./usr/share/doc/php5-fileinfo/fileinfo.php
-rw-r--r-- root/root       149 2008-09-20 10:10 ./usr/share/doc/php5-fileinfo/changelog.gz</pre>
<p>and its metadata :</p>
<pre><strong># dpkg -I ../php5-fileinfo_1.0.4-1_i386.deb</strong>
 new debian package, version 2.0.
 size 12740 bytes: control archive= 4848 bytes.
     940 bytes,    31 lines   *  config               #!/bin/sh
     607 bytes,    20 lines      control
     522 bytes,     7 lines      md5sums
    1218 bytes,    58 lines   *  postinst             #!/bin/sh
     206 bytes,     8 lines   *  postrm               #!/bin/sh
    1773 bytes,    63 lines   *  prerm                #!/bin/sh
    8758 bytes,    67 lines      templates
 Package: php5-fileinfo
 Version: 1.0.4-1
 Section: web
 Priority: optional
 Architecture: i386
 Depends: libc6 (&gt;= 2.3.6-6), libmagic1, debconf (&gt;= 0.5) | debconf-2.0, php5 | php5-cli
 Installed-Size: 100
 Maintainer: Guillaume Plessis
 Source: php-fileinfo
 Description: Fileinfo module for PHP 5
  libmagic bindings
  .
  This extension allows retrieval of information regarding vast
  majority of file.
  This information may include dimensions, quality, length etc...
  .
  Additionally it can also be used to retrieve the mime type for a
  particular
  file and for text files proper language encoding.
  .</pre>
<p>Great job! Now install the package and enjoy&#8230;</p>
<p>For more information and specific needs, take a look at &#8220;<em>dh-make-pecl</em>&#8221; and &#8220;<em>man dh-make-pecl</em>&#8220;.</p>
 <p>Feel free to Flattr this post at <a href="http://flattr.com/" title="Flattr" target="_blank">flattr.com</a>, if you like it.</p> <p><a href="http://flattr.com/" title="Flattr" target="_blank"><img src="http://www.dotdeb.org/wp-content/plugins/flattrss/button-compact-static-100x17.png" alt="flattr this!"/></a></p><div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.dotdeb.org/2008/09/25/how-to-package-php-extensions-by-yourself/&via=dotdeb&text=How to package PHP extensions by yourself&related=w_a_s_t_e:Dotdeb's maintainer&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.dotdeb.org/2008/09/25/how-to-package-php-extensions-by-yourself/&via=dotdeb&text=How to package PHP extensions by yourself&related=w_a_s_t_e:Dotdeb's maintainer&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>]]></content:encoded>
			<wfw:commentRss>http://www.dotdeb.org/2008/09/25/how-to-package-php-extensions-by-yourself/feed/</wfw:commentRss>
		<slash:comments>30</slash:comments>
		</item>
		<item>
		<title>How to bind your Qmail server to a specific IP address</title>
		<link>http://www.dotdeb.org/2008/08/27/how-to-bind-your-qmail-server-to-a-specific-ip-address/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=how-to-bind-your-qmail-server-to-a-specific-ip-address</link>
		<comments>http://www.dotdeb.org/2008/08/27/how-to-bind-your-qmail-server-to-a-specific-ip-address/#comments</comments>
		<pubDate>Wed, 27 Aug 2008 13:04:43 +0000</pubDate>
		<dc:creator>Guillaume Plessis</dc:creator>
				<category><![CDATA[Documentation]]></category>
		<category><![CDATA[Mail]]></category>
		<category><![CDATA[qmail]]></category>

		<guid isPermaLink="false">http://www.dotdeb.org/?p=106</guid>
		<description><![CDATA[Just a little tip :

By default, Qmail listens to all [...]]]></description>
			<content:encoded><![CDATA[<p>Just a little tip :</p>
<p>By default, Qmail listens to all the available IP address on the machine (0.0.0.0). It is possible to change this behaviour to bind Qmail to a specific IP.</p>
<p>We suppose that you are using Qmail from Dotdeb and launching it using the provided init script, <em>/etc/init.d/qmail</em>. Just edit it and change these lines :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">          <span style="color: #c20cb9; font-weight: bold;">sh</span> <span style="color: #660033;">-c</span> <span style="color: #ff0000;">&quot;start-stop-daemon --start --quiet --user qmaild <span style="color: #000099; font-weight: bold;">\
</span>          --pidfile /var/run/tcpserver_smtpd.pid --make-pidfile <span style="color: #000099; font-weight: bold;">\
</span>          --exec /usr/bin/tcpserver -- -H -P -R -l 0 <span style="color: #000099; font-weight: bold;">\
</span>          -u <span style="color: #780078;">`id -u qmaild`</span> -g <span style="color: #780078;">`id -g nobody`</span> -x /etc/tcp.smtp.cdb 0 smtp <span style="color: #000099; font-weight: bold;">\
</span>          <span style="color: #007800;">$rblsmtpd</span> /usr/sbin/qmail-smtpd 2&amp;gt;&amp;amp;1 <span style="color: #000099; font-weight: bold;">\
</span>          | <span style="color: #007800;">$logger</span> &amp;amp;&quot;</span></pre></div></div>

<p>by those ones :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">          <span style="color: #c20cb9; font-weight: bold;">sh</span> <span style="color: #660033;">-c</span> <span style="color: #ff0000;">&quot;start-stop-daemon --start --quiet --user qmaild <span style="color: #000099; font-weight: bold;">\
</span>          --pidfile /var/run/tcpserver_smtpd.pid --make-pidfile <span style="color: #000099; font-weight: bold;">\
</span>          --exec /usr/bin/tcpserver -- -H -P -R -l 0 <span style="color: #000099; font-weight: bold;">\
</span>          -u <span style="color: #780078;">`id -u qmaild`</span> -g <span style="color: #780078;">`id -g nobody`</span> -x /etc/tcp.smtp.cdb xxx.xxx.xxx.xxx smtp <span style="color: #000099; font-weight: bold;">\
</span>          <span style="color: #007800;">$rblsmtpd</span> /usr/sbin/qmail-smtpd 2&amp;gt;&amp;amp;1 <span style="color: #000099; font-weight: bold;">\
</span>          | <span style="color: #007800;">$logger</span> &amp;amp;&quot;</span></pre></div></div>

<p>(Just replace xxx.xxx.xxx.xxx by your IP address)</p>
<p>Now, when you list your listening dameon, you should see tcpserver listening to xxx.xxx.xxx.xxx:25 instead of 0.0.0.0:25.</p>
<pre>machine# netstat -apn
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 <strong>xxx.xxx.xxx.xxx</strong>:25      0.0.0.0:*               LISTEN      21175/tcpserver</pre>
<script type="text/javascript">
var flattr_wp_ver = '0.9.14';
var flattr_uid = '13101';
var flattr_url = 'http://www.dotdeb.org';
var flattr_lng = 'en_GB';
var flattr_cat = 'text';
var flattr_tag = 'blog,wordpress,rss,feed';
var flattr_btn = 'large';
var flattr_tle = 'Dotdeb';
var flattr_dsc = 'The repository for Debian-based LAMP servers';
</script>
<script src="https://api.flattr.com/js/0.5.0/load.js?mode=auto" type="text/javascript"></script> <p>Feel free to Flattr this post at <a href="http://flattr.com/" title="Flattr" target="_blank">flattr.com</a>, if you like it.</p> <p><a href="http://flattr.com/" title="Flattr" target="_blank"><img src="http://www.dotdeb.org/wp-content/plugins/flattrss/button-compact-static-100x17.png" alt="flattr this!"/></a></p><div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.dotdeb.org/2008/08/27/how-to-bind-your-qmail-server-to-a-specific-ip-address/&via=dotdeb&text=How to bind your Qmail server to a specific IP address&related=w_a_s_t_e:Dotdeb's maintainer&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.dotdeb.org/2008/08/27/how-to-bind-your-qmail-server-to-a-specific-ip-address/&via=dotdeb&text=How to bind your Qmail server to a specific IP address&related=w_a_s_t_e:Dotdeb's maintainer&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>]]></content:encoded>
			<wfw:commentRss>http://www.dotdeb.org/2008/08/27/how-to-bind-your-qmail-server-to-a-specific-ip-address/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using the Google Perftools to speed up your MySQL server</title>
		<link>http://www.dotdeb.org/2008/08/25/using-the-google-perftools-to-speed-up-your-mysql-server/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=using-the-google-perftools-to-speed-up-your-mysql-server</link>
		<comments>http://www.dotdeb.org/2008/08/25/using-the-google-perftools-to-speed-up-your-mysql-server/#comments</comments>
		<pubDate>Mon, 25 Aug 2008 15:13:44 +0000</pubDate>
		<dc:creator>Guillaume Plessis</dc:creator>
				<category><![CDATA[Documentation]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[google-perftools]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://www.dotdeb.org/?p=99</guid>
		<description><![CDATA[The Google Perftools, especially tcmalloc (Thread Cachi [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://goog-perftools.sourceforge.net/">Google Perftools</a>, especially <a href="http://goog-perftools.sourceforge.net/doc/tcmalloc.html">tcmalloc</a> (Thread Caching Malloc), can be very useful to speed up your applications, depending on your environment :</p>
<blockquote><p>TCMalloc is faster than the glibc 2.3 malloc (available as a separate library called ptmalloc2) and other mallocs that I have tested. ptmalloc2 takes approximately 300 nanoseconds to execute a malloc/free pair on a 2.8 GHz P4 (for small objects). The TCMalloc implementation takes approximately 50 nanoseconds for the same operation pair.</p></blockquote>
<p>Its deployment in your LAMP stack can speed up your MySQL servers, since it enhances memory allocation on threaded applications with the downside of larger memory footprints.</p>
<p>Here is how to use it easily&#8230;</p>
<p><strong>Installation</strong></p>
<p>First of all, be sure you use Debian 5.0 (a.k.a. &#8220;Lenny&#8221;) or later. Then install the minimal tcmalloc library from Dotdeb :</p>

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

<p>Then, since the mainstream MySQL packages are not compiled against tcmalloc, you&#8217;ll have to trick your OS&#8217; dynamic linker by adding the following line at the top of your <em>/etc/init.d/mysql</em> init script :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">LD_PRELOAD</span>=<span style="color: #ff0000;">&quot;/usr/lib/libtcmalloc_minimal.so.0&quot;</span></pre></div></div>

<p><img class="aligncenter size-full wp-image-285" title="/etc/init.d/mysql modification" src="http://www.dotdeb.org/wp-content/uploads/2008/08/Capture-d’écran-2009-10-03-à-12.59.48.png" alt="/etc/init.d/mysql modification" width="468" height="193" /></p>
<p>After relauching your MySQL server using the modified init script, you&#8217;ll take profit from tcmalloc&#8217;s faster memory allocation.</p>
<p><strong>Results</strong></p>
<p>At the time of writing this article, I didn&#8217;t make benchmarks, but some reported that they had a ~15-20% performance gain. Please leave comments about your experience.</p>
 <p>Feel free to Flattr this post at <a href="http://flattr.com/" title="Flattr" target="_blank">flattr.com</a>, if you like it.</p> <p><a href="http://flattr.com/" title="Flattr" target="_blank"><img src="http://www.dotdeb.org/wp-content/plugins/flattrss/button-compact-static-100x17.png" alt="flattr this!"/></a></p><div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.dotdeb.org/2008/08/25/using-the-google-perftools-to-speed-up-your-mysql-server/&via=dotdeb&text=Using the Google Perftools to speed up your MySQL server&related=w_a_s_t_e:Dotdeb's maintainer&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.dotdeb.org/2008/08/25/using-the-google-perftools-to-speed-up-your-mysql-server/&via=dotdeb&text=Using the Google Perftools to speed up your MySQL server&related=w_a_s_t_e:Dotdeb's maintainer&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>]]></content:encoded>
			<wfw:commentRss>http://www.dotdeb.org/2008/08/25/using-the-google-perftools-to-speed-up-your-mysql-server/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Mirroring Dotdeb</title>
		<link>http://www.dotdeb.org/2008/08/25/mirroring-dotdeb/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=mirroring-dotdeb</link>
		<comments>http://www.dotdeb.org/2008/08/25/mirroring-dotdeb/#comments</comments>
		<pubDate>Mon, 25 Aug 2008 09:36:35 +0000</pubDate>
		<dc:creator>Guillaume Plessis</dc:creator>
				<category><![CDATA[Documentation]]></category>
		<category><![CDATA[dotdeb]]></category>

		<guid isPermaLink="false">http://www.dotdeb.org/?p=89</guid>
		<description><![CDATA[If Dotdeb is useful for you and if you want to mirror i [...]]]></description>
			<content:encoded><![CDATA[<p>If Dotdeb is useful for you and if you want to mirror it, just add a cron job to periodically fetch the packages :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">rsync <span style="color: #660033;">-a</span> <span style="color: #660033;">--delete</span> rsync.dotdeb.org::packages<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000; font-weight: bold;">/</span>your<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>path<span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

<p>Then, if you wish your mirror to appear on the <a href="http://www.dotdeb.org/mirrors/">mirrors list</a>, send <a href="mailto:gui_at_php_dot_net">me</a> its full URL.</p>
<p><span style="text-decoration: underline;">Note 1 :</span> mirroring once a day should be enough. <span style="color: #ff0000;">More frequent updates could lead to a ban without any warning</span>.<br />
<span style="text-decoration: underline;">Note 2 :</span> Using anything else than Rsync (Wget, HTTrack&#8230;) <span style="color: #ff0000;">could lead to a ban without any warning</span>.</p>
<script type="text/javascript">
var flattr_wp_ver = '0.9.14';
var flattr_uid = '13101';
var flattr_url = 'http://www.dotdeb.org';
var flattr_lng = 'en_GB';
var flattr_cat = 'text';
var flattr_tag = 'blog,wordpress,rss,feed';
var flattr_btn = 'large';
var flattr_tle = 'Dotdeb';
var flattr_dsc = 'The repository for Debian-based LAMP servers';
</script>
<script src="https://api.flattr.com/js/0.5.0/load.js?mode=auto" type="text/javascript"></script> <p>Feel free to Flattr this post at <a href="http://flattr.com/" title="Flattr" target="_blank">flattr.com</a>, if you like it.</p> <p><a href="http://flattr.com/" title="Flattr" target="_blank"><img src="http://www.dotdeb.org/wp-content/plugins/flattrss/button-compact-static-100x17.png" alt="flattr this!"/></a></p><div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.dotdeb.org/2008/08/25/mirroring-dotdeb/&via=dotdeb&text=Mirroring Dotdeb&related=w_a_s_t_e:Dotdeb's maintainer&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.dotdeb.org/2008/08/25/mirroring-dotdeb/&via=dotdeb&text=Mirroring Dotdeb&related=w_a_s_t_e:Dotdeb's maintainer&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>]]></content:encoded>
			<wfw:commentRss>http://www.dotdeb.org/2008/08/25/mirroring-dotdeb/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>Storing your PHP sessions using memcached</title>
		<link>http://www.dotdeb.org/2008/08/25/storing-your-php-sessions-using-memcached/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=storing-your-php-sessions-using-memcached</link>
		<comments>http://www.dotdeb.org/2008/08/25/storing-your-php-sessions-using-memcached/#comments</comments>
		<pubDate>Mon, 25 Aug 2008 09:02:46 +0000</pubDate>
		<dc:creator>Guillaume Plessis</dc:creator>
				<category><![CDATA[Documentation]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[memcached]]></category>

		<guid isPermaLink="false">http://www.dotdeb.org/?p=85</guid>
		<description><![CDATA[Using PHP sessions can be a problem when your PHP appli [...]]]></description>
			<content:encoded><![CDATA[<p>Using PHP sessions can be a problem when your PHP applications are load-balanced on many web servers. You can store them on a NFS export or recode the <a href="http://www.php.net/manual/en/function.session-set-save-handler.php">session_set_save_handler</a> using a SQL backend for example. But there is no solution more efficient, more scalable, more performant and easier to deploy than using memcached&#8230;</p>
<blockquote><p><a href="http://www.danga.com/memcached/">Memcached</a> is a high-performance, distributed memory object caching system, generic in nature, but intended for use in speeding up dynamic web applications by alleviating database load&#8230;</p></blockquote>
<p>Many well-known huge architecture (Facebook, Livejournal, Youtube&#8230;) are using it as memory caching to reduce the load on their servers. It can also be used to share PHP sessions among several servers. Let&#8217;s see how&#8230;</p>
<p><strong>Installation</strong></p>
<p>The first thing is to install the memcached server on your Debian server :</p>

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

<p>Then, since the <a href="http://pecl.php.net/package/memcache">memcache PECL extension</a> now provides its own session handler, it&#8217;s easy to plug PHP and memcached servers. Just install the appropriate extension (from Dotdeb) :</p>

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

<p>and change some of your PHP settings :</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;">session.save_handler <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> files</span>
<span style="color: #666666; font-style: italic;">; session.save_path = &quot;N;/path&quot;</span></pre></div></div>

<p>to :</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;">session.save_handler <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> memcache</span>
<span style="color: #666666; font-style: italic;">; change server:port to fit your needs...</span>
session.save_path<span style="color: #000066; font-weight:bold;">=</span><span style="color: #933;">&quot;tcp://server:port?persistent=1&amp;amp;weight=1&amp;amp;timeout=1&amp;amp;retry_interval=15&quot;</span></pre></div></div>

<p>That&#8217;s all! After relaunching your Apache2 server, your PHP sessions will be stored on the memcached server.</p>
 <p>Feel free to Flattr this post at <a href="http://flattr.com/" title="Flattr" target="_blank">flattr.com</a>, if you like it.</p> <p><a href="http://flattr.com/" title="Flattr" target="_blank"><img src="http://www.dotdeb.org/wp-content/plugins/flattrss/button-compact-static-100x17.png" alt="flattr this!"/></a></p><div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.dotdeb.org/2008/08/25/storing-your-php-sessions-using-memcached/&via=dotdeb&text=Storing your PHP sessions using memcached&related=w_a_s_t_e:Dotdeb's maintainer&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.dotdeb.org/2008/08/25/storing-your-php-sessions-using-memcached/&via=dotdeb&text=Storing your PHP sessions using memcached&related=w_a_s_t_e:Dotdeb's maintainer&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>]]></content:encoded>
			<wfw:commentRss>http://www.dotdeb.org/2008/08/25/storing-your-php-sessions-using-memcached/feed/</wfw:commentRss>
		<slash:comments>35</slash:comments>
		</item>
		<item>
		<title>How to enable greylisting on your Qmail server</title>
		<link>http://www.dotdeb.org/2008/08/24/how-to-enable-greylisting-on-your-qmail-server/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=how-to-enable-greylisting-on-your-qmail-server</link>
		<comments>http://www.dotdeb.org/2008/08/24/how-to-enable-greylisting-on-your-qmail-server/#comments</comments>
		<pubDate>Sun, 24 Aug 2008 18:26:52 +0000</pubDate>
		<dc:creator>Guillaume Plessis</dc:creator>
				<category><![CDATA[Documentation]]></category>
		<category><![CDATA[Mail]]></category>
		<category><![CDATA[greylisting]]></category>
		<category><![CDATA[qmail]]></category>
		<category><![CDATA[spam]]></category>

		<guid isPermaLink="false">http://www.dotdeb.org/?p=75</guid>
		<description><![CDATA[Greylisting is very useful to avoid most of the incomin [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://en.wikipedia.org/wiki/Greylisting">Greylisting</a> is very useful to avoid most of the incoming spam on your mail server. The Qmail packages shipped on Dotdeb have built-in MySQL-based greylisting. Here is how to enable it&#8230;</p>
<p><strong>Installation</strong></p>
<p>First of all, be sure to have Qmail installed from Dotdeb with a version number greater than 1.03-37.dotdeb.1.<br />
Then, since we&#8217;ll use a MySQL backend to share the greylisting database between several servers, be sure to have MySQL installed somewhere on your boxes.</p>
<p>In our example, we&#8217;ll create the database (we&#8217;ll name it <strong>relaydelay</strong>) and grant access to <strong>user</strong>@<strong>host</strong> with the password &#8220;<strong>password</strong>&#8220;. You&#8217;re free to change these values to fit your needs&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="mysql" style="font-family:monospace;"><span style="color: #990099; font-weight: bold;">CREATE</span> <span style="color: #990099; font-weight: bold;">DATABASE</span> relaydelay<span style="color: #000033;">;</span>
<span style="color: #990099; font-weight: bold;">GRANT</span> <span style="color: #990099; font-weight: bold;">ALL</span> <span style="color: #990099; font-weight: bold;">PRIVILEGES</span> <span style="color: #990099; font-weight: bold;">ON</span> <span style="color: #008000;">`relaydelay`</span>.<span style="color: #CC0099;">*</span> <span style="color: #990099; font-weight: bold;">TO</span> <span style="color: #008000;">'user'</span>@<span style="color: #008000;">'localhost'</span> IDENTIFIED BY <span style="color: #008000;">'password'</span><span style="color: #000033;">;</span></pre></div></div>

<p>Then, we create the needed tables :</p>

<div class="wp_syntax"><div class="code"><pre class="mysql" style="font-family:monospace;"><span style="color: #990099; font-weight: bold;">CREATE</span> <span style="color: #990099; font-weight: bold;">TABLE</span> relaytofrom
<span style="color: #FF00FF;">&#40;</span>
  id              <span style="color: #999900; font-weight: bold;">bigint</span>          <span style="color: #CC0099; font-weight: bold;">NOT</span> <span style="color: #9900FF; font-weight: bold;">NULL</span>        <span style="color: #FF9900; font-weight: bold;">auto_increment</span><span style="color: #000033;">,</span>
  relay_ip        <span style="color: #000099;">char</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">16</span><span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">,</span>
  mail_from       <span style="color: #999900; font-weight: bold;">varchar</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">255</span><span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">,</span>
  rcpt_to         <span style="color: #999900; font-weight: bold;">varchar</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">255</span><span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">,</span>
  block_expires   <span style="color: #999900; font-weight: bold;">datetime</span>        <span style="color: #CC0099; font-weight: bold;">NOT</span> <span style="color: #9900FF; font-weight: bold;">NULL</span><span style="color: #000033;">,</span>
&nbsp;
  record_expires  <span style="color: #999900; font-weight: bold;">datetime</span>        <span style="color: #CC0099; font-weight: bold;">NOT</span> <span style="color: #9900FF; font-weight: bold;">NULL</span><span style="color: #000033;">,</span>
  blocked_count   <span style="color: #999900; font-weight: bold;">bigint</span>          <span style="color: #990099; font-weight: bold;">default</span> <span style="color: #008080;">0</span> <span style="color: #CC0099; font-weight: bold;">NOT</span> <span style="color: #9900FF; font-weight: bold;">NULL</span><span style="color: #000033;">,</span>
  passed_count    <span style="color: #999900; font-weight: bold;">bigint</span>          <span style="color: #990099; font-weight: bold;">default</span> <span style="color: #008080;">0</span> <span style="color: #CC0099; font-weight: bold;">NOT</span> <span style="color: #9900FF; font-weight: bold;">NULL</span><span style="color: #000033;">,</span>
  aborted_count   <span style="color: #999900; font-weight: bold;">bigint</span>          <span style="color: #990099; font-weight: bold;">default</span> <span style="color: #008080;">0</span> <span style="color: #CC0099; font-weight: bold;">NOT</span> <span style="color: #9900FF; font-weight: bold;">NULL</span><span style="color: #000033;">,</span>
  origin_type     <span style="color: #999900; font-weight: bold;">enum</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008000;">&quot;MANUAL&quot;</span><span style="color: #000033;">,</span><span style="color: #008000;">&quot;AUTO&quot;</span><span style="color: #FF00FF;">&#41;</span> <span style="color: #CC0099; font-weight: bold;">NOT</span> <span style="color: #9900FF; font-weight: bold;">NULL</span><span style="color: #000033;">,</span>
  create_time     <span style="color: #999900; font-weight: bold;">datetime</span>        <span style="color: #CC0099; font-weight: bold;">NOT</span> <span style="color: #9900FF; font-weight: bold;">NULL</span><span style="color: #000033;">,</span>
  last_update     <span style="color: #999900; font-weight: bold;">timestamp</span>       <span style="color: #CC0099; font-weight: bold;">NOT</span> <span style="color: #9900FF; font-weight: bold;">NULL</span><span style="color: #000033;">,</span>
&nbsp;
  <span style="color: #990099; font-weight: bold;">primary key</span><span style="color: #FF00FF;">&#40;</span>id<span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">,</span>
  <span style="color: #990099; font-weight: bold;">key</span><span style="color: #FF00FF;">&#40;</span>relay_ip<span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">,</span>
  <span style="color: #990099; font-weight: bold;">key</span><span style="color: #FF00FF;">&#40;</span>mail_from<span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">20</span><span style="color: #FF00FF;">&#41;</span><span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">,</span>
  <span style="color: #990099; font-weight: bold;">key</span><span style="color: #FF00FF;">&#40;</span>rcpt_to<span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">20</span><span style="color: #FF00FF;">&#41;</span><span style="color: #FF00FF;">&#41;</span>
<span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">;</span>
&nbsp;
<span style="color: #990099; font-weight: bold;">CREATE</span> <span style="color: #990099; font-weight: bold;">TABLE</span> dns_name
<span style="color: #FF00FF;">&#40;</span>
  relay_ip      <span style="color: #999900; font-weight: bold;">varchar</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">18</span><span style="color: #FF00FF;">&#41;</span>       <span style="color: #CC0099; font-weight: bold;">NOT</span> <span style="color: #9900FF; font-weight: bold;">NULL</span><span style="color: #000033;">,</span>
  relay_name    <span style="color: #999900; font-weight: bold;">varchar</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">255</span><span style="color: #FF00FF;">&#41;</span>      <span style="color: #CC0099; font-weight: bold;">NOT</span> <span style="color: #9900FF; font-weight: bold;">NULL</span><span style="color: #000033;">,</span>
  last_update   <span style="color: #999900; font-weight: bold;">timestamp</span>         <span style="color: #CC0099; font-weight: bold;">NOT</span> <span style="color: #9900FF; font-weight: bold;">NULL</span><span style="color: #000033;">,</span>
  <span style="color: #990099; font-weight: bold;">primary key</span><span style="color: #FF00FF;">&#40;</span>relay_ip<span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">,</span>
  <span style="color: #990099; font-weight: bold;">key</span><span style="color: #FF00FF;">&#40;</span>relay_name<span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">20</span><span style="color: #FF00FF;">&#41;</span><span style="color: #FF00FF;">&#41;</span>
<span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">;</span>
&nbsp;
<span style="color: #990099; font-weight: bold;">CREATE</span> <span style="color: #990099; font-weight: bold;">TABLE</span> mail_log
<span style="color: #FF00FF;">&#40;</span>
  id              <span style="color: #999900; font-weight: bold;">bigint</span>          <span style="color: #CC0099; font-weight: bold;">NOT</span> <span style="color: #9900FF; font-weight: bold;">NULL</span>        <span style="color: #FF9900; font-weight: bold;">auto_increment</span><span style="color: #000033;">,</span>
  relay_ip        <span style="color: #999900; font-weight: bold;">varchar</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">16</span><span style="color: #FF00FF;">&#41;</span>     <span style="color: #CC0099; font-weight: bold;">NOT</span> <span style="color: #9900FF; font-weight: bold;">NULL</span><span style="color: #000033;">,</span>
  relay_name      <span style="color: #999900; font-weight: bold;">varchar</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">255</span><span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">,</span>
  dns_mismatch    <span style="color: #999900; font-weight: bold;">bool</span>            <span style="color: #CC0099; font-weight: bold;">NOT</span> <span style="color: #9900FF; font-weight: bold;">NULL</span><span style="color: #000033;">,</span>
  mail_from       <span style="color: #999900; font-weight: bold;">varchar</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">255</span><span style="color: #FF00FF;">&#41;</span>    <span style="color: #CC0099; font-weight: bold;">NOT</span> <span style="color: #9900FF; font-weight: bold;">NULL</span><span style="color: #000033;">,</span>
  rcpt_to         <span style="color: #999900; font-weight: bold;">varchar</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">255</span><span style="color: #FF00FF;">&#41;</span>    <span style="color: #CC0099; font-weight: bold;">NOT</span> <span style="color: #9900FF; font-weight: bold;">NULL</span><span style="color: #000033;">,</span>
  rcpt_host       <span style="color: #999900; font-weight: bold;">varchar</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">80</span><span style="color: #FF00FF;">&#41;</span>     <span style="color: #CC0099; font-weight: bold;">NOT</span> <span style="color: #9900FF; font-weight: bold;">NULL</span><span style="color: #000033;">,</span>
  create_time     <span style="color: #999900; font-weight: bold;">datetime</span>        <span style="color: #CC0099; font-weight: bold;">NOT</span> <span style="color: #9900FF; font-weight: bold;">NULL</span><span style="color: #000033;">,</span>
&nbsp;
  <span style="color: #990099; font-weight: bold;">primary key</span><span style="color: #FF00FF;">&#40;</span>id<span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">,</span>
  <span style="color: #990099; font-weight: bold;">key</span><span style="color: #FF00FF;">&#40;</span>relay_ip<span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">,</span>
  <span style="color: #990099; font-weight: bold;">key</span><span style="color: #FF00FF;">&#40;</span>mail_from<span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">20</span><span style="color: #FF00FF;">&#41;</span><span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">,</span>
  <span style="color: #990099; font-weight: bold;">key</span><span style="color: #FF00FF;">&#40;</span>rcpt_to<span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">20</span><span style="color: #FF00FF;">&#41;</span><span style="color: #FF00FF;">&#41;</span>
<span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">;</span></pre></div></div>

<p>We now have to put the appropriate settings in the <em>/etc/init.d/qmail</em> init script&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">MYSQLHOST</span>=<span style="color: #ff0000;">&quot;localhost&quot;</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">MYSQLUSER</span>=<span style="color: #ff0000;">&quot;user&quot;</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">MYSQLPASS</span>=<span style="color: #ff0000;">&quot;password&quot;</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">MYSQLDB</span>=<span style="color: #ff0000;">&quot;relaydelay&quot;</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">BLOCK_EXPIRE</span>=<span style="color: #000000;">5</span>           <span style="color: #666666; font-style: italic;"># minutes until email is accepted</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">RECORD_EXPIRE</span>=<span style="color: #000000;">600</span>        <span style="color: #666666; font-style: italic;"># minutes until record expires</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">RECORD_EXPIRE_GOOD</span>=<span style="color: #000000;">36</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">LOCAL_SCAN_DEBUG</span>=<span style="color: #000000;">0</span></pre></div></div>

<p>and in the <em>/usr/sbin/greylisting-delete-expired</em> :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">MYSQLHOST</span>=<span style="color: #ff0000;">&quot;localhost&quot;</span>
<span style="color: #007800;">MYSQLUSER</span>=<span style="color: #ff0000;">&quot;user&quot;</span>
<span style="color: #007800;">MYSQLPASS</span>=<span style="color: #ff0000;">&quot;password&quot;</span>
<span style="color: #007800;">MYSQLDB</span>=<span style="color: #ff0000;">&quot;relaydelay&quot;</span></pre></div></div>

<p>We can now relaunch Qmail and enable or disable the greylisting with a simple symbolic link :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><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>qmail
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>qmail-envelope-scanner <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>qmail-envelope-scanner</pre></div></div>

<p><strong>Usage</strong></p>
<p>Example wildcard whitelists for subnets :</p>

<div class="wp_syntax"><div class="code"><pre class="mysql" style="font-family:monospace;"><span style="color: #990099; font-weight: bold;">INSERT</span> <span style="color: #990099; font-weight: bold;">INTO</span> relaytofrom <span style="color: #990099; font-weight: bold;">VALUES</span> <span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">0</span><span style="color: #000033;">,</span><span style="color: #008000;">&quot;127.0.0.1&quot;</span>   <span style="color: #000033;">,</span><span style="color: #9900FF; font-weight: bold;">NULL</span><span style="color: #000033;">,</span><span style="color: #9900FF; font-weight: bold;">NULL</span><span style="color: #000033;">,</span><span style="color: #008000;">&quot;0000-00-00 00:00:00&quot;</span><span style="color: #000033;">,</span><span style="color: #008000;">&quot;9999-12-31 23:59:59&quot;</span><span style="color: #000033;">,</span><span style="color: #008080;">0</span><span style="color: #000033;">,</span><span style="color: #008080;">0</span><span style="color: #000033;">,</span><span style="color: #008080;">0</span><span style="color: #000033;">,</span><span style="color: #008000;">&quot;MANUAL&quot;</span><span style="color: #000033;">,</span><span style="color: #000099;">NOW</span><span style="color: #FF00FF;">&#40;</span><span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">,</span><span style="color: #000099;">NOW</span><span style="color: #FF00FF;">&#40;</span><span style="color: #FF00FF;">&#41;</span><span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">;</span>
<span style="color: #990099; font-weight: bold;">INSERT</span> <span style="color: #990099; font-weight: bold;">INTO</span> relaytofrom <span style="color: #990099; font-weight: bold;">VALUES</span> <span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">0</span><span style="color: #000033;">,</span><span style="color: #008000;">&quot;192.168&quot;</span>     <span style="color: #000033;">,</span><span style="color: #9900FF; font-weight: bold;">NULL</span><span style="color: #000033;">,</span><span style="color: #9900FF; font-weight: bold;">NULL</span><span style="color: #000033;">,</span><span style="color: #008000;">&quot;0000-00-00 00:00:00&quot;</span><span style="color: #000033;">,</span><span style="color: #008000;">&quot;9999-12-31 23:59:59&quot;</span><span style="color: #000033;">,</span><span style="color: #008080;">0</span><span style="color: #000033;">,</span><span style="color: #008080;">0</span><span style="color: #000033;">,</span><span style="color: #008080;">0</span><span style="color: #000033;">,</span><span style="color: #008000;">&quot;MANUAL&quot;</span><span style="color: #000033;">,</span><span style="color: #000099;">NOW</span><span style="color: #FF00FF;">&#40;</span><span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">,</span><span style="color: #000099;">NOW</span><span style="color: #FF00FF;">&#40;</span><span style="color: #FF00FF;">&#41;</span><span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">;</span></pre></div></div>

<p>Example wildcard whitelist entry for a recieved domain or subdomain</p>

<div class="wp_syntax"><div class="code"><pre class="mysql" style="font-family:monospace;"><span style="color: #990099; font-weight: bold;">INSERT</span> <span style="color: #990099; font-weight: bold;">INTO</span> relaytofrom <span style="color: #990099; font-weight: bold;">VALUES</span> <span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">0</span><span style="color: #000033;">,</span><span style="color: #9900FF; font-weight: bold;">NULL</span><span style="color: #000033;">,</span><span style="color: #9900FF; font-weight: bold;">NULL</span><span style="color: #000033;">,</span><span style="color: #008000;">&quot;sub.domain.com&quot;</span><span style="color: #000033;">,</span><span style="color: #008000;">&quot;0000-00-00 00:00:00&quot;</span><span style="color: #000033;">,</span><span style="color: #008000;">&quot;9999-12-31 23:59:59&quot;</span><span style="color: #000033;">,</span><span style="color: #008080;">0</span><span style="color: #000033;">,</span><span style="color: #008080;">0</span><span style="color: #000033;">,</span><span style="color: #008080;">0</span><span style="color: #000033;">,</span><span style="color: #008000;">&quot;MANUAL&quot;</span><span style="color: #000033;">,</span><span style="color: #000099;">NOW</span><span style="color: #FF00FF;">&#40;</span><span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">,</span><span style="color: #000099;">NOW</span><span style="color: #FF00FF;">&#40;</span><span style="color: #FF00FF;">&#41;</span><span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">;</span></pre></div></div>

<script type="text/javascript">
var flattr_wp_ver = '0.9.14';
var flattr_uid = '13101';
var flattr_url = 'http://www.dotdeb.org';
var flattr_lng = 'en_GB';
var flattr_cat = 'text';
var flattr_tag = 'blog,wordpress,rss,feed';
var flattr_btn = 'large';
var flattr_tle = 'Dotdeb';
var flattr_dsc = 'The repository for Debian-based LAMP servers';
</script>
<script src="https://api.flattr.com/js/0.5.0/load.js?mode=auto" type="text/javascript"></script> <p>Feel free to Flattr this post at <a href="http://flattr.com/" title="Flattr" target="_blank">flattr.com</a>, if you like it.</p> <p><a href="http://flattr.com/" title="Flattr" target="_blank"><img src="http://www.dotdeb.org/wp-content/plugins/flattrss/button-compact-static-100x17.png" alt="flattr this!"/></a></p><div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.dotdeb.org/2008/08/24/how-to-enable-greylisting-on-your-qmail-server/&via=dotdeb&text=How to enable greylisting on your Qmail server&related=w_a_s_t_e:Dotdeb's maintainer&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.dotdeb.org/2008/08/24/how-to-enable-greylisting-on-your-qmail-server/&via=dotdeb&text=How to enable greylisting on your Qmail server&related=w_a_s_t_e:Dotdeb's maintainer&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>]]></content:encoded>
			<wfw:commentRss>http://www.dotdeb.org/2008/08/24/how-to-enable-greylisting-on-your-qmail-server/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>How to use PHP5 and PHP4 on the same Apache2 server</title>
		<link>http://www.dotdeb.org/2008/08/24/how-to-use-php5-and-php4-on-the-same-apache2-server/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=how-to-use-php5-and-php4-on-the-same-apache2-server</link>
		<comments>http://www.dotdeb.org/2008/08/24/how-to-use-php5-and-php4-on-the-same-apache2-server/#comments</comments>
		<pubDate>Sun, 24 Aug 2008 13:38:57 +0000</pubDate>
		<dc:creator>Guillaume Plessis</dc:creator>
				<category><![CDATA[Documentation]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[apache]]></category>

		<guid isPermaLink="false">http://www.dotdeb.org/?p=69</guid>
		<description><![CDATA[Since PHP4 is officially dead, it is now urgent to migr [...]]]></description>
			<content:encoded><![CDATA[<p>Since PHP4 is <a href="http://www.php.net/archive/2008.php#id2008-08-07-1">officially dead</a>, it is now urgent to migrate your applications to PHP5, but <a href="http://www.php.net/manual/en/migration5.php">it&#8217;s not that easy</a> and you&#8217;ll have to test them before replacing PHP4 by PHP5 on your server. This article will help you to install both PHP4 and PHP5 on your box and swicth easily between them&#8230;</p>
<p><strong>The problem</strong></p>
<p>It is <strong>not</strong> possible to enable both PHP4 and PHP5 Apache2 modules on the same webserver, it causes shared objects collision. Then, the idea is to enable PHP5 as Apache2 module on one side and PHP4 as CGI on the other side.</p>
<p>Please note that this solution is not a good idea anywhere else but on developpement servers and should be temporary because of the performance and security issues of PHP as CGI.</p>
<p><strong>Installation</strong></p>
<p>First, we have to install the appropriate PHP packages and their dependencies (from Dotdeb, of course) :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> libapache2-mod-php5 php4-cgi</pre></div></div>

<p>Apache2 is now configured by default to parse .php files with the <em>mod_php5</em> module.</p>
<p>But, using <em>mod_actions</em>, we can tell Apache2 to parse .php files with the <em>php4</em> CGI. First, enable <em>mod_actions</em> :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">a2enmod actions
<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>apache2 force-reload</pre></div></div>

<p>Now, by adding the following two lines in a Virtualhost or Directory (&#8230;) context or directly in the main Apache2 configuration file, we&#8217;ll switch from PHP5 to PHP4 :</p>

<div class="wp_syntax"><div class="code"><pre class="apache" style="font-family:monospace;"><span style="color: #00007f;">AddHandler</span> php-<span style="color: #00007f;">script</span> .php
<span style="color: #00007f;">Action</span> php-<span style="color: #00007f;">script</span> /cgi-bin/php4</pre></div></div>

<p>(It could be necessary to reload your apache configuration :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><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>apache2 force-reload</pre></div></div>

<p>)</p>
<p><strong>The result</strong><br />
To check that all works fine, create a file, called <em>phpinfo.php</em>, containing the following code :</p>
<p>Depending on the presence (or not) of the two above magical lines, a HTTP request on the script will show a PHP4 (or PHP5)-typical output.</p>
 <p>Feel free to Flattr this post at <a href="http://flattr.com/" title="Flattr" target="_blank">flattr.com</a>, if you like it.</p> <p><a href="http://flattr.com/" title="Flattr" target="_blank"><img src="http://www.dotdeb.org/wp-content/plugins/flattrss/button-compact-static-100x17.png" alt="flattr this!"/></a></p><div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.dotdeb.org/2008/08/24/how-to-use-php5-and-php4-on-the-same-apache2-server/&via=dotdeb&text=How to use PHP5 and PHP4 on the same Apache2 server&related=w_a_s_t_e:Dotdeb's maintainer&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.dotdeb.org/2008/08/24/how-to-use-php5-and-php4-on-the-same-apache2-server/&via=dotdeb&text=How to use PHP5 and PHP4 on the same Apache2 server&related=w_a_s_t_e:Dotdeb's maintainer&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>]]></content:encoded>
			<wfw:commentRss>http://www.dotdeb.org/2008/08/24/how-to-use-php5-and-php4-on-the-same-apache2-server/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>How to enable the SMTP authentification on your Qmail server</title>
		<link>http://www.dotdeb.org/2008/08/24/howto-enable-the-smtp-authentification-on-your-qmail-server/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=howto-enable-the-smtp-authentification-on-your-qmail-server</link>
		<comments>http://www.dotdeb.org/2008/08/24/howto-enable-the-smtp-authentification-on-your-qmail-server/#comments</comments>
		<pubDate>Sun, 24 Aug 2008 12:44:02 +0000</pubDate>
		<dc:creator>Guillaume Plessis</dc:creator>
				<category><![CDATA[Documentation]]></category>
		<category><![CDATA[Mail]]></category>
		<category><![CDATA[qmail]]></category>
		<category><![CDATA[smtpauth]]></category>

		<guid isPermaLink="false">http://www.dotdeb.org/?p=41</guid>
		<description><![CDATA[The Qmail package from Dotdeb has been built with SMTP- [...]]]></description>
			<content:encoded><![CDATA[<p>The Qmail package from Dotdeb has been built with SMTP-auth features (but disabled by default). Here is the way to use them&#8230;</p>
<p><strong>Installation</strong></p>
<p>First of all, we suppose that :</p>
<ul>
<li>you installed the last Qmail and Vpopmail packages from Dotdeb</li>
<li>you&#8217;re launching them using the bundled init scripts (with tcpserver)</li>
</ul>
<p><strong>Configuration</strong></p>
<p>To enable SMTP-auth, you just have to edit the <em>/etc/init.d/qmail</em> init script and replace these lines :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sh</span> <span style="color: #660033;">-c</span> <span style="color: #ff0000;">&quot;start-stop-daemon --start --quiet --user qmaild
  --pidfile /var/run/tcpserver_smtpd.pid --make-pidfile
  --exec /usr/bin/tcpserver -- -R
  -u <span style="color: #780078;">`id -u qmaild`</span> -g <span style="color: #780078;">`id -g nobody`</span> -x /etc/tcp.smtp.cdb 0 smtp
  <span style="color: #007800;">$rblsmtpd</span> /usr/sbin/qmail-smtpd 2&amp;gt;&amp;amp;1
  | <span style="color: #007800;">$logger</span> &amp;amp;&quot;</span></pre></div></div>

<p>by these ones :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sh</span> <span style="color: #660033;">-c</span> <span style="color: #ff0000;">&quot;start-stop-daemon --start --quiet --user qmaild
    --pidfile /var/run/tcpserver_smtpd.pid --make-pidfile
    --exec /usr/bin/tcpserver -- -R
    -u <span style="color: #780078;">`id -u qmaild`</span> -g <span style="color: #780078;">`id -g nobody`</span> -x /etc/tcp.smtp.cdb 0 smtp
    <span style="color: #007800;">$rblsmtpd</span> /usr/sbin/qmail-smtpd /usr/sbin/vchkpw /bin/true 2&amp;gt;&amp;amp;1
    | <span style="color: #007800;">$logger</span> &amp;amp;&quot;</span></pre></div></div>

<p>Then, we have to setuid <em>/usr/sbin/vchkpw</em> :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">chmod</span> u+s <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>vchkpw</pre></div></div>

<p>and restart Qmail :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><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>qmail stop
<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>qmail start</pre></div></div>

<p><strong>The result</strong></p>
<p>You will now be able to use the SMTP PLAINTEXT authentification. You just have to configure your favorite mail transport agent&#8230;</p>
<script type="text/javascript">
var flattr_wp_ver = '0.9.14';
var flattr_uid = '13101';
var flattr_url = 'http://www.dotdeb.org';
var flattr_lng = 'en_GB';
var flattr_cat = 'text';
var flattr_tag = 'blog,wordpress,rss,feed';
var flattr_btn = 'large';
var flattr_tle = 'Dotdeb';
var flattr_dsc = 'The repository for Debian-based LAMP servers';
</script>
<script src="https://api.flattr.com/js/0.5.0/load.js?mode=auto" type="text/javascript"></script> <p>Feel free to Flattr this post at <a href="http://flattr.com/" title="Flattr" target="_blank">flattr.com</a>, if you like it.</p> <p><a href="http://flattr.com/" title="Flattr" target="_blank"><img src="http://www.dotdeb.org/wp-content/plugins/flattrss/button-compact-static-100x17.png" alt="flattr this!"/></a></p><div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.dotdeb.org/2008/08/24/howto-enable-the-smtp-authentification-on-your-qmail-server/&via=dotdeb&text=How to enable the SMTP authentification on your Qmail server&related=w_a_s_t_e:Dotdeb's maintainer&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.dotdeb.org/2008/08/24/howto-enable-the-smtp-authentification-on-your-qmail-server/&via=dotdeb&text=How to enable the SMTP authentification on your Qmail server&related=w_a_s_t_e:Dotdeb's maintainer&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>]]></content:encoded>
			<wfw:commentRss>http://www.dotdeb.org/2008/08/24/howto-enable-the-smtp-authentification-on-your-qmail-server/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
