<?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>x2on.de &#187; Apache</title>
	<atom:link href="http://www.x2on.de/tag/apache/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.x2on.de</link>
	<description>by Felix Schulze - a mobile evangelist. Tutorials for iOS, Android, Mac, Linux, iPhone and more...</description>
	<lastBuildDate>Sun, 29 Jan 2012 18:46:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Tutorial: Redmine with Git and Gitosis on Ubuntu 11.04</title>
		<link>http://www.x2on.de/2011/04/23/tutorial-redmine-with-git-and-gitosis-on-ubuntu-11-04/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=tutorial-redmine-with-git-and-gitosis-on-ubuntu-11-04</link>
		<comments>http://www.x2on.de/2011/04/23/tutorial-redmine-with-git-and-gitosis-on-ubuntu-11-04/#comments</comments>
		<pubDate>Sat, 23 Apr 2011 08:03:40 +0000</pubDate>
		<dc:creator>Felix Schulze</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[11.04]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[Git]]></category>
		<category><![CDATA[Gitosis]]></category>
		<category><![CDATA[Passenger]]></category>
		<category><![CDATA[Redmine]]></category>
		<category><![CDATA[Repository]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[vServer]]></category>

		<guid isPermaLink="false">http://www.x2on.de/?p=776</guid>
		<description><![CDATA[This is a tutorial for installing redmine on Ubuntu 11.04 with Git integration, managed by Gitosis and a redmine gitosis plugin. It&#8217;s based on my last tutorial about installing redmine ob Ubuntu 8.04: http://www.x2on.de/2010/10/30/tutorial-redmine-with-svn-git-and-gitosis-on-ubuntu-8-04/ 1. Install redmine Get recent version from github (currently 1.1.3) apt-get install git-core mkdir /var/www cd /var/www git clone git://github.com/edavis10/redmine.git cd [...]]]></description>
			<content:encoded><![CDATA[<p>This is a tutorial for installing redmine on Ubuntu 11.04 with Git integration, managed by Gitosis and a redmine gitosis plugin.</p>
<p>It&#8217;s based on my last tutorial about installing redmine ob Ubuntu 8.04: <a href="http://www.x2on.de/2010/10/30/tutorial-redmine-with-svn-git-and-gitosis-on-ubuntu-8-04/">http://www.x2on.de/2010/10/30/tutorial-redmine-with-svn-git-and-gitosis-on-ubuntu-8-04/</a></p>
<h2>1. Install redmine</h2>
<p>Get recent version from github (currently 1.1.3)<br />
<span id="more-776"></span></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> git-core
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www
<span style="color: #c20cb9; font-weight: bold;">git</span> clone <span style="color: #c20cb9; font-weight: bold;">git</span>:<span style="color: #000000; font-weight: bold;">//</span>github.com<span style="color: #000000; font-weight: bold;">/</span>edavis10<span style="color: #000000; font-weight: bold;">/</span>redmine.git
<span style="color: #7a0874; font-weight: bold;">cd</span> redmine
<span style="color: #c20cb9; font-weight: bold;">git</span> checkout <span style="color: #660033;">-b</span> 1.1.3 1.1.3</pre></div></div>

<p>Install packages</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> ruby  ruby1.9.1-dev libgemplugin-ruby libgemplugin-ruby1.8  mysql-server apache2-mpm-prefork <span style="color: #c20cb9; font-weight: bold;">wget</span> libruby-extras libruby1.8-extras rake apache2-prefork-dev libapache-dbi-perl libapache2-mod-perl2 libdigest-sha1-perl libmysqlclient15-dev build-essential libcurl4-openssl-dev cron</pre></div></div>

<p>If you like to use Gant-Charts:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> librmagick-ruby1.8</pre></div></div>

<p>Create database</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">mysql <span style="color: #660033;">-u</span> root <span style="color: #660033;">-p</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">DATABASE</span> redmine <span style="color: #993333; font-weight: bold;">CHARACTER</span> <span style="color: #993333; font-weight: bold;">SET</span> utf8;
<span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">USER</span> <span style="color: #ff0000;">'redmine'</span>@<span style="color: #ff0000;">'localhost'</span> <span style="color: #993333; font-weight: bold;">IDENTIFIED</span> <span style="color: #993333; font-weight: bold;">BY</span> <span style="color: #ff0000;">'my_password'</span>;
<span style="color: #993333; font-weight: bold;">GRANT</span> <span style="color: #993333; font-weight: bold;">ALL</span> privileges <span style="color: #993333; font-weight: bold;">ON</span> redmine<span style="color: #66cc66;">.*</span> <span style="color: #993333; font-weight: bold;">TO</span> <span style="color: #ff0000;">'redmine'</span>@<span style="color: #ff0000;">'localhost'</span>;</pre></div></div>

<p>Configure Database Settings</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">cp</span> redmine<span style="color: #000000; font-weight: bold;">/</span>config<span style="color: #000000; font-weight: bold;">/</span>database.yml.example redmine<span style="color: #000000; font-weight: bold;">/</span>config<span style="color: #000000; font-weight: bold;">/</span>database.yml</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">nano</span> redmine<span style="color: #000000; font-weight: bold;">/</span>config<span style="color: #000000; font-weight: bold;">/</span>database.yml</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">production:
  adapter: mysql
  database: redmine
  host: localhost
  username: redmine
  password: my_password
  encoding: utf8</pre></div></div>

<p>Install Rubygem (Ubuntu 11.04 has an older version)</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>production.cf.rubygems.org<span style="color: #000000; font-weight: bold;">/</span>rubygems<span style="color: #000000; font-weight: bold;">/</span>rubygems-1.7.2.tgz
<span style="color: #c20cb9; font-weight: bold;">tar</span> xvfz rubygems-1.7.2.tgz
<span style="color: #7a0874; font-weight: bold;">cd</span> rubygems-1.7.2
<span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>gem <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>gem-ubuntu
ruby setup.rb
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>gem1.8 <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>gem</pre></div></div>

<p>Install Rails + Rack</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">gem <span style="color: #c20cb9; font-weight: bold;">install</span> rails <span style="color: #660033;">-v</span>=2.3.11
gem <span style="color: #c20cb9; font-weight: bold;">install</span> rack <span style="color: #660033;">-v</span>=1.1.0
gem <span style="color: #c20cb9; font-weight: bold;">install</span> mysql
gem <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #660033;">-v</span>=0.4.2 i18n</pre></div></div>

<p>Configure redmine</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>redmine
<span style="color: #c20cb9; font-weight: bold;">chown</span> <span style="color: #660033;">-R</span> www-data:www-data files log tmp public<span style="color: #000000; font-weight: bold;">/</span>plugin_assets
<span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #660033;">-R</span> <span style="color: #000000;">755</span> files log tmp public<span style="color: #000000; font-weight: bold;">/</span>plugin_assets
<span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #660033;">-R</span> <span style="color: #000000;">777</span> public<span style="color: #000000; font-weight: bold;">/</span>plugin_assets
rake generate_session_store
<span style="color: #007800;">RAILS_ENV</span>=production rake db:migrate
<span style="color: #007800;">RAILS_ENV</span>=production rake redmine:load_default_data</pre></div></div>

<p>Test redmine</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">ruby script<span style="color: #000000; font-weight: bold;">/</span>server webrick <span style="color: #660033;">-e</span> production</pre></div></div>

<p>Now you can check http://my_domain.com:3000 if everything works</p>
<h2>2. Apache Integration</h2>
<p>Install passenger (Modify version numbers if needed)</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">gem <span style="color: #c20cb9; font-weight: bold;">install</span> passenger
passenger-install-apache2-module
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-3.0.7/ext/apache2/mod_passenger.so&quot;</span> <span style="color: #000000; font-weight: bold;">&amp;</span>gt; <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>mods-available<span style="color: #000000; font-weight: bold;">/</span>passenger.load
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>mods-available<span style="color: #000000; font-weight: bold;">/</span>passenger.load <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>mods-enabled<span style="color: #000000; font-weight: bold;">/</span>passenger.load</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">nano</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>mods-available<span style="color: #000000; font-weight: bold;">/</span>passenger.conf</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">PassengerRoot <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>ruby<span style="color: #000000; font-weight: bold;">/</span>gems<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">1.8</span><span style="color: #000000; font-weight: bold;">/</span>gems<span style="color: #000000; font-weight: bold;">/</span>passenger-3.0.7
PassengerRuby <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>ruby1.8</pre></div></div>

<p><strong>Alternative:</strong> You can install passenger with ubuntu:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> libapache2-mod-passenger</pre></div></div>

<p>Configure Apache</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">nano</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>sites-available<span style="color: #000000; font-weight: bold;">/</span>my_domain</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;</span>VirtualHost <span style="color: #000000; font-weight: bold;">*</span>:<span style="color: #000000;">80</span><span style="color: #000000; font-weight: bold;">&gt;</span>
    ServerName my_domain.com
&nbsp;
    DocumentRoot <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>redmine<span style="color: #000000; font-weight: bold;">/</span>public
&nbsp;
    PassengerDefaultUser www-data
    RailsEnv production
    RailsBaseURI <span style="color: #000000; font-weight: bold;">/</span>redmine
    SetEnv X_DEBIAN_SITEID <span style="color: #ff0000;">&quot;default&quot;</span>
    <span style="color: #000000; font-weight: bold;">&lt;</span>Directory <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>redmine<span style="color: #000000; font-weight: bold;">/</span>public<span style="color: #000000; font-weight: bold;">&gt;</span>
        Order allow,deny
        Allow from all
    <span style="color: #000000; font-weight: bold;">&lt;/</span>Directory<span style="color: #000000; font-weight: bold;">&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;/</span>VirtualHost<span style="color: #000000; font-weight: bold;">&gt;</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">nano</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>apache2.conf</pre></div></div>

<p>Add this at the end of the file:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">Include <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>mods-available<span style="color: #000000; font-weight: bold;">/</span>passenger.conf</pre></div></div>

<p>Activate your site</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>sites-available<span style="color: #000000; font-weight: bold;">/</span>my_domain <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>sites-enabled<span style="color: #000000; font-weight: bold;">/</span>my_domain</pre></div></div>

<p>Remove default entry</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>sites-enabled<span style="color: #000000; font-weight: bold;">/</span>000-default</pre></div></div>

<p>Restart Apache and it should work</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>apache2 restart</pre></div></div>

<h2>3. Git integration</h2>
<p>Install needed packages:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">gem <span style="color: #c20cb9; font-weight: bold;">install</span> inifile
<span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> libnet-ssh-ruby1.8 python-setuptools
gem <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #c20cb9; font-weight: bold;">lockfile</span> net-ssh
<span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> gitosis git-daemon-run acl</pre></div></div>

<p>Activate acl for your partition:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">nano</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>fstab</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">...
<span style="color: #007800;">UUID</span>=xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx <span style="color: #000000; font-weight: bold;">/</span>               ext4    acl,<span style="color: #007800;">errors</span>=remount-ro <span style="color: #000000;">0</span>       <span style="color: #000000;">1</span>
...</pre></div></div>

<p>Reboot your machine:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">reboot</pre></div></div>

<p>Configure gitosis:</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: #660033;">-H</span> <span style="color: #660033;">-u</span> gitosis <span style="color: #c20cb9; font-weight: bold;">ssh-keygen</span> <span style="color: #660033;">-t</span> dsa</pre></div></div>

<p>No Password, default file.</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: #660033;">-u</span> gitosis <span style="color: #c20cb9; font-weight: bold;">cat</span> ~gitosis<span style="color: #000000; font-weight: bold;">/</span>.ssh<span style="color: #000000; font-weight: bold;">/</span>id_dsa.pub <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #660033;">-H</span> <span style="color: #660033;">-u</span> gitosis gitosis-init
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> -i.orig <span style="color: #ff0000;">'s:/var/cache:/srv/gitosis:g'</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>sv<span style="color: #000000; font-weight: bold;">/</span>git-daemon<span style="color: #000000; font-weight: bold;">/</span>run
<span style="color: #c20cb9; font-weight: bold;">sudo</span> sv restart <span style="color: #c20cb9; font-weight: bold;">git-daemon</span></pre></div></div>

<p>Install gitosis plugin for redmine:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">setfacl <span style="color: #660033;">-m</span> user:www-data:r-x,mask:r-x ~gitosis<span style="color: #000000; font-weight: bold;">/</span>.ssh
setfacl <span style="color: #660033;">-m</span> user:www-data:r--,mask:r-- ~gitosis<span style="color: #000000; font-weight: bold;">/</span>.ssh<span style="color: #000000; font-weight: bold;">/</span>id_dsa</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>redmine
script<span style="color: #000000; font-weight: bold;">/</span>plugin <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #c20cb9; font-weight: bold;">git</span>:<span style="color: #000000; font-weight: bold;">//</span>github.com<span style="color: #000000; font-weight: bold;">/</span>xdissent<span style="color: #000000; font-weight: bold;">/</span>redmine_gitosis.git
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #660033;">-u</span> www-data <span style="color: #007800;">X_DEBIAN_SITEID</span>=default <span style="color: #007800;">RAILS_ENV</span>=production rake db:migrate:plugins
<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>apache2 restart</pre></div></div>

<p>Open your Browser, got to my_domain and login. Go to Administration &#8211; Plugins &#8211; Configure Redmine Gitosis plugin.<br />
Change localhost to my_domain.<br />
Change xdissent.com to my_domain.</p>
<p><strong>Have fun!</strong></p>
<h3>Source:</h3>
<p><a href="http://brantinteractive.com/2007/02/16/getting-the-mysql-gem-installed-on-ubuntu/ " target="_blank"> http://brantinteractive.com/2007/02/16/getting-the-mysql-gem-installed-on-ubuntu/<br />
</a><a href="http://www.redmine.org/wiki/1/RedmineInstall" target="_blank"> http://www.redmine.org/wiki/1/RedmineInstall</a><br />
<a href="http://wiki.ousli.org/index.php/Redmine_in_Ubuntu_Jaunty_9.04" target="_blank"> http://wiki.ousli.org/index.php/Redmine_in_Ubuntu_Jaunty_9.04</a><br />
<a href="http://www.redmine.org/wiki/1/HowTo_Install_Redmine_in_Ubuntu" target="_blank"> http://www.redmine.org/wiki/1/HowTo_Install_Redmine_in_Ubuntu</a><br />
<a href="http://www.redmine.org/wiki/redmine/Repositories_access_control_with_apache_mod_dav_svn_and_mod_perl " target="_blank"> http://www.redmine.org/wiki/redmine/Repositories_access_control_with_apache_mod_dav_svn_and_mod_perl<br />
</a><a href="http://xdissent.com/2010/05/04/github-clone-with-redmine/ " target="_blank"> http://xdissent.com/2010/05/04/github-clone-with-redmine/<br />
</a><a href="http://dev.remarkablewit.com/redmine/projects/dev-server/wiki" target="">http://dev.remarkablewit.com/redmine/projects/dev-server/wiki</a><a href="http://xdissent.com/2010/05/04/github-clone-with-redmine/ " target="_blank"><br />
</a><a href="https://github.com/xdissent/redmine_gitosis" target="">https://github.com/xdissent/redmine_gitosis</a><a href="http://xdissent.com/2010/05/04/github-clone-with-redmine/ " target="_blank"><br />
</a><a href="http://www.redmine.org/issues/2525" target="">http://www.redmine.org/issues/2525</a><a href="http://xdissent.com/2010/05/04/github-clone-with-redmine/ " target="_blank"><br />
</a><a href="http://wiki.ubuntuusers.de/acl" target="_blank">http://wiki.ubuntuusers.de/acl</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.x2on.de/2011/04/23/tutorial-redmine-with-git-and-gitosis-on-ubuntu-11-04/feed/</wfw:commentRss>
		<slash:comments>67</slash:comments>
		</item>
		<item>
		<title>Tutorial: Redmine with SVN, Git and Gitosis on Ubuntu 8.04</title>
		<link>http://www.x2on.de/2010/10/30/tutorial-redmine-with-svn-git-and-gitosis-on-ubuntu-8-04/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=tutorial-redmine-with-svn-git-and-gitosis-on-ubuntu-8-04</link>
		<comments>http://www.x2on.de/2010/10/30/tutorial-redmine-with-svn-git-and-gitosis-on-ubuntu-8-04/#comments</comments>
		<pubDate>Sat, 30 Oct 2010 07:54:24 +0000</pubDate>
		<dc:creator>Felix Schulze</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[8.04]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[Git]]></category>
		<category><![CDATA[Gitosis]]></category>
		<category><![CDATA[LTS]]></category>
		<category><![CDATA[Passenger]]></category>
		<category><![CDATA[Redmine]]></category>
		<category><![CDATA[Repository]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[vServer]]></category>

		<guid isPermaLink="false">http://www.x2on.de/?p=643</guid>
		<description><![CDATA[This is a tutorial for installing redmine on Ubuntu 8.04 with SVN and Git integration (managed by Gitosis and a redmine gitosis plugin). UPDATE #1 &#8211; 2011-04-23: New Tutorial for Redmine with Git and Gitosis on Ubuntu 11.04:http://www.x2on.de/2011/04/23/tutorial-redmine-with-git-and-gitosis-on-ubuntu-11-04/ 1. Install redmine Get recent trunk version from github (currently 1.02) apt-get install git-core mkdir /var/www cd [...]]]></description>
			<content:encoded><![CDATA[<p>This is a tutorial for installing redmine on Ubuntu 8.04 with SVN and Git integration (managed by Gitosis and a redmine gitosis plugin).</p>
<p>UPDATE #1 &#8211; 2011-04-23: New Tutorial for Redmine with Git and Gitosis on Ubuntu 11.04:<a href="http://www.x2on.de/2011/04/23/tutorial-redmine-with-git-and-gitosis-on-ubuntu-11-04/">http://www.x2on.de/2011/04/23/tutorial-redmine-with-git-and-gitosis-on-ubuntu-11-04/</a></p>
<h2>1. Install redmine</h2>
<p>Get recent trunk version from github (currently 1.02)</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> git-core
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www
<span style="color: #c20cb9; font-weight: bold;">git</span> clone <span style="color: #c20cb9; font-weight: bold;">git</span>:<span style="color: #000000; font-weight: bold;">//</span>github.com<span style="color: #000000; font-weight: bold;">/</span>edavis10<span style="color: #000000; font-weight: bold;">/</span>redmine.git</pre></div></div>

<p>Install packages</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> ruby ruby1.8-dev libgemplugin-ruby libgemplugin-ruby1.8  mysql-server apache2-mpm-prefork <span style="color: #c20cb9; font-weight: bold;">wget</span> libruby-extras libruby1.8-extras rails subversion rake apache2-prefork-dev libapache-dbi-perl libapache2-mod-perl2 libdigest-sha1-perl libapache2-svn libmysqlclient15-dev build-essential libcurl4-openssl-dev cron</pre></div></div>

<p>Create database</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">mysql <span style="color: #660033;">-u</span> root <span style="color: #660033;">-p</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">DATABASE</span> redmine <span style="color: #993333; font-weight: bold;">CHARACTER</span> <span style="color: #993333; font-weight: bold;">SET</span> utf8;
<span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">USER</span> <span style="color: #ff0000;">'redmine'</span>@<span style="color: #ff0000;">'localhost'</span> <span style="color: #993333; font-weight: bold;">IDENTIFIED</span> <span style="color: #993333; font-weight: bold;">BY</span> <span style="color: #ff0000;">'my_password'</span>;
<span style="color: #993333; font-weight: bold;">GRANT</span> <span style="color: #993333; font-weight: bold;">ALL</span> privileges <span style="color: #993333; font-weight: bold;">ON</span> redmine<span style="color: #66cc66;">.*</span> <span style="color: #993333; font-weight: bold;">TO</span> <span style="color: #ff0000;">'redmine'</span>@<span style="color: #ff0000;">'localhost'</span>;</pre></div></div>

<p>Configure Database Settings</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">cp</span> redmine<span style="color: #000000; font-weight: bold;">/</span>config<span style="color: #000000; font-weight: bold;">/</span>database.yml.example redmine<span style="color: #000000; font-weight: bold;">/</span>config<span style="color: #000000; font-weight: bold;">/</span>database.yml</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">nano</span> redmine<span style="color: #000000; font-weight: bold;">/</span>config<span style="color: #000000; font-weight: bold;">/</span>database.yml</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">production:
  adapter: mysql
  database: redmine
  host: localhost
  username: redmine
  password: 47w8t2938qfge2
  encoding: utf8</pre></div></div>

<p>Install Rubygem (Ubuntu 8.04 has an older version)</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>production.cf.rubygems.org<span style="color: #000000; font-weight: bold;">/</span>rubygems<span style="color: #000000; font-weight: bold;">/</span>rubygems-1.3.7.tgz
<span style="color: #c20cb9; font-weight: bold;">tar</span> xvfz rubygems-1.3.7.tgz
<span style="color: #7a0874; font-weight: bold;">cd</span> rubygems-1.3.7
ruby setup.rb
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>gem1.8 <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>gem</pre></div></div>

<p>Install Rails + Rack</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">gem <span style="color: #c20cb9; font-weight: bold;">install</span> rails <span style="color: #660033;">-v</span>=2.3.5
gem <span style="color: #c20cb9; font-weight: bold;">install</span> rack <span style="color: #660033;">-v</span>=1.0.1
gem <span style="color: #c20cb9; font-weight: bold;">install</span> mysql</pre></div></div>

<p>Configure redmine</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>redmine
<span style="color: #c20cb9; font-weight: bold;">chown</span> <span style="color: #660033;">-R</span> www-data:www-data files log tmp public<span style="color: #000000; font-weight: bold;">/</span>plugin_assets
<span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #660033;">-R</span> <span style="color: #000000;">755</span> files log tmp public<span style="color: #000000; font-weight: bold;">/</span>plugin_assets
rake generate_session_store
<span style="color: #007800;">RAILS_ENV</span>=production rake db:migrate
<span style="color: #007800;">RAILS_ENV</span>=production rake redmine:load_default_data</pre></div></div>

<p>Test redmine</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">ruby script<span style="color: #000000; font-weight: bold;">/</span>server webrick <span style="color: #660033;">-e</span> production</pre></div></div>

<p>Now you can check http://my_domain.com:3000 if everything works</p>
<h2>2. Apache Integration</h2>
<p>Install passenger (Modify version numbers if needed)</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">gem <span style="color: #c20cb9; font-weight: bold;">install</span> passenger
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-3.0.0/ext/apache2/mod_passenger.so&quot;</span> <span style="color: #000000; font-weight: bold;">&amp;</span>gt; <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>mods-available<span style="color: #000000; font-weight: bold;">/</span>passenger.load
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>mods-available<span style="color: #000000; font-weight: bold;">/</span>passenger.load <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>mods-enabled<span style="color: #000000; font-weight: bold;">/</span>passenger.load</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">nano</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>mods-available<span style="color: #000000; font-weight: bold;">/</span>passenger.conf</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">PassengerRoot <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>ruby<span style="color: #000000; font-weight: bold;">/</span>gems<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">1.8</span><span style="color: #000000; font-weight: bold;">/</span>gems<span style="color: #000000; font-weight: bold;">/</span>passenger-3.0.0
PassengerRuby <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>ruby1.8</pre></div></div>

<p>Configure Apache</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">nano</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>sites-available<span style="color: #000000; font-weight: bold;">/</span>my_domain</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">    ServerName my_domain.com
&nbsp;
    DocumentRoot <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>redmine<span style="color: #000000; font-weight: bold;">/</span>public
&nbsp;
    ServerAdmin user<span style="color: #000000; font-weight: bold;">@</span>example.com
    LogLevel warn
    ErrorLog <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>redmine_error
    CustomLog <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>redmine_access combined
&nbsp;
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">nano</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>apache2.conf</pre></div></div>

<p>Add this at the end of the file:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">Include <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>mods-available<span style="color: #000000; font-weight: bold;">/</span>passenger.conf</pre></div></div>

<p>Activate your site</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>sites-available<span style="color: #000000; font-weight: bold;">/</span>my_domain <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>sites-enabled<span style="color: #000000; font-weight: bold;">/</span>my_domain</pre></div></div>

<p>Remove default entry</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>sites-enabled<span style="color: #000000; font-weight: bold;">/</span>000-default</pre></div></div>

<p>Restart Apache and it should work</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>apache2 restart</pre></div></div>

<h2>3. Subversion integration</h2>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>redmine<span style="color: #000000; font-weight: bold;">/</span>extra<span style="color: #000000; font-weight: bold;">/</span>svn<span style="color: #000000; font-weight: bold;">/</span>Redmine.pm <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>perl5<span style="color: #000000; font-weight: bold;">/</span>Apache<span style="color: #000000; font-weight: bold;">/</span>Redmine.pm</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">nano</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>sites-available<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">svn</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"> <span style="color: #666666; font-style: italic;"># /svn location for users</span>
 PerlLoadModule Apache::Redmine
&nbsp;
   DAV <span style="color: #c20cb9; font-weight: bold;">svn</span>
   SVNParentPath <span style="color: #ff0000;">&quot;/var/repos/svn&quot;</span>
   Order deny,allow
   Deny from all
   Satisfy any
&nbsp;
   PerlAccessHandler Apache::Authn::Redmine::access_handler
   PerlAuthenHandler Apache::Authn::Redmine::authen_handler
   AuthType Basic
   AuthName <span style="color: #ff0000;">&quot;Redmine SVN Repository&quot;</span> 
&nbsp;
   <span style="color: #666666; font-style: italic;">#read-only access</span>
&nbsp;
      Require valid-user
      Allow from my_domain.com
      Allow from localhost
       Satisfy any
&nbsp;
   <span style="color: #666666; font-style: italic;"># write access</span>
     Require valid-user
&nbsp;
   <span style="color: #666666; font-style: italic;">## Mysql-Settings</span>
   RedmineDSN <span style="color: #ff0000;">&quot;DBI:mysql:database=redmine;host=localhost&quot;</span>
   RedmineDbUser <span style="color: #ff0000;">&quot;redmine&quot;</span>
   RedmineDbPass <span style="color: #ff0000;">&quot;my_password&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#Security:</span>
&nbsp;
      Order deny,allow
      Allow from localhost
      Allow from my_domain.com
      Deny from all</pre></div></div>

<p>&nbsp;</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>sites-available<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">svn</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>sites-enabled<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">svn</span>
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>repos<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">svn</span>
<span style="color: #c20cb9; font-weight: bold;">chown</span> <span style="color: #660033;">-R</span> www-data:www-data <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>repos
<span style="color: #c20cb9; font-weight: bold;">chmod</span> 0750 <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>repos<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">svn</span></pre></div></div>

<p>Go to Administration &#8211; Settings &#8211; Repositories on your redmine site and enable &#8220;WS for repository management&#8221;. Then generate an API key.</p>
<p>Test the automatic generation:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">ruby <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>redmine<span style="color: #000000; font-weight: bold;">/</span>extra<span style="color: #000000; font-weight: bold;">/</span>svn<span style="color: #000000; font-weight: bold;">/</span>reposman.rb <span style="color: #660033;">--redmine</span> my_domain.com <span style="color: #660033;">--svn-dir</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>repos<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">svn</span> <span style="color: #660033;">--owner</span> www-data <span style="color: #660033;">--url</span> http:<span style="color: #000000; font-weight: bold;">//</span>my_domain.com<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">svn</span> <span style="color: #660033;">--verbose</span> <span style="color: #660033;">--key</span>=my_api_key</pre></div></div>

<p>If everything works create an crontab for this:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">nano</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>cron.d<span style="color: #000000; font-weight: bold;">/</span>redmine</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000;">10</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span> root ruby <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>redmine<span style="color: #000000; font-weight: bold;">/</span>extra<span style="color: #000000; font-weight: bold;">/</span>svn<span style="color: #000000; font-weight: bold;">/</span>reposman.rb <span style="color: #660033;">--redmine</span> my_domain.com <span style="color: #660033;">--svn-dir</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>repos<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">svn</span> <span style="color: #660033;">--owner</span> www-data <span style="color: #660033;">--url</span> http:<span style="color: #000000; font-weight: bold;">//</span>my_domain.com<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">svn</span> <span style="color: #660033;">--verbose</span> <span style="color: #660033;">--key</span>=my_api_key</pre></div></div>

<p>Now you are ready to use SVN with redmine</p>
<h2>4. Git integration</h2>
<p>Install needed packages:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">gem <span style="color: #c20cb9; font-weight: bold;">install</span> inifile
<span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> libnet-ssh-ruby1.8 python-setuptools
gem <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #c20cb9; font-weight: bold;">lockfile</span>
easy_install pip
pip <span style="color: #c20cb9; font-weight: bold;">install</span> virtualenv</pre></div></div>

<p>Add an user for gitosis:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">adduser <span style="color: #660033;">--system</span> <span style="color: #660033;">--shell</span> <span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">bash</span> <span style="color: #660033;">--gecos</span> <span style="color: #ff0000;">'Git Administrator'</span> <span style="color: #660033;">--group</span> <span style="color: #660033;">--disabled-password</span> <span style="color: #660033;">--home</span> <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>gitosis <span style="color: #c20cb9; font-weight: bold;">git</span></pre></div></div>

<p>Create an ssh-key (with empty passphrase):</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: #660033;">-H</span> <span style="color: #660033;">-u</span> <span style="color: #c20cb9; font-weight: bold;">git</span> <span style="color: #c20cb9; font-weight: bold;">ssh-keygen</span> <span style="color: #660033;">-t</span> dsa</pre></div></div>

<p>Create an Virtual Environment for python and install gitosis:</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: #660033;">-u</span> <span style="color: #c20cb9; font-weight: bold;">git</span> virtualenv ~git<span style="color: #000000; font-weight: bold;">/</span>virtualenv
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #660033;">-u</span> <span style="color: #c20cb9; font-weight: bold;">git</span> ~git<span style="color: #000000; font-weight: bold;">/</span>virtualenv<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>pip <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #c20cb9; font-weight: bold;">git</span>+<span style="color: #c20cb9; font-weight: bold;">git</span>:<span style="color: #000000; font-weight: bold;">//</span>eagain.net<span style="color: #000000; font-weight: bold;">/</span>gitosis.git
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;source <span style="color: #007800;">$HOME</span>/virtualenv/bin/activate&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #660033;">-u</span> <span style="color: #c20cb9; font-weight: bold;">git</span> <span style="color: #c20cb9; font-weight: bold;">tee</span> <span style="color: #660033;">-a</span> ~git<span style="color: #000000; font-weight: bold;">/</span>.bashrc <span style="color: #000000; font-weight: bold;">&amp;</span>gt; <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #660033;">-u</span> <span style="color: #c20cb9; font-weight: bold;">git</span> <span style="color: #c20cb9; font-weight: bold;">cat</span> ~git<span style="color: #000000; font-weight: bold;">/</span>.ssh<span style="color: #000000; font-weight: bold;">/</span>id_dsa.pub <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #660033;">-H</span> <span style="color: #660033;">-u</span> <span style="color: #c20cb9; font-weight: bold;">git</span> ~git<span style="color: #000000; font-weight: bold;">/</span>virtualenv<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>gitosis-init</pre></div></div>

<p>Install redmine-gitosis plugin:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>redmine<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #c20cb9; font-weight: bold;">chown</span> <span style="color: #660033;">-R</span> www-data:www-data <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>redmine
script<span style="color: #000000; font-weight: bold;">/</span>plugin <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #c20cb9; font-weight: bold;">git</span>:<span style="color: #000000; font-weight: bold;">//</span>github.com<span style="color: #000000; font-weight: bold;">/</span>rocket-rentals<span style="color: #000000; font-weight: bold;">/</span>redmine-gitosis.git</pre></div></div>

<p>Patch the plugin:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">nano</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>redmine<span style="color: #000000; font-weight: bold;">/</span>vendor<span style="color: #000000; font-weight: bold;">/</span>plugins<span style="color: #000000; font-weight: bold;">/</span>redmine-gitosis<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>gitosis.rb</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">require <span style="color: #ff0000;">'lockfile'</span>
require <span style="color: #ff0000;">'inifile'</span>
require <span style="color: #ff0000;">'net/ssh'</span>
&nbsp;
module Gitosis
  <span style="color: #666666; font-style: italic;"># server config</span>
  GITOSIS_URI = <span style="color: #ff0000;">'git@my_domain.com:gitosis-admin.git'</span>
  GITOSIS_BASE_PATH = <span style="color: #ff0000;">'/opt/gitosis/repositories/'</span>
&nbsp;
  <span style="color: #666666; font-style: italic;"># commands</span>
  ENV<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">'GIT_SSH'</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> = SSH_WITH_IDENTITY_FILE = File.join<span style="color: #7a0874; font-weight: bold;">&#40;</span>RAILS_ROOT, <span style="color: #ff0000;">'vendor/plugins/redmine-gitosis/extra/ssh_with_identity_file.sh'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></div></div>

<p>Configure SSH:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>.ssh
<span style="color: #c20cb9; font-weight: bold;">chown</span> <span style="color: #660033;">-R</span> www-data:www-data <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>.ssh
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #660033;">-u</span> www-data <span style="color: #c20cb9; font-weight: bold;">ssh</span> my_domain.com</pre></div></div>

<p>Migrate plugin:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">rake db:migrate_plugins <span style="color: #007800;">RAILS_ENV</span>=production</pre></div></div>

<p>Remove standard ssh-key and change it to the created one:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>redmine<span style="color: #000000; font-weight: bold;">/</span>vendor<span style="color: #000000; font-weight: bold;">/</span>plugins<span style="color: #000000; font-weight: bold;">/</span>redmine-gitosis<span style="color: #000000; font-weight: bold;">/</span>extra<span style="color: #000000; font-weight: bold;">/</span>ssh<span style="color: #000000; font-weight: bold;">/</span>private_key
<span style="color: #c20cb9; font-weight: bold;">cp</span> ~git<span style="color: #000000; font-weight: bold;">/</span>.ssh<span style="color: #000000; font-weight: bold;">/</span>id_dsa <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>redmine<span style="color: #000000; font-weight: bold;">/</span>vendor<span style="color: #000000; font-weight: bold;">/</span>plugins<span style="color: #000000; font-weight: bold;">/</span>redmine-gitosis<span style="color: #000000; font-weight: bold;">/</span>extra<span style="color: #000000; font-weight: bold;">/</span>ssh<span style="color: #000000; font-weight: bold;">/</span>private_key
<span style="color: #c20cb9; font-weight: bold;">chown</span> <span style="color: #660033;">-R</span> www-data:www-data <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>redmine</pre></div></div>

<p>Test if the www-data user can read the key:</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: #660033;">-u</span> www-data <span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>redmine<span style="color: #000000; font-weight: bold;">/</span>vendor<span style="color: #000000; font-weight: bold;">/</span>plugins<span style="color: #000000; font-weight: bold;">/</span>redmine-gitosis<span style="color: #000000; font-weight: bold;">/</span>extra<span style="color: #000000; font-weight: bold;">/</span>ssh<span style="color: #000000; font-weight: bold;">/</span>private_key</pre></div></div>

<p>Add the www-data user to the git group:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">usermod <span style="color: #660033;">-a</span> <span style="color: #660033;">-G</span> <span style="color: #c20cb9; font-weight: bold;">git</span> www-data</pre></div></div>

<p><strong>Have fun!</strong></p>
<h3>Source:</h3>
<p><a href="http://brantinteractive.com/2007/02/16/getting-the-mysql-gem-installed-on-ubuntu/ " target="_blank"> http://brantinteractive.com/2007/02/16/getting-the-mysql-gem-installed-on-ubuntu/<br />
</a><a href="http://www.redmine.org/wiki/1/RedmineInstall" target="_blank"> http://www.redmine.org/wiki/1/RedmineInstall</a><br />
<a href="http://wiki.ousli.org/index.php/Redmine_in_Ubuntu_Jaunty_9.04" target="_blank"> http://wiki.ousli.org/index.php/Redmine_in_Ubuntu_Jaunty_9.04</a><br />
<a href="http://www.redmine.org/wiki/1/HowTo_Install_Redmine_in_Ubuntu" target="_blank"> http://www.redmine.org/wiki/1/HowTo_Install_Redmine_in_Ubuntu</a><br />
<a href="http://www.redmine.org/wiki/redmine/Repositories_access_control_with_apache_mod_dav_svn_and_mod_perl " target="_blank"> http://www.redmine.org/wiki/redmine/Repositories_access_control_with_apache_mod_dav_svn_and_mod_perl<br />
</a><a href="http://xdissent.com/2010/05/04/github-clone-with-redmine/ " target="_blank"> http://xdissent.com/2010/05/04/github-clone-with-redmine/<br />
</a><a href="http://wiki.ubuntuusers.de/virtualenv" target="_blank"> http://wiki.ubuntuusers.de/virtualenv</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.x2on.de/2010/10/30/tutorial-redmine-with-svn-git-and-gitosis-on-ubuntu-8-04/feed/</wfw:commentRss>
		<slash:comments>24</slash:comments>
		</item>
		<item>
		<title>Shell-Skripte in ANT-Build Datei einbinden</title>
		<link>http://www.x2on.de/2009/10/21/shell-skripte-in-ant-build-datei-einbinden/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=shell-skripte-in-ant-build-datei-einbinden</link>
		<comments>http://www.x2on.de/2009/10/21/shell-skripte-in-ant-build-datei-einbinden/#comments</comments>
		<pubDate>Wed, 21 Oct 2009 20:26:42 +0000</pubDate>
		<dc:creator>Felix Schulze</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[ANT]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[Shell]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.x2on.de/?p=304</guid>
		<description><![CDATA[Ein kleiner Tip für alle die in einem Projekt Apache ANT benutzen und ein Shell-Skript einbinden wollen. Hierbei gibt es eine Möglichkeit zwischen verschiedenen Betriebssystemen zu unterscheiden, und so unterschiedliche Scripte auszuführen. &#60;target name=&#34;examplescript&#34;&#62; &#60;exec dir=&#34;.&#34; executable=&#34;/bin/bash&#34; os=&#34;Mac OS X&#34;&#62; &#60;arg line=&#34;./examplescript-mac.sh&#34; /&#62; &#60;/exec&#62; &#60;exec dir=&#34;.&#34; executable=&#34;/bin/bash&#34; os=&#34;Linux&#34;&#62; &#60;arg line=&#34;./examplescript-linux.sh&#34; /&#62; &#60;/exec&#62; &#60;exec dir=&#34;.&#34; executable=&#34;cmd&#34; [...]]]></description>
			<content:encoded><![CDATA[<p>Ein kleiner Tip für alle die in einem Projekt <a href="http://ant.apache.org/" target="_blank">Apache ANT</a> benutzen und ein Shell-Skript einbinden wollen. Hierbei gibt es eine Möglichkeit zwischen verschiedenen Betriebssystemen zu unterscheiden, und so unterschiedliche Scripte auszuführen.</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;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;examplescript&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;exec</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;.&quot;</span> <span style="color: #000066;">executable</span>=<span style="color: #ff0000;">&quot;/bin/bash&quot;</span> <span style="color: #000066;">os</span>=<span style="color: #ff0000;">&quot;Mac OS X&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">line</span>=<span style="color: #ff0000;">&quot;./examplescript-mac.sh&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/exec<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;exec</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;.&quot;</span> <span style="color: #000066;">executable</span>=<span style="color: #ff0000;">&quot;/bin/bash&quot;</span> <span style="color: #000066;">os</span>=<span style="color: #ff0000;">&quot;Linux&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">line</span>=<span style="color: #ff0000;">&quot;./examplescript-linux.sh&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/exec<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;exec</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;.&quot;</span> <span style="color: #000066;">executable</span>=<span style="color: #ff0000;">&quot;cmd&quot;</span> <span style="color: #000066;">os</span>=<span style="color: #ff0000;">&quot;Windows NT&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">line</span>=<span style="color: #ff0000;">&quot;/c examplescript-win.bat&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/exec<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.x2on.de/2009/10/21/shell-skripte-in-ant-build-datei-einbinden/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

