<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    <title>This site works best in a real browser - Sysadmin</title>
    <link>http://grahamcox.co.uk/serendipity/</link>
    <description>My little place on the web...</description>
    <dc:language>en</dc:language>
    <generator>Serendipity 1.5.3 - http://www.s9y.org/</generator>
    <pubDate>Wed, 09 Apr 2008 09:35:25 GMT</pubDate>

    <image>
        <url>http://grahamcox.co.uk/serendipity/templates/default/img/s9y_banner_small.png</url>
        <title>RSS: This site works best in a real browser - Sysadmin - My little place on the web...</title>
        <link>http://grahamcox.co.uk/serendipity/</link>
        <width>100</width>
        <height>21</height>
    </image>

<item>
    <title>realpath script</title>
    <link>http://grahamcox.co.uk/serendipity/index.php?/archives/35-realpath-script.html</link>
            <category>Sysadmin</category>
    
    <comments>http://grahamcox.co.uk/serendipity/index.php?/archives/35-realpath-script.html#comments</comments>
    <wfw:comment>http://grahamcox.co.uk/serendipity/wfwcomment.php?cid=35</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://grahamcox.co.uk/serendipity/rss.php?version=2.0&amp;type=comments&amp;cid=35</wfw:commentRss>
    

    <author>nospam@example.com (Graham Cox)</author>
    <content:encoded>
    One thing that always gets me is how to convert a given path - be it absolute, relative or whatever - into an absolute path on the filesystem. It turns out there&#039;s a perl module that can do exactly this, and so I&#039;ve just rolled a tiny script that makes use of this and converts it&#039;s first parameter into a real path - an absolute path on the filesystem regardless of where it came from, and without any extra . or .. elements in there.&lt;br /&gt;
&lt;br /&gt;
The script does require the File::PathConvert module to be installed before it will work, but then you can just drop it into /usr/local/bin or wherever and do magic with it exactly the same as dirname or basename.&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;
#!/usr/bin/perl -w&lt;br /&gt;
&lt;br /&gt;
use File::PathConvert qw(realpath);&lt;br /&gt;
&lt;br /&gt;
if (@ARGV==0)&lt;br /&gt;
{&lt;br /&gt;
        print &quot;Usage: realpath &lt;pathname&gt;\n&quot;;&lt;br /&gt;
        exit();&lt;br /&gt;
}&lt;br /&gt;
my $in = $ARGV[0];&lt;br /&gt;
my $outpath = realpath($in);&lt;br /&gt;
print $outpath;&lt;br /&gt;
&lt;/code&gt; 
    </content:encoded>

    <pubDate>Wed, 09 Apr 2008 10:35:25 +0100</pubDate>
    <guid isPermaLink="false">http://grahamcox.co.uk/serendipity/index.php?/archives/35-guid.html</guid>
    
</item>
<item>
    <title>Compiling LDAP support for Apache 2.2.4</title>
    <link>http://grahamcox.co.uk/serendipity/index.php?/archives/30-Compiling-LDAP-support-for-Apache-2.2.4.html</link>
            <category>Sysadmin</category>
    
    <comments>http://grahamcox.co.uk/serendipity/index.php?/archives/30-Compiling-LDAP-support-for-Apache-2.2.4.html#comments</comments>
    <wfw:comment>http://grahamcox.co.uk/serendipity/wfwcomment.php?cid=30</wfw:comment>

    <slash:comments>1</slash:comments>
    <wfw:commentRss>http://grahamcox.co.uk/serendipity/rss.php?version=2.0&amp;type=comments&amp;cid=30</wfw:commentRss>
    

    <author>nospam@example.com (Graham Cox)</author>
    <content:encoded>
    Apache 2.2.4 has bundled with it modules for managing authentication against an LDAP directory. Unfortunatly the obvious way to compile this doesn&#039;t actually work.&lt;br /&gt;
