<?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>Martin Ahrer - Together we&#039;ll make IT &#187; linux</title>
	<atom:link href="http://www.martinahrer.at/tag/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.martinahrer.at</link>
	<description>Java Enterprise Softwareentwicklung und Consulting</description>
	<lastBuildDate>Sun, 11 Dec 2011 16:19:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
<meta name="generator" content="deSignum 0.8.1" />
		<item>
		<title>Enable Dovecot SSL</title>
		<link>http://www.martinahrer.at/2010/01/19/enable-dovecot-ssl/</link>
		<comments>http://www.martinahrer.at/2010/01/19/enable-dovecot-ssl/#comments</comments>
		<pubDate>Tue, 19 Jan 2010 14:24:23 +0000</pubDate>
		<dc:creator>Martin Ahrer</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[dovecot]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ssl]]></category>

		<guid isPermaLink="false">http://www.martinahrer.at/?p=407</guid>
		<description><![CDATA[/etc/dovecot/dovecot.conf requires these settings ssl_disable = no ssl_cert_file = /etc/ssl/certs/certificate.pem ssl_key_file = /etc/ssl/private/key.pem The certificate and key must be created before either using the dovecot tools or the way I&#8217;m describing that in-depth.]]></description>
			<content:encoded><![CDATA[<p><code>/etc/dovecot/dovecot.conf</code> requires these settings</p>
<pre class="brush:plain">
ssl_disable = no
ssl_cert_file = /etc/ssl/certs/certificate.pem
ssl_key_file = /etc/ssl/private/key.pem
</pre>
<p>The certificate and key must be created before either using the dovecot <a href="http://wiki.dovecot.org/SSL/CertificateCreation">tools</a> or the way I&#8217;m describing that <a href="http://www.martinahrer.at/2009/11/02/create-a-server-certificate-with-openssl/">in-depth</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.martinahrer.at/2010/01/19/enable-dovecot-ssl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SASL + Postfix with Debian Lenny</title>
		<link>http://www.martinahrer.at/2010/01/19/sasl-postfix-with-debian-lenny/</link>
		<comments>http://www.martinahrer.at/2010/01/19/sasl-postfix-with-debian-lenny/#comments</comments>
		<pubDate>Tue, 19 Jan 2010 14:03:03 +0000</pubDate>
		<dc:creator>Martin Ahrer</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[postfix]]></category>
		<category><![CDATA[sasl]]></category>

		<guid isPermaLink="false">http://www.martinahrer.at/?p=396</guid>
		<description><![CDATA[In the last days I have reinstalled a mail server on a new virtual host and upgraded from debian etch to Lenny. The initial set was done by a friend of mine following this instructions. With the upgrade to Lenny however a few adjustments were required. So I describe the new setup here. apt-get install [...]]]></description>
			<content:encoded><![CDATA[<p>In the last days I have reinstalled a mail server on a new virtual host and upgraded from debian etch to Lenny. The initial set was done by a friend of mine following this <a href="http://dertompson.com/2008/02/13/mail-server-setup-for-debian-etch/">instructions</a>. With the upgrade to Lenny however a few adjustments were required. So I describe the new setup here.<br />
<span id="more-396"></span></p>
<pre class="brush:bash">
apt-get install libsasl2-2 sasl2-bin libsasl2-modules
</pre>
<p>The postfix configuration requires the following update in<code>/etc/postfix/main.cf</code>.</p>
<pre  class="brush:bash">
# add permit_sasl_authenticated for SASL support
smtpd_recipient_restrictions =
        permit_mynetworks,
        permit_sasl_authenticated,
        reject_unauth_destination,
        check_policy_service inet:127.0.0.1:60000

# add these options
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = yes
broken_sasl_auth_clients = yes
smtpd_sasl_security_options = noanonymous
</pre>
<p>Create <code> /etc/postfix/sasl/smtpd.conf</code> with this content</p>
<pre class="brush:bash">
pwcheck_method: saslauthd
mech_list: plain login
</pre>
<p>Then create directory <code>/var/spool/postfix/var/run/saslauthd</code></p>
<pre  class="brush:bash">
 mkdir -p /var/spool/postfix/var/run/saslauthd
</pre>
<p>Set permissions</p>
<pre  class="brush:bash">
dpkg-statoverride --add root sasl 710 /var/spool/postfix/var/run/saslauthd
</pre>
<p>And add postfix user to group sasl</p>
<pre  class="brush:bash">
adduser postfix sasl
</pre>
<p><code>/etc/default/saslauthd</code> Requires some modifications</p>
<pre  class="brush:bash">
START=yes
OPTIONS="-c -m /var/spool/postfix/var/run/saslauthd -r"
</pre>
<p>Finally restart some services.</p>
<pre   class="brush:bash">
/etc/init.d/saslauthd restart
/etc/init.d/postfix restart
</pre>
<p><strong>Upgrading from debian etch</strong></p>
<p>If you are upgrading and getting permission errors then you can fix these by berforming the steps above where permissions for <code>/var/spool/postfix/var/run/saslauthd</code> are set and the user group sasl is updated.</p>
<pre>
SASL authentication failure: Password verification failed
SASL PLAIN authentication failed: generic failure
SASL authentication failure: cannot connect to saslauthd server: Permission denied
SASL LOGIN authentication failed: generic failure
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.martinahrer.at/2010/01/19/sasl-postfix-with-debian-lenny/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Create a server certificate with OpenSSL</title>
		<link>http://www.martinahrer.at/2009/11/02/create-a-server-certificate-with-openssl/</link>
		<comments>http://www.martinahrer.at/2009/11/02/create-a-server-certificate-with-openssl/#comments</comments>
		<pubDate>Mon, 02 Nov 2009 14:57:49 +0000</pubDate>
		<dc:creator>Martin Ahrer</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.martinahrer.at/?p=294</guid>
		<description><![CDATA[A long time ago I had created some certificate for my mail server. Very recently it expired so I had to renew it now. Back then I had used 2 quite complex OpenSSL commands that I found @ some blog. # create key + csr (-nodes == key is not encrypted) openssl req -new -nodes [...]]]></description>
			<content:encoded><![CDATA[<p>A long time ago I had created some certificate for my mail server. Very recently it expired so I had to renew it now.<br />
Back then I had used 2 quite complex OpenSSL commands that I found @ some blog.</p>
<pre class="brush:bash"># create key + csr (-nodes == key is not encrypted)
openssl req -new -nodes -newkey rsa:1024 -keyout domain.key.pem -out domain.csr.pem
# create certificate (self signed)
openssl x509 -req -days 365 -in domain.csr.pem -signkey domain.key.pem -out domain.crt.pem</pre>
<p>I had documented them somewhere but when I looked at them again, it was like &#8220;don&#8217;t know what&#8217;s going on here&#8221;! So I tried to break them up into multiple steps. Also I came up with some naming convention since quite a few file are created during the whole process.</p>
<p>A key file is using the file suffix .key.pem, a certificate signing request uses .csr.pem and a certificate .crt.pem .<br />
And the filename would always be prefixed with the domain name. E.g. for domain google.com a key file would be google.com.key.pem .</p>
<h2>Prepare for creating certificates</h2>
<h3><strong>1. Create a certificate authority</strong></h3>
<p>For convenience before using OpenSSL I would set up a certificate authority (CA) with a key file and a certificate file. Assuming that OpenSSL is already installed I configure some defaults in <em>/etc/ssl/openssl.cnf</em> .</p>
<pre class="brush:text">[ CA_default ]
dir                = /etc/ssl              # Where everything is kept
certificate      = $dir/private/cacert.pem       # The CA certificate
private_key    = $dir/private/cakey.pem   # The private key
...
[ req_distinguished_name ]
...</pre>
<p>And we create a few files/directories in /etc/ssl:</p>
<pre class="brush: text">echo 01&gt;/etc/ssl/serial
touch /etc/ssl/index.txt
mkdir /etc/ssl/newcerts</pre>
<p>The execution of the next OpenSSL command will create the CA files and prompt for some input. Note that here for common name it is sufficient to use your real name. Finally we make the key file readable for root only.</p>
<pre class="brush:bash">openssl req -new -x509 -newkey rsa:2048 -keyout /etc/ssl/private/cakey.pem -out /etc/ssl/private/cacert.pem -days 730

chmod 600 /etc/ssl/private/cakey.pem</pre>
<p>Ok here we go: these are the steps to create a certificate</p>
<h3><strong>2. Create a key for the server certificate</strong></h3>
<pre class="brush: bash">openssl genrsa -out domain.key.pem -aes128 2048 -days 730</pre>
<p>That creates a password phrase protected key file. However since it so not fun to be prompted during server startup we remove the password phrase again.</p>
<pre class="brush: bash">openssl rsa -in domain.key.pem -out domain.key.pem</pre>
<p><em>It actually would be better to safe the password protected key to some safe location before and creating the unprotected using a new file name!!!</em></p>
<h2>Create a certificate signing request (CSR) and have a CA sign it</h2>
<h3><strong>1. Create certificate signing request (CSR)</strong></h3>
<pre class="brush:bash">openssl req -new -key domain.key.pem -out domain.csr.pem -nodes</pre>
<p>That creates a csr that later must be signed by a certificate authority (CA). It is of importance that here we have to use the full domain name of the server for the <em>common name</em>. Otherwise the client would not accept that certificate.</p>
<h3><strong>2. Have a CA sign the certificate signing request</strong></h3>
<p>A CA now has to sign the request. Either you contact one of the official authorities (like Thawte) and pay lots of bucks or you use the CA you created in the beginning (as we show now).</p>
<pre class="brush:bash">openssl ca -in domain.csr.pem -notext -out domain.crt.pem</pre>
<h3><strong>3. Install certificate</strong></h3>
<p>First move the certificate to /etc/ssl/certs and move the key file to /etc/ssl/private. Make sure that only root can read the key files.</p>
<p>Finally you need to install your certificates which depends on the product you are using. Maybe I will write a blog entry on how to install a certificate for a mail provider or Apache web server later on.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.martinahrer.at/2009/11/02/create-a-server-certificate-with-openssl/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Roundcube web mail</title>
		<link>http://www.martinahrer.at/2009/10/18/roundcube-web-mail/</link>
		<comments>http://www.martinahrer.at/2009/10/18/roundcube-web-mail/#comments</comments>
		<pubDate>Sun, 18 Oct 2009 09:33:12 +0000</pubDate>
		<dc:creator>Martin Ahrer</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.martinahrer.at/?p=259</guid>
		<description><![CDATA[I have been following the roundcube webmail project since version 0.1. Back then it was quite cumbersome to install on a Linux host. With 0.3 installation has turned into a cakewalk so I decided to try it now. I only needed to update my PHP4 to PHP5, unpacked the installation package to the web root [...]]]></description>
			<content:encoded><![CDATA[<p>I have been following the <a href="http://roundcube.net/">roundcube </a>webmail project since version 0.1. Back then it was quite cumbersome to install on a Linux host. With 0.3 installation has turned into a cakewalk so I decided to try it now.</p>
<p>I only needed to update my PHP4 to PHP5, unpacked the installation package to the web root for the virtual host I created for roundcube, created a new mysql database and started the installation procedure.</p>
<p>Though it is still only a 0.3 version it has quite some impressive set of <a href="http://roundcube.net/about#features">features</a>. Of course due to its Web 2.0 nature it is a little bit slower than squirrel mail that I used earlier!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.martinahrer.at/2009/10/18/roundcube-web-mail/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My virtual host administration</title>
		<link>http://www.martinahrer.at/2009/05/31/my-virtual-host-administration/</link>
		<comments>http://www.martinahrer.at/2009/05/31/my-virtual-host-administration/#comments</comments>
		<pubDate>Sun, 31 May 2009 20:39:11 +0000</pubDate>
		<dc:creator>Martin Ahrer</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.martinahrer.at/?p=122</guid>
		<description><![CDATA[For more than a year I have been running my own virtual host (thanks to Tom for helping with the setup of the mail system). Before I had almost no skills regarding Linux administration. Meanwhile I&#8217;m kindof able to maintain it and add this and that. For a while a few tasks have been pending [...]]]></description>
			<content:encoded><![CDATA[<p>For more than a year I have been running my own virtual host (thanks to Tom for helping with the setup of the mail system). Before I had almost no skills regarding Linux administration. Meanwhile I&#8217;m kindof able to maintain it and add this and that. For a while a few tasks have been pending</p>
<ol>
<li><strong>Frequent logging file reports</strong></li>
<li><strong>Monthly backup</strong></li>
<li><strong>Moving backup files to some external storage service</strong></li>
</ol>
<p>Due to my pretty constrained time budget only now I was able to spend some hours on getting some task done.</p>
<p>For <strong>Frequent logging file reports</strong> I added logwatch to my system, customized it in /etc/logwatch/conf/logwatch.conf.</p>
<pre class="brush:text">
# Default person to mail reports to.  Can be a local account or a
# complete email address.
MailTo = recipient@domain
# Default person to mail reports from.  Can be a local account or a
# complete email address.
MailFrom = Logwatch

# If set to 'Yes', the report will be sent to stdout instead of being
# mailed to above person.
Print = No
</pre>
<p>I added logwatch to my daily cron jobs in /etc/cron.daily/logwatch</p>
<pre class="brush:bash">
test -x /usr/share/logwatch/scripts/logwatch.pl || exit 0
/usr/share/logwatch/scripts/logwatch.pl
</pre>
<p>I added a /etc/cron.monthly/backup script for performing <strong>monthly backups</strong> of important system files</p>
<pre class="brush:bash">
outputFolder=/var/tmp/backup
now=`date +%Y%m%d%H%M`
hostname=`hostname`
outputFolder=$outputFolder/$hostname/$now

if [ -d $outputFolder ]
then
        echo "Backup has alread run on '$hostname'  for '$now'"
        exit 1
else
        mkdir --parents --verbose $outputFolder
fi

echo backup...
options=-cvvz
tar $options --file=$outputFolder/backup.tar.gz --exclude=/var/cache/* --exclude=/var/spool/* --exclude=/var/lock/* --exclude=/var/run/* --exclude=/var/tmp/* --exclude=/var/log/* /var /etc /home 1>$outputFolder/backup.log

echo "Backup for $hostname ready at $outputFolder/backup.tar.gz" | mail -s "Backup completed for $hostname `date`" recipient@domain
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.martinahrer.at/2009/05/31/my-virtual-host-administration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ubuntu hardy sudo returns &quot;unable to resolve host&quot;</title>
		<link>http://www.martinahrer.at/2008/07/15/ubuntu-hardy-sudo-returns-unable-to-resolve-host/</link>
		<comments>http://www.martinahrer.at/2008/07/15/ubuntu-hardy-sudo-returns-unable-to-resolve-host/#comments</comments>
		<pubDate>Tue, 15 Jul 2008 20:33:59 +0000</pubDate>
		<dc:creator>Martin Ahrer</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.martinahrer.at/?p=83</guid>
		<description><![CDATA[Today I tried to to a major upgrade of my local ubuntu based server. I hadn&#8217;t done this in a while. When starting update-manager it got stuck and refused to download any upgrades. So I first attempted to run aptitude to get around. But as soon the I needed to sudo I got this nasty [...]]]></description>
			<content:encoded><![CDATA[<p>Today I tried to to a major upgrade of my local ubuntu based server. I hadn&#8217;t done this in a while. When starting update-manager it got stuck and refused to download any upgrades.<br />
So I first attempted to run aptitude to get around. But as soon the I needed to sudo I got this nasty &#8220;unable to resolve host <hostname>&#8221; error. So basically coulddn&#8217;t get any permissions to make changes to the system.</p>
<p>I found this <a href="https://bugs.launchpad.net/ubuntu/+source/linux-meta/+bug/195308">bug</a> which explains wht&#8217;s going on. I don&#8217;t know how it happened but my /etc/hosts file contained an invalid hostname. I was able to start the network-admin panel (strangely here sudo-ing worked, I was prompted for the password) and fixed the hostname.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.martinahrer.at/2008/07/15/ubuntu-hardy-sudo-returns-unable-to-resolve-host/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

