<?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>Sam Pierson&#039;s Blog &#187; centos</title>
	<atom:link href="http://sampierson.com/blog/tag/centos/feed/" rel="self" type="application/rss+xml" />
	<link>http://sampierson.com/blog</link>
	<description>Augmentation of an Imperfect Memory.</description>
	<lastBuildDate>Wed, 21 Jul 2010 01:41:32 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Creating a password protected YUM repository</title>
		<link>http://sampierson.com/blog/system-administration/creating-a-password-protected-yum-repository/</link>
		<comments>http://sampierson.com/blog/system-administration/creating-a-password-protected-yum-repository/#comments</comments>
		<pubDate>Wed, 17 Oct 2007 17:48:00 +0000</pubDate>
		<dc:creator>sam</dc:creator>
				<category><![CDATA[System Administration]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[yum]]></category>

		<guid isPermaLink="false">urn:uuid:e29b41fc-986e-4090-9cb5-b64d90ade04f</guid>
		<description><![CDATA[Setup http authentication in httpd.conf file (encouraged rather than using .htaccess):

&#60;Directory /var/www/repo&#62;
    AuthType Basic
    AuthName &#34;Password Required&#34;
    AuthUserFile /etc/apache2/passwords/repo
    Require valid-user
&#60;/Directory&#62;

Create auth user password file:

htpasswd -c /etc/apache2/passwords/repo repouser

Restart apache.
Create repo:

yum install createrepo # or equivalent
mkdir /var/www/repo
cp *.rpm /var/www/repo
createrepo /var/www/repo

To use the repo, on the [...]]]></description>
			<content:encoded><![CDATA[<p>Setup http authentication in httpd.conf file (encouraged rather than using .htaccess):</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Directory</span> /var/www/repo<span style="color: #000000; font-weight: bold;">&gt;</span></span>
    AuthType Basic
    AuthName &quot;Password Required&quot;
    AuthUserFile /etc/apache2/passwords/repo
    Require valid-user
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Directory<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Create auth user password file:</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">htpasswd -c /etc/apache2/passwords/repo repouser</pre></div></div>

<p>Restart apache.</p>
<p>Create repo:</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">yum install createrepo # or equivalent
mkdir /var/www/repo
cp *.rpm /var/www/repo
createrepo /var/www/repo</pre></div></div>

<p>To use the repo, on the client system in /etc/yum.repo.d/&lt;reponame&gt;.repo, have:</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">baseurl=http://repouser:password@server/repo</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://sampierson.com/blog/system-administration/creating-a-password-protected-yum-repository/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>LDAP &#8211; Setting up an address book that Evolution likes</title>
		<link>http://sampierson.com/blog/system-administration/ldap-setting-up-an-address-book-that-evolution-likes/</link>
		<comments>http://sampierson.com/blog/system-administration/ldap-setting-up-an-address-book-that-evolution-likes/#comments</comments>
		<pubDate>Mon, 09 Jul 2007 12:52:31 +0000</pubDate>
		<dc:creator>sam</dc:creator>
				<category><![CDATA[System Administration]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[ldap]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://sampierson.com/blog/?p=438</guid>
		<description><![CDATA[The goal of this exercise was to create an LDAP address book that the Gnome Evolution mail client would read and write. It tooks 3 days to get to the bottom of this.  Getting some trivial functionality working was easy.  Getting (nearly) all the Evo contact fields to work, with security enabled on [...]]]></description>
			<content:encoded><![CDATA[<p>The goal of this exercise was to create an LDAP address book that the Gnome Evolution mail client would read and write. It tooks 3 days to get to the bottom of this.  Getting some trivial functionality working was easy.  Getting (nearly) all the Evo contact fields to work, with security enabled on the LDAP server was much harder.</p>
<p>Here is the setup:</p>
<ul>
<li>Evolution mail client, running on Ubuntu 7.04 Feisty Fawn</li>
<li>Openldap server running on CentOS 4.4</li>
</ul>
<p>First the facts, then the details&#8230;</p>
<h3>Use</h3>
<ul>
<li>BindDN -&gt; uid=sam,ou=users,dc=ombwa,dc=org</li>
<li>BaseDN -&gt; ou=Sams,ou=address books,dc=ombwa,dc=org</li>
</ul>
<h3>Setup</h3>
<ul>
<li>Copied evolutionperson.schema from /usr/share/evolution-data-server-1.10/ to my LDAP server /etc/openldap/schema</li>
<li>Write the following slapd.conf (original comments/examples ommitted for brevity):</li>
</ul>
<pre lang="slapd.conf">#
# See slapd.conf(5) for details on configuration options.
# This file should NOT be world readable.
#
include		/etc/openldap/schema/core.schema
include		/etc/openldap/schema/cosine.schema
include		/etc/openldap/schema/inetorgperson.schema
include		/etc/openldap/schema/nis.schema
include		/etc/openldap/schema/evolutionperson.schema

# 128=ALCs 256=OpStats
#loglevel	384
pidfile		/var/run/slapd.pid
argsfile	/var/run/slapd.args

#######################################################################
# Database for ombwa.org
#######################################################################

database	bdb
suffix		"dc=ombwa,dc=org"
rootdn		"cn=Manager,dc=ombwa,dc=org"
rootpw

directory	/var/lib/ldap/ombwa.org
mode		0600

#################### Access controls ####################
# Evolution queries the rootDSE and Subschema while anonymous.
access to dn=""
by * read
access to dn.exact="cn=Subschema"
by * read
# Allow auth access to users subtree.
access to dn.subtree="ou=users,dc=ombwa,dc=org"
by * auth
# Allow sam access to Sam's address book.
access to dn.subtree="ou=Sams,ou=address books,dc=ombwa,dc=org"
by dn="uid=sam,ou=users,dc=ombwa,dc=org" write
# No soup for you.
access to *
by * none

# Indices to maintain for this database
index objectClass                       eq,pres
index ou,cn,mail,surname,givenname      eq,pres,sub
index uidNumber,gidNumber,loginShell    eq,pres
index uid,memberUid                     eq,pres,sub
index nisMapName,nisMapEntry            eq,pres,sub</pre>
<ul>
<li>Restarted LDAP server.</li>
<li>Setup the tree by running the following LDIF file through</li>
</ul>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">ldapadd <span style="color: #660033;">-x</span> <span style="color: #660033;">-D</span> <span style="color: #ff0000;">&quot;cn=Manager,dc=ombwa,dc=org&quot;</span> <span style="color: #660033;">-w</span> <span style="color: #660033;">-a</span> <span style="color: #660033;">-f</span> <span style="color: #ff0000;">''</span></pre></div></div>

<p>To be honest I did half of it with PhpLdapAdmin &#8211; you can tell those entries because of the vestigial &#8221;top&#8221; objectClass:</p>

<div class="wp_syntax"><div class="code"><pre class="ldif" style="font-family:monospace;">dn: dc=ombwa,dc=org
objectClass: dcObject
objectClass: organization
dc: ombwa
o: ombwa.org
&nbsp;
dn: ou=users,dc=ombwa,dc=org
objectClass: organizationalUnit
ou: users
&nbsp;
dn: uid=sam,ou=users,dc=ombwa,dc=org
uid: sam
userPassword::
objectClass: account
objectClass: simpleSecurityObject
&nbsp;
dn: ou=address books,dc=ombwa,dc=org
objectClass: organizationalUnit
objectClass: top
ou: address books
&nbsp;
dn: ou=Sams,ou=address books,dc=ombwa,dc=org
ou: Sams
objectClass: organizationalUnit
objectClass: top</pre></div></div>

<h3>Explanation</h3>
<p>Initially whenever I started locking down the ACLs at all, Evo would grey out most or all of the fields in the contact form.  Clearly it wasn&#8217;t happy with the schemas that it could find on the LDAP server.  Googling led me to discover the evolutionPerson objectclass, but the picture got clearer when I downloaded and examined the source:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #7a0874; font-weight: bold;">source</span> evolutuion
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #7a0874; font-weight: bold;">source</span> evolutuion-data-server</pre></div></div>

<p>In evolution-data-server-1.10.1/addressbook/backends/ldap/e-book-backend-ldap.c it says:</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/* the objectClasses we need */</span>
<span style="color: #339933;">#define TOP                  &quot;top&quot;</span>
<span style="color: #339933;">#define PERSON               &quot;person&quot;</span>
<span style="color: #339933;">#define ORGANIZATIONALPERSON &quot;organizationalPerson&quot;</span>
<span style="color: #339933;">#define INETORGPERSON        &quot;inetOrgPerson&quot;</span>
<span style="color: #339933;">#define CALENTRY             &quot;calEntry&quot;</span>
<span style="color: #339933;">#define EVOLUTIONPERSON      &quot;evolutionPerson&quot;</span>
<span style="color: #339933;">#define GROUPOFNAMES         &quot;groupOfNames&quot;</span></pre></div></div>

<p>I&#8217;m not doing calendaring yet, so I ignored calEntry.  Everything but evolutionPerson was installed by default.  After much Googling it turns out evolutionPerson schema is installed at with Evolution, at /usr/share/evolution-data-server-1.10/evolutionperson.schema.  I copied this to my LDAP server /etc/openldap/schema and added a line for it to slapd.conf.</p>
<p>This still didn&#8217;t help, however, which the ACLs issue.  After reading most of <a href="http://www.zytrax.com/books/ldap/">LDAP for Rocket Scientists</a> I figured out what is going on.  There is an &#8220;uber-object&#8221; called the RootDSE that contains meta-information about what the LDAP server serves.  It has an object under it called Subschema that allows the caller to see all the classes the LDAP server supports.  Evolution attempts to access these before authenticating, so you must have ACLs to support that.  Ironically the example ACLs in the top of the slapd.conf set this up.</p>
]]></content:encoded>
			<wfw:commentRss>http://sampierson.com/blog/system-administration/ldap-setting-up-an-address-book-that-evolution-likes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