&lt;br /&gt;
The obvious way is to us a configure line like this:&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;
./configure --prefix=/usr/local/httpd --enable-mods-shared=all --enable-ssl --enable-so --enable-auth-digest --enable-authnz-ldap  --with-ldap --enable-ldap --with-ldap-sdk=openldap&lt;br /&gt;
&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
Unfortunatly, this doesn&#039;t build APR or APR-Util with LDAP support, so when it comes to compile the module itself it fails.&lt;br /&gt;
&lt;br /&gt;
What I had to do instead is build APR and APR-Util seperatly. Of course, doing so still didn&#039;t work properly for some reason. It turns out that you have to build APR and APR-Util seperatly, then build Apache telling it exactly where these two libraries can be found.&lt;br /&gt;
&lt;br /&gt;
My full build script for it now looks like this:&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
cd httpd&lt;br /&gt;
make distclean&lt;br /&gt;
./configure --prefix=/usr/local/httpd --enable-mods-shared=all --enable-ssl --enable-so --enable-auth-digest --enable-authnz-ldap  --with-ldap --enable-ldap --with-ldap-sdk=openldap --with-apr=./srclib/apr --with-apr-util=./srclib/apr-util&lt;br /&gt;
&lt;br /&gt;
# Build APR and APR-util seperatly due to LDAP issues&lt;br /&gt;
cd srclib&lt;br /&gt;
cd apr&lt;br /&gt;
./configure --prefix=/usr/local/httpd --enable-threads --enable-other-child&lt;br /&gt;
make&lt;br /&gt;
cd ..&lt;br /&gt;
cd apr-util&lt;br /&gt;
./configure --prefix=/usr/local/httpd --with-apr=../apr --with-ldap-lib=/usr/local/openldap/lib --with-ldap-include=/usr/local/openldap/include --with-ldap=ldap&lt;br /&gt;
make&lt;br /&gt;
cd ..&lt;br /&gt;
cd ..&lt;br /&gt;
&lt;br /&gt;
make&lt;br /&gt;
&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
In addition, by doing it this way you need to make sure that you do a make install in both srclib/apr and srclib/apr-util in addition to just the apache source directory. Failing to do so will mean that the LDAP enabled APR and APR-Util won&#039;t be installed, and adding the LDAP modules into your httpd.conf will stop Apache from loading... You can tell you&#039;ve done this if you get the error&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;
httpd: Syntax error on line 110 of /usr/local/httpd/conf/httpd.conf: Cannot load /usr/local/httpd/modules/mod_ldap.so into server: /usr/local/httpd/modules/mod_ldap.so: undefined symbol: apr_ldap_info&lt;br /&gt;
&lt;/code&gt;&lt;br /&gt;
or something similar when you try to load Apache. 
    </content:encoded>

    <pubDate>Thu, 03 May 2007 21:17:45 +0100</pubDate>
    <guid isPermaLink="false">http://grahamcox.co.uk/serendipity/index.php?/archives/30-guid.html</guid>
    
</item>
<item>
    <title>GPG Key Autoresponder with Procmail</title>
    <link>http://grahamcox.co.uk/serendipity/index.php?/archives/21-GPG-Key-Autoresponder-with-Procmail.html</link>
            <category>Sysadmin</category>
    
    <comments>http://grahamcox.co.uk/serendipity/index.php?/archives/21-GPG-Key-Autoresponder-with-Procmail.html#comments</comments>
    <wfw:comment>http://grahamcox.co.uk/serendipity/wfwcomment.php?cid=21</wfw:comment>

    <slash:comments>1</slash:comments>
    <wfw:commentRss>http://grahamcox.co.uk/serendipity/rss.php?version=2.0&amp;type=comments&amp;cid=21</wfw:commentRss>
    

    <author>nospam@example.com (Graham Cox)</author>
    <content:encoded>
    I have just set up my &lt;a href=&quot;http://grahamcox.co.uk/serendipity/exit.php?url=aHR0cDovL3d3dy5wcm9jbWFpbC5vcmc=&amp;amp;entry_id=21&quot; title=&quot;http://www.procmail.org&quot;  onmouseover=&quot;window.status=&#039;http://www.procmail.org&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot;&gt;procmail&lt;/a&gt; config to automatically send out my GPG Public key to anyone who sends a specially crafted email to me. Because I use &lt;a href=&quot;http://grahamcox.co.uk/serendipity/exit.php?url=aHR0cDovL3d3dy5leGltLm9yZw==&amp;amp;entry_id=21&quot; title=&quot;http://www.exim.org&quot;  onmouseover=&quot;window.status=&#039;http://www.exim.org&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot;&gt;exim&lt;/a&gt; as my MTA, I receive emails that get sent to graham-*@ and graham+*@ as well as those simply sent to graham@.&lt;br /&gt;
