<?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>Christian&#039;s blog &#187; subversion</title>
	<atom:link href="http://blog.barfoo.org/tags/subversion/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.barfoo.org</link>
	<description>The usual IT babble</description>
	<lastBuildDate>Thu, 02 Sep 2010 04:45:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1-alpha</generator>
		<item>
		<title>Subversion via HTTP(s) and mod_rewrite</title>
		<link>http://blog.barfoo.org/2008/09/28/subversion-via-https-and-mod_rewrite/</link>
		<comments>http://blog.barfoo.org/2008/09/28/subversion-via-https-and-mod_rewrite/#comments</comments>
		<pubDate>Sun, 28 Sep 2008 19:17:01 +0000</pubDate>
		<dc:creator>Christian</dc:creator>
				<category><![CDATA[Life]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[mod_rewrite]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://blog.barfoo.org/?p=991</guid>
		<description><![CDATA[Well, I just finished my wild-goose chase with Apache and subversion regarding a rather weird error. I recently reinstalled our subversion box, and ever since then I was unable to commit anything new to any of the repositories. Subversion told me this: svn-client admin-scripts [1] > svn ci -m "Directories for Tivoli Storage Manager Scripts."]]></description>
			<content:encoded><![CDATA[<p>Well, I just finished my wild-goose chase with Apache and subversion regarding a rather weird error. I recently reinstalled our subversion box, and ever since then I was unable to commit anything new to any of the repositories.<br />
Subversion told me this:</p>
<pre lang="text">
svn-client admin-scripts [1] > svn ci -m "Directories for Tivoli Storage Manager Scripts."
svn: Commit failed (details follow):
svn: MKACTIVITY of '/svn/admin-scripts/!svn/act/someid': 302 Found
</pre>
<p>Apache didn&#8217;t say much about it either, besides this particular line:</p>
<pre lang="text">
[25/Sep/2008:09:22:43 +0200] "MKACTIVITY /svn/admin-scripts/!svn/act/someid HTTP/1.1" 302 331
</pre>
<p>Today I sat down and thought really hard, what exactly was different from before.</p>
<ol>
<li>Installed Trac instead of Redmine, but that can&#8217;t have anything to do with the error</li>
<li>Configured URL rewriting &#8230;</li>
</ol>
<p><br/>As it turns out, the following RewriteRule was the cause:</p>
<pre lang="apache" line="1">
  ## mod_rewrite
  RewriteEngine On
  RewriteCond %{REQUEST_URI}  !^/(projects|svn)* [NC]
  RewriteRule ^/  http://subversion.home.barfoo.org/projects [L,R]
</pre>
<p>After changing the Rewrite Rule (as showed below, compare the difference yourself <img src='http://blog.barfoo.org/wp-includes/images/smilies/icon_razz.gif' alt=':-P' class='wp-smiley' />  ), it works just like a charm.</p>
<pre lang="apache" line="1">
  ## mod_rewrite
  RewriteEngine On
  RewriteCond %{REQUEST_URI}  !^/(projects|svn)/*$ [NC]
  RewriteRule ^/$  http://subversion.home.barfoo.org/projects [L,R]
</pre>
<p><strong>Hint to self</strong>: whenever encountering <em>HTTP 302</em> in conjunction with Subversion, check the RewriteRule&#8217;s <img src='http://blog.barfoo.org/wp-includes/images/smilies/icon_exclaim.gif' alt=':!:' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.barfoo.org/2008/09/28/subversion-via-https-and-mod_rewrite/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>subversion on WebDAV with Active Directory authorization on SLES10</title>
		<link>http://blog.barfoo.org/2008/06/29/subversion-on-webdav-with-active-directory-authorization-on-sles10/</link>
		<comments>http://blog.barfoo.org/2008/06/29/subversion-on-webdav-with-active-directory-authorization-on-sles10/#comments</comments>
		<pubDate>Sun, 29 Jun 2008 17:49:29 +0000</pubDate>
		<dc:creator>Christian</dc:creator>
				<category><![CDATA[Life]]></category>
		<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[SLES10]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://blog.barfoo.org/?p=425</guid>
		<description><![CDATA[Okay, so I ended up toying with subversion via WebDAV on SLES today (I know, I know .. it&#8217;s bloody Sunday). It wasn&#8217;t much of a hassle though, after reading this. Sure, I made a few errors at first (simply confused the logic behind &#8220;Location&#8221; and &#8220;Directory&#8220;), but after that plain subversion commits via WebDAV]]></description>
			<content:encoded><![CDATA[<p>Okay, so I ended up toying with subversion via WebDAV on SLES today (I know, I know .. it&#8217;s bloody Sunday). It wasn&#8217;t much of a hassle though, after reading this. Sure, I made a few errors at first (simply confused the logic behind &#8220;<em><a href="http://httpd.apache.org/docs/2.2/mod/core.html#location">Location</a></em>&#8221; and &#8220;<em><a href="http://httpd.apache.org/docs/2.2/mod/core.html#directory">Directory</a></em>&#8220;), but after that plain subversion commits via WebDAV (thus utilizing apache) worked fine.</p>
<p>For POC or as a hint to myself, here&#8217;s where and what I needed to add/change:</p>
<p>Add the following modules to <strong><em>APACHE_MODULES</em></strong> in <em>/etc/sysconfig/apache2</em>:</p>
<ol>
<li>dav_svn (dav_svn needs dav, thus the need to add it too)</li>
<li><a href="http://httpd.apache.org/docs/2.2/mod/mod_dav.html">dav</a></li>
<li><a href="http://httpd.apache.org/docs/2.2/mod/mod_authnz_ldap.html">authnz_ldap</a> (authnz_ldap needs ldap, so again we need that too!)</li>
<li><a href="http://httpd.apache.org/docs/2.2/mod/mod_ldap.html">ldap</a></li>
</ol>
<p>After that, we can add our repository (or our multi-repository folder) to <em>/etc/apache2/conf.d/subversion.conf</em>:</p>
<pre lang="apache" line="1">
<IfModule mod_dav_svn.c>

<Location /svn>
  DAV svn
  SVNParentPath /srv/svn

  # Limit write permission to list of valid users.
  <LimitExcept GET PROPFIND OPTIONS REPORT>
    # Require SSL connection for password protection.
    # SSLRequireSSL

    AuthType Basic
    AuthName "Subversion repositories (Domänenzugangsdaten)"

    # The authentification provider is mod_ldap
    AuthBasicProvider ldap

    # mod_ldap is our *only* authentification provider for this!
    AuthzLDAPAuthoritative on

    # AD requires an authentication DN to access any records
    AuthLDAPBindDN "CN=LDAP Subversion,OU=anon_accounts,OU=Users,DC=foobar,DC=org"
    AuthLDAPBindPassword "somethingrandom"

    # The URL to search in
    AuthLDAPURL "ldap://dc0.foobar.org/ou=Users,dc=foobar,dc=org?sAMAccountName?sub?(objectClass=*)"

    # Search the group membership in the specified group, otherwise it's gonna
    # get searched at the binding DN's location
    AuthLDAPGroupAttributeIsDN on
    Require ldap-group CN=gr_subversion,OU=Groups,DC=foobar,DC=org

  </LimitExcept>
</Location>
</pre>
<p>Now, as you can see, my goal was to not rely on a separate authorization database, but to use our already existing Active Directory at work. Generally this works just fine, but it didn&#8217;t. I tried various things, like trying another user, changing the group (as in the &#8220;<em><a href="http://httpd.apache.org/docs/2.2/mod/mod_authnz_ldap.html#reqgroup">require ldap-group</a></em>&#8220;) as well as changing my own password. Zip.</p>
<p>All I got was this line in the <em>error_log</em> of apache:</p>
<pre lang="text">
[warn] [client 10.0.0.148] [9486] auth_ldap authenticate: user foo authentication failed; URI /svn/admin-scripts/!svn/act/71f2b65f-d050-0410-b33c-3b31fbb94a00 [ldap_search_ext_s() for use
r failed][Operations error]</pre>
<p>Now, that itself does tell you what is happening, but not why. So again, I ended up googling till I found <a href="http://michele.pupazzo.org/diary/?p=227">this</a>:</p>
<p>The suggested step was to add &#8220;<strong><em>REFERRALS off</em></strong>&#8221; to <em>/etc/ldap/ldap.conf</em>. Surprise, the file don&#8217;t exist. Heck, there&#8217;s that one in <em>/etc/ldap.conf</em>. I did that, still zip.</p>
<p>Did I get the wrong file ? Absolutely. </p>
<p><em>/etc/ldap.conf</em> is used by <strong>nsswitch</strong> and <strong>pam_ldap</strong>, but not by <strong>openldap2</strong> (which is what apache is using). So reading <a href="http://michele.pupazzo.org/diary/?p=227#comment-82">this comment</a>, adding the line to /etc/openldap2/ldap.conf, and <strong>*kaching*</strong>! Works.</p>
<p>Now I just need to install <a href="http://www.redmine.org/">redmine</a> (already installed ruby, rubygems and rubygem-rails from the SDK Addon), but I&#8217;ll leave that for tommorow, today I&#8217;m gonna watch <em><a href="http://en.wikipedia.org/wiki/Band_of_brothers">Band of Brothers</a></em>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.barfoo.org/2008/06/29/subversion-on-webdav-with-active-directory-authorization-on-sles10/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
