<?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>Freya.no &#187; apache</title>
	<atom:link href="http://wp.freya.no/tag/apache/feed/" rel="self" type="application/rss+xml" />
	<link>http://wp.freya.no</link>
	<description>Knowledge is power</description>
	<lastBuildDate>Mon, 06 Feb 2012 19:56:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Subversion + SVN::Notify + Apache 2.2.x + mod_auth</title>
		<link>http://wp.freya.no/subversion/subversion-svnnotify-apache-22x-mod_auth/</link>
		<comments>http://wp.freya.no/subversion/subversion-svnnotify-apache-22x-mod_auth/#comments</comments>
		<pubDate>Fri, 30 Jan 2009 21:54:01 +0000</pubDate>
		<dc:creator>kent</dc:creator>
				<category><![CDATA[Dev]]></category>
		<category><![CDATA[Tip]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[gentoo]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[subversion]]></category>

		<guid isPermaLink="false">http://wp.freya.no/?p=220</guid>
		<description><![CDATA[This is a brief guide on how to set up Subversion with Trac on Apache with commit-mails sent with SVN::Notify Perl module. First of all, we need to install some software. # emerge -av subversion apache When everythin has installed fine, continue. Create a repository somewhere. # cd /var/svn/ # svnadmin create test # ll [...]
No related posts.]]></description>
			<content:encoded><![CDATA[<p>This is a brief guide on how to set up Subversion with Trac on Apache with commit-mails sent with SVN::Notify Perl module.</p>
<p>First of all, we need to install some software.</p>
<pre># emerge -av subversion apache</pre>
<p>When everythin has installed fine, continue.</p>
<p>Create a repository somewhere.</p>
<pre># cd /var/svn/
# svnadmin create test
# ll
drwxr-xr-x  6 root   root   4.0K 2009-01-30 12:56 test</pre>
<p>Change the permissions to apache:apache and rights 770:</p>
<pre># chown apache:apache test -R &amp;&amp; chmod 770 test -R
# ll
drwxrwx---  6 apache apache 4.0K 2009-01-30 12:56 test</pre>
<p>Our repository root is at /var/svn/test and our Subversion root is /var/svn.</p>
<p>Two more files are needed if you are doing HTTP Authentication, /var/svn/htpasswd and /var/svn/authz.</p>
<p>Create the htpasswd file with htpasswd2.</p>
<pre># htpasswd2 -c htpasswd username</pre>
<p>The authz file looks like this (with the defaults).</p>
<pre>[groups]
# harry_and_sally = harry,sally

[/]
username = rw
* =

# [repository:/baz/fuz]
# @harry_and_sally = rw
# * = r</pre>
<p>Our next step is to configure Apache to work with Subversion.</p>
<p>Open up/etc/conf.d/apache2 and make sure APACHE2_OPTS contains &#8220;-D SVN -D SVN_AUTHZ -D PHP5 -D DAV&#8221;.</p>
<p>If you&#8217;re doing a SVN repository with authentication, I&#8217;d advise you to use SVN over SSL (HTTPS).</p>
<p>If we want to use svn.example.com as our Subversion repository URL, our Apache config should look like:</p>
<pre>&lt;VirtualHost *:443&gt;
    ServerName svn.example.com
    #Include /etc/apache2/vhosts.d/default_vhost.include
    ErrorLog /var/log/apache2/ssl_error_log

    &lt;IfModule log_config_module&gt;
        TransferLog /var/log/apache2/ssl_access_log
    &lt;/IfModule&gt;

    &lt;Location /&gt;
        AuthType Basic
        AuthName "Subversion repository and Trac"
        AuthUserFile /var/svn/htpasswd
        Require valid-user
        SSLRequireSSL

        DAV svn
        SVNParentPath /var/svn/
        BrowserMatch "SVN" redirect-carefull
        AuthzSVNAccessFile  /var/svn/authz
        SVNListParentPath on
    &lt;/Location&gt;

    DocumentRoot "/var/www/localhost/htdocs"
&lt;/VirtualHost&gt;</pre>
<p>If everything is successful, you&#8217;ll be able to access your subversion repository at https://svn.example.com/test.</p>
<p>Final touch is the Perl module SVN::Notify. Fire up CPAN.</p>
<pre># cpan

cpan shell -- CPAN exploration and modules installation (v1.9301)
ReadLine support enabled

cpan[1]&gt; install SVN::Notify
cpan[2]&gt; install HTML::Entities</pre>
<p>Enter your SVN hooks directory.</p>
<pre># cd /var/svn/test/hooks</pre>
<p>And copy the post commit template to post commit.</p>
<pre># cp post-commit.tmpl post-commit
# vim post-commit</pre>
<p>Make sure the following lines are present:</p>
<pre>REPOS="$1"
REV="$2"

export LANG="nb_NO.UTF-8" # optional
/usr/bin/svnnotify --repos-path "/var/svn/test" --revision "$REV" --svnlook /usr/bin/svnlook --sendmail /usr/sbin/sendmail --to <span id="emob-znvy@rknzcyr.pbz-28">mail {at} example(.)com</span><script type="text/javascript">
    var mailNode = document.getElementById('emob-znvy@rknzcyr.pbz-28');
    var linkNode = document.createElement('a');
    linkNode.setAttribute('href', "mailto:%6D%61%69%6C%40%65%78%61%6D%70%6C%65%2E%63%6F%6D");
    tNode = document.createTextNode("mail {at} example(.)com");
    linkNode.appendChild(tNode);
    linkNode.setAttribute('id', "emob-znvy@rknzcyr.pbz-28");
    mailNode.parentNode.replaceChild(linkNode, mailNode);
</script> --from <span id="emob-fia@rknzcyr.pbz-85">svn {at} example(.)com</span><script type="text/javascript">
    var mailNode = document.getElementById('emob-fia@rknzcyr.pbz-85');
    var linkNode = document.createElement('a');
    linkNode.setAttribute('href', "mailto:%73%76%6E%40%65%78%61%6D%70%6C%65%2E%63%6F%6D");
    tNode = document.createTextNode("svn {at} example(.)com");
    linkNode.appendChild(tNode);
    linkNode.setAttribute('id', "emob-fia@rknzcyr.pbz-85");
    mailNode.parentNode.replaceChild(linkNode, mailNode);
</script> --with-diff --reply-to <span id="emob-ab-ercyl@rknzcyr.pbz-40">no-reply {at} example(.)com</span><script type="text/javascript">
    var mailNode = document.getElementById('emob-ab-ercyl@rknzcyr.pbz-40');
    var linkNode = document.createElement('a');
    linkNode.setAttribute('href', "mailto:%6E%6F%2D%72%65%70%6C%79%40%65%78%61%6D%70%6C%65%2E%63%6F%6D");
    tNode = document.createTextNode("no-reply {at} example(.)com");
    linkNode.appendChild(tNode);
    linkNode.setAttribute('id', "emob-ab-ercyl@rknzcyr.pbz-40");
    mailNode.parentNode.replaceChild(linkNode, mailNode);
</script> --linkize --handler HTML::ColorDiff --smtp localhost --svn-encoding "UTF-8"</pre>
<p>Whenever someone does a commit, a mail with the colored diff is sent out to the recipients.</p>
 <img src="http://wp.freya.no/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=220" width="1" height="1" style="display: none;" /><p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwp.freya.no%2Fsubversion%2Fsubversion-svnnotify-apache-22x-mod_auth%2F&amp;title=Subversion%20%2B%20SVN%3A%3ANotify%20%2B%20Apache%202.2.x%20%2B%20mod_auth" id="wpa2a_6"><img src="http://wp.freya.no/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://wp.freya.no/subversion/subversion-svnnotify-apache-22x-mod_auth/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