&lt;br /&gt;
Making use of this, I&#039;ve put together a procmail rule that automatically responds to all emails sent to graham-gpgkey@grahamcox.co.uk. This rule simply automatically responds to the sender with an email containing my GPG Public key.&lt;br /&gt;
&lt;br /&gt;
The procmail rule that does this is as follows:&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;
:0&lt;br /&gt;
&lt;strong&gt; ^To: .*graham-gpgkey@grahamcox.co.uk&lt;br /&gt;
{&lt;br /&gt;
        # Rewrite the header of the incoming mail&lt;br /&gt;
        # formail&#039;s -r flag makes it a reply to the incoming message&lt;br /&gt;
        # formail&#039;s -I flags add/replace headers in the original message&lt;br /&gt;
        :0 fhw&lt;br /&gt;
        | formail       -rI&quot;Subject: My GnuPG public key&quot; \&lt;br /&gt;
                        -I&quot;X-Loop: $MY_ADDR&quot;&lt;br /&gt;
        # Write the body of the outgoing mail&lt;br /&gt;
        :0 fbw&lt;br /&gt;
        | /usr/bin/gpg --armor --export &amp;lt;my id&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        # Send the email&lt;br /&gt;
        :0 w&lt;br /&gt;
        &lt;/strong&gt; &gt; 1&lt;br /&gt;
        ! -oi -t&lt;br /&gt;
}&lt;br /&gt;
&lt;/code&gt; 
    </content:encoded>

    <pubDate>Fri, 10 Nov 2006 15:04:39 +0000</pubDate>
    <guid isPermaLink="false">http://grahamcox.co.uk/serendipity/index.php?/archives/21-guid.html</guid>
    
</item>
<item>
    <title>Database migration</title>
    <link>http://grahamcox.co.uk/serendipity/index.php?/archives/19-Database-migration.html</link>
            <category>Server Migration</category>
    
    <comments>http://grahamcox.co.uk/serendipity/index.php?/archives/19-Database-migration.html#comments</comments>
    <wfw:comment>http://grahamcox.co.uk/serendipity/wfwcomment.php?cid=19</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://grahamcox.co.uk/serendipity/rss.php?version=2.0&amp;type=comments&amp;cid=19</wfw:commentRss>
    

    <author>nospam@example.com (Graham Cox)</author>
    <content:encoded>
    Migration of actual database across is something that was not working at all last time I tried it, and that I have managed to make work perfectly this time around.&lt;br /&gt;
&lt;br /&gt;
In order to migrate a database from an older version of Postgres to a newer version, you need to do a dump and restore of the data. Unfortunatly, the pg_dump tool on Postgres 7.3 doesn&#039;t dump Schemas in a form that Postgres 8.1 will restore, and so if you do this you end up with all of your tables and functions in the Public schema instead of the schemas you put them in. &lt;br /&gt;
&lt;br /&gt;
However, there is a simple way around this, and one that works very easy and even removes a step from the migration.&lt;br /&gt;
&lt;br /&gt;
Before, I was attempting to do the migration as follows:&lt;br /&gt;
This assumes that you have already created the database and users prior to importing the data.&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;
oldserver$ pg_dump -f database.sql database&lt;br /&gt;
&lt;br /&gt;
newserver$ scp oldserver:database.sql .&lt;br /&gt;
newserver$ psql -d database -f database.sql&lt;br /&gt;
&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
The new method that I have been using, that seems so far to work perfectly, is as follows:&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;
newserver$ pg_dump -f database.sql -h oldserver -U graham database&lt;br /&gt;
newserver$ psql -d database -f database.sql&lt;br /&gt;
&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
In order to do this, there are a few things that need to be done first. Namely,&lt;br /&gt;
# Allow newserver to access oldserver. I did this by just putting a whitelist entry in the firewall on oldserver.&lt;br /&gt;
# Allow newserver to access the Postgres databases on oldserver. This is done by editing pg_hba.conf&lt;br /&gt;
# Allow the user to log in remotely. This is done by the settings in pg_hba.conf, and by making sure the user has a password you know.&lt;br /&gt;
&lt;br /&gt;
The trick here is that the pg_dump that comes with Postgres 8.1 knows how to dump data from an older version of Postgres, but it dumps it in a format that the newer version is able to import properly. 
    </content:encoded>

    <pubDate>Thu, 28 Sep 2006 09:49:35 +0100</pubDate>
    <guid isPermaLink="false">http://grahamcox.co.uk/serendipity/index.php?/archives/19-guid.html</guid>
    
</item>
<item>
    <title>Subversion Migration</title>
    <link>http://grahamcox.co.uk/serendipity/index.php?/archives/18-Subversion-Migration.html</link>
            <category>Server Migration</category>
    
    <comments>http://grahamcox.co.uk/serendipity/index.php?/archives/18-Subversion-Migration.html#comments</comments>
    <wfw:comment>http://grahamcox.co.uk/serendipity/wfwcomment.php?cid=18</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://grahamcox.co.uk/serendipity/rss.php?version=2.0&amp;type=comments&amp;cid=18</wfw:commentRss>
    

    <author>nospam@example.com (Graham Cox)</author>
    <content:encoded>
    Subversion Migration has been relatively painless. The only difficult part turned out to be the bit that I always have trouble with - installing the Python bindings so that ViewVC and other tools will work with it.&lt;br /&gt;
&lt;br /&gt;
When installing Subversion, you go through the standard set of steps - ./configure, make, make check, sudo make install. What you also  have to do in order to get the subversion python bindings installed I keep having to go and dig up on the internet. &lt;br /&gt;
&lt;br /&gt;
It is &lt;strong&gt;not&lt;/strong&gt; downloading the pysvn package and installing that. This is either an alternative or an older version of what is actually included with Subversion and does not do the complete job that ViewVC needs from it.&lt;br /&gt;
&lt;br /&gt;
Instead, what you have to do is the following:&lt;br /&gt;
&lt;br /&gt;
From the Subversion source directory, execute&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;
$ make swig-py&lt;br /&gt;
$ sudo make install-swig-py&lt;br /&gt;
&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
As it happens, this is mentioned in the INSTALL for Subversion. However, it&#039;s a small section right at the bottom of the file that refers you to read a different file that gives you the instructions. 
    </content:encoded>

    <pubDate>Thu, 28 Sep 2006 09:34:16 +0100</pubDate>
    <guid isPermaLink="false">http://grahamcox.co.uk/serendipity/index.php?/archives/18-guid.html</guid>
    
</item>
<item>
    <title>Software installation</title>
    <link>http://grahamcox.co.uk/serendipity/index.php?/archives/17-Software-installation.html</link>
            <category>Server Migration</category>
    
    <comments>http://grahamcox.co.uk/serendipity/index.php?/archives/17-Software-installation.html#comments</comments>
    <wfw:comment>http://grahamcox.co.uk/serendipity/wfwcomment.php?cid=17</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://grahamcox.co.uk/serendipity/rss.php?version=2.0&amp;type=comments&amp;cid=17</wfw:commentRss>
    

    <author>nospam@example.com (Graham Cox)</author>
    <content:encoded>
    The complete list of &quot;core&quot; software that I have installed on the new server is as below.&lt;br /&gt;
Core software is the list of Systems software that I have installed myself - it doesn&#039;t include things like SSH which, whilst is Systems software, was pre-installed on the system. It instead is the list of software for what the server is actually going to be doing.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://grahamcox.co.uk/serendipity/exit.php?url=aHR0cDovL3d3dy5hcGFjaGUub3Jn&amp;amp;entry_id=17&quot; title=&quot;http://www.apache.org&quot;  onmouseover=&quot;window.status=&#039;http://www.apache.org&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot;&gt;Apache&lt;/a&gt; - 2.2.3 - Webserver&lt;br /&gt;
&lt;a href=&quot;http://grahamcox.co.uk/serendipity/exit.php?url=aHR0cDovL3N1YnZlcnNpb24udGlncmlzLm9yZw==&amp;amp;entry_id=17&quot; title=&quot;http://subversion.tigris.org&quot;  onmouseover=&quot;window.status=&#039;http://subversion.tigris.org&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot;&gt;Subversion&lt;/a&gt; - 1.3.1 - Version control&lt;br /&gt;
&lt;a href=&quot;http://grahamcox.co.uk/serendipity/exit.php?url=aHR0cDovL3d3dy5wb3N0Z3Jlc3FsLm9yZw==&amp;amp;entry_id=17&quot; title=&quot;http://www.postgresql.org&quot;  onmouseover=&quot;window.status=&#039;http://www.postgresql.org&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot;&gt;PostgreSQL&lt;/a&gt; - 8.1.4 - Database&lt;br /&gt;
&lt;a href=&quot;http://grahamcox.co.uk/serendipity/exit.php?url=aHR0cDovL3d3dy5waHAubmV0&amp;amp;entry_id=17&quot; title=&quot;http://www.php.net&quot;  onmouseover=&quot;window.status=&#039;http://www.php.net&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot;&gt;PHP&lt;/a&gt; - 5.1.6 - Web software&lt;br /&gt;
&lt;a href=&quot;http://grahamcox.co.uk/serendipity/exit.php?url=aHR0cDovL3d3dy5hc3Rlcmlzay5vcmc=&amp;amp;entry_id=17&quot; title=&quot;http://www.asterisk.org&quot;  onmouseover=&quot;window.status=&#039;http://www.asterisk.org&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot;&gt;Asterisk&lt;/a&gt; - 1.2 - VoIP Server.&lt;br /&gt;
&lt;br /&gt;
Out of all of these, the only one that I had to install an older version of was Asterisk. This was because the dialplan and config that I already have doesn&#039;t appear to work on the latest trunk version, and it was too much hassle to make it all work now. That&#039;s a project for the future. 
    </content:encoded>

    <pubDate>Wed, 27 Sep 2006 13:46:48 +0100</pubDate>
    <guid isPermaLink="false">http://grahamcox.co.uk/serendipity/index.php?/archives/17-guid.html</guid>
    
</item>
<item>
    <title>Server Migration</title>
    <link>http://grahamcox.co.uk/serendipity/index.php?/archives/16-Server-Migration.html</link>
            <category>Server Migration</category>
    
    <comments>http://grahamcox.co.uk/serendipity/index.php?/archives/16-Server-Migration.html#comments</comments>
    <wfw:comment>http://grahamcox.co.uk/serendipity/wfwcomment.php?cid=16</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://grahamcox.co.uk/serendipity/rss.php?version=2.0&amp;type=comments&amp;cid=16</wfw:commentRss>
    

    <author>nospam@example.com (Graham Cox)</author>
    <content:encoded>
    My old server wasn&#039;t good enough for everything that I was doing on it. Given the huge list of things I was doing on it, this wasn&#039;t surprising. Where it wasn&#039;t good enough was when I was trying to get it to run &lt;a href=&quot;http://grahamcox.co.uk/serendipity/exit.php?url=aHR0cDovL3d3dy5wb3N0Z3Jlc3FsLm9yZy8=&amp;amp;entry_id=16&quot; title=&quot;http://www.postgresql.org/&quot;  onmouseover=&quot;window.status=&#039;http://www.postgresql.org/&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot;&gt;PostgreSQL&lt;/a&gt; 8.1 instead of 7.3 that it came with.&lt;br /&gt;
&lt;br /&gt;
As such, I have migrated across to a bigger server - the &lt;a href=&quot;http://grahamcox.co.uk/serendipity/exit.php?url=aHR0cDovL3d3dy5zZXJ2ZWxvY2l0eS5uZXQ=&amp;amp;entry_id=16&quot; title=&quot;http://www.servelocity.net&quot;  onmouseover=&quot;window.status=&#039;http://www.servelocity.net&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot;&gt;Servelocity&lt;/a&gt; Unlimited+ FC5 server - and started installing everything on there.&lt;br /&gt;
&lt;br /&gt;
This is actually the second time I&#039;m attempting this. The first time was a couple of weeks ago, and the server that I got had issues with it that meant I wasn&#039;t going to use it. I have now got a good server and got all the software installed and running. &lt;br /&gt;
 
    </content:encoded>

    <pubDate>Wed, 27 Sep 2006 13:41:39 +0100</pubDate>
    <guid isPermaLink="false">http://grahamcox.co.uk/serendipity/index.php?/archives/16-guid.html</guid>
    
</item>

</channel>
</rss>