<?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>Le Blog de Zoc</title>
	<atom:link href="http://www.zoccolo.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.zoccolo.com</link>
	<description>Informatique &#38; Divertissement</description>
	<lastBuildDate>Fri, 04 May 2012 14:01:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Redmine + Gitolite: Un clone de GitHub sur OSX Lion Server&#8230; Fin</title>
		<link>http://www.zoccolo.com/2012/04/16/redhub-lion-3/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=redhub-lion-3</link>
		<comments>http://www.zoccolo.com/2012/04/16/redhub-lion-3/#comments</comments>
		<pubDate>Mon, 16 Apr 2012 13:07:08 +0000</pubDate>
		<dc:creator>Franck</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Informatique]]></category>
		<category><![CDATA[OSX Server]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[gitolite]]></category>
		<category><![CDATA[lion]]></category>
		<category><![CDATA[macos x]]></category>
		<category><![CDATA[redmine]]></category>

		<guid isPermaLink="false">http://www.zoccolo.com/?p=407</guid>
		<description><![CDATA[Dernière partie de ma série d&#8217;articles sur la mise en place d&#8217;un clone de GitHub sur MacOS X Lion Serveur. Avant de passer au coeur de l&#8217;article, c&#8217;est à dire l&#8217;intégration de Gitolite, que nous avons installé dans le premier &#8230;<p class="read-more"><a href="http://www.zoccolo.com/2012/04/16/redhub-lion-3/">Lire la suite &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>Dernière partie de ma série d&#8217;articles sur la mise en place d&#8217;un clone de GitHub sur MacOS X Lion Serveur. Avant de passer au coeur de l&#8217;article, c&#8217;est à dire l&#8217;intégration de Gitolite, que nous avons installé dans le <a title="Redmine + Gitolite: Un clone de GitHub sur OSX Lion Server" href="http://www.zoccolo.com/2012/04/07/redhub-lion/">premier article</a>, avec Redmine, que nous avons installé dans le <a title="Redmine + Gitolite: Un clone de GitHub sur OSX Lion Server… Suite" href="http://www.zoccolo.com/2012/04/12/redhub-lion-2/">second article</a>, je vais présenter et détailler l&#8217;installation de quelques plugins pour Redmine, ainsi qu&#8217;un thème que j&#8217;apprécie tout particulièrement.</p>
<h2>Pixels Cookers, un thème qui a de la gueule</h2>
<p>C&#8217;est pour moi le thème le plus aboutit et le plus moderne. J&#8217;ai nommé <a title="Pixel Cookers Theme" href="http://pixel-cookers.github.com/RedmineThemePixelCookers/" target="_blank">Pixel Cookers</a>, de la société du même nom. Son installation est simplissime et décrite sur le site web dédié, mais je vais en faire un résumé adapté à notre situation.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">redhub:~ admin$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">su</span> - redmine
redhub:~ redmine$ <span style="color: #7a0874; font-weight: bold;">cd</span> redmine
redhub:redmine redmine$ <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>pixel-cookers<span style="color: #000000; font-weight: bold;">/</span>RedmineThemePixelCookers.git public<span style="color: #000000; font-weight: bold;">/</span>themes<span style="color: #000000; font-weight: bold;">/</span>PixelCookers</pre></div></div>

<h2>Redmine Pastebin, clonons Gist tant qu&#8217;à faire !</h2>
<p>Dans notre aventure consistant à obtenir un clone le plus complet possible de GitHub, il serait dommage d&#8217;oublier <a title="Gist" href="https://gist.github.com" target="_blank">Gist</a>. En fait, c&#8217;est plus exactement <a title="Pastebin" href="http://pastebin.com" target="_blank">Pastebin</a> que nous allons copier, afin que les participants de vos projets puissent s&#8217;échanger facilement des extraits de code/documentation/que sais-je&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">redhub:redmine 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>zoc<span style="color: #000000; font-weight: bold;">/</span>redmine_pastebin.git
redhub:redmine redmine$ <span style="color: #007800;">RAILS_ENV</span>=production rake db:migrate_plugins
redhub:redmine redmine$ <span style="color: #c20cb9; font-weight: bold;">kill</span> <span style="color: #660033;">-USR2</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">cat</span> shared<span style="color: #000000; font-weight: bold;">/</span>pids<span style="color: #000000; font-weight: bold;">/</span>unicorn.pid<span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></div></div>

<p>Comme vous pouvez le noter, j&#8217;ai forké le dépôt officiel du plugin, car la version initiale n&#8217;est actuellement pas compatible avec la version trunk/1.4 de Redmine. A noter également que la dernière ligne a pour effet de relancer unicorn, et par conséquent recharger Redmine, étape nécessaire pour pouvoir utiliser le plugin.</p>
<h2>Redmine Time Tracker, gardez le contrôle du temps</h2>
<p>Redmine dispose de fonctionnalités permettant de gérer, estimer, contrôler le temps passé sur les différentes étapes d&#8217;un projet. <a title="Redmine Time Tracker" href="https://github.com/delaitre/redmine_time_tracker" target="_blank">Redmine Time Tracker</a>, améliore ces fonctionnalités: Là où le développeur devait saisir le temps passé à travailler sur le projet, Redmine Time Tracker va mesurer ce temps à sa place et automatiser la saisie de ces informations.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">redhub:redmine 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>delaitre<span style="color: #000000; font-weight: bold;">/</span>redmine_time_tracker.git
redhub:redmine redmine$ <span style="color: #007800;">RAILS_ENV</span>=production rake db:migrate_plugins
redhub:redmine redmine$ <span style="color: #c20cb9; font-weight: bold;">kill</span> <span style="color: #660033;">-USR2</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">cat</span> shared<span style="color: #000000; font-weight: bold;">/</span>pids<span style="color: #000000; font-weight: bold;">/</span>unicorn.pid<span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></div></div>

<h2>Redmine Gitolite, L&#8217;intégration parfaite</h2>
<p>Nous allons terminer cet article avec l&#8217;installation du plugin <a title="Redmine Gitolite" href="https://github.com/ivyl/redmine-gitolite">Redmine Gitolite</a>. Son rôle est de permettre l&#8217;intégration parfaite de notre serveur Gitolite dans Redmine. Grâce à lui, la création d&#8217;un projet Redmine pourra entrainer la génération automatique d&#8217;un dépôt git associé, ainsi que la gestion des droits d&#8217;accès à ce dépôt.</p>
<p>Commençons par l&#8217;installation proprement dite</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">redhub:redmine 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>ivyl<span style="color: #000000; font-weight: bold;">/</span>redmine-gitolite.git
redhub:redmine redmine$ bundle <span style="color: #c20cb9; font-weight: bold;">install</span>
redhub:redmine redmine$ <span style="color: #007800;">RAILS_ENV</span>=production rake db:migrate_plugins</pre></div></div>

<p>Le plugin va se connecter au serveur Gitolite (qui dans notre cas est sur la même machine que Redmine, mais ce pourrait ne pas être le cas) en utilisant SSH et une authentification par clé publique/privée. Nous allons dans un premier temps effectuer une connexion SSH depuis le shell avec l&#8217;utilisateur &laquo;&nbsp;redmine&nbsp;&raquo;, cette connexion ayant pour seul but d&#8217;accepter le certificat (donc répondez &laquo;&nbsp;yes&nbsp;&raquo; à la question posée suite à l&#8217;exécution de la commande ci-dessous)</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">redhub:redmine redmine$ <span style="color: #c20cb9; font-weight: bold;">ssh</span> redhub.local <span style="color: #666666; font-style: italic;">## Accepter identification host</span>
^D</pre></div></div>

<p>Nous avons ensuite besoin d&#8217;une paire de clés pour l&#8217;utilisateur &laquo;&nbsp;redmine&nbsp;&raquo; (qui, je le rappelle, est l&#8217;utilisateur qui fait tourner unicorn, et donc Redmine, et donc le plugin). on copie la clé publique obtenue dans un endroit facile d&#8217;accès, on configure l&#8217;identité du compte redmine vis à vis de git, puis on retourne à notre compte administrateur</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">redhub:redmine redmine$ <span style="color: #c20cb9; font-weight: bold;">ssh-keygen</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;redmine@redhub.local&quot;</span>
Generating public<span style="color: #000000; font-weight: bold;">/</span>private rsa key pair.
Enter <span style="color: #c20cb9; font-weight: bold;">file</span> <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #c20cb9; font-weight: bold;">which</span> to save the key <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>redmine<span style="color: #000000; font-weight: bold;">/</span>.ssh<span style="color: #000000; font-weight: bold;">/</span>id_rsa<span style="color: #7a0874; font-weight: bold;">&#41;</span>:
Enter passphrase <span style="color: #7a0874; font-weight: bold;">&#40;</span>empty <span style="color: #000000; font-weight: bold;">for</span> no passphrase<span style="color: #7a0874; font-weight: bold;">&#41;</span>: <span style="color: #666666; font-style: italic;"># Pas de passwrd</span>
Enter same passphrase again:
Your identification has been saved <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>redmine<span style="color: #000000; font-weight: bold;">/</span>.ssh<span style="color: #000000; font-weight: bold;">/</span>id_rsa.
Your public key has been saved <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>redmine<span style="color: #000000; font-weight: bold;">/</span>.ssh<span style="color: #000000; font-weight: bold;">/</span>id_rsa.pub.
The key fingerprint is:
3a:4a:1d:09:d5:<span style="color: #000000;">70</span>:4d:6c:<span style="color: #000000;">22</span>:<span style="color: #000000;">40</span>:<span style="color: #000000;">45</span>:c6:<span style="color: #000000;">42</span>:<span style="color: #000000;">22</span>:4f:06 redmine<span style="color: #000000; font-weight: bold;">@</span>redhub.local
The key<span style="color: #ff0000;">'s randomart image is:
+--[ RSA 2048]----+
|E.+o+=*o.+.      |
| = ..oo.o +      |
|  . .. . o       |
|     . .         |
|      o S        |
|     . o         |
|    . +          |
|   . . .         |
|    .            |
+-----------------+
&nbsp;
redhub:redmine redmine$ cp ../.ssh/id_rsa.pub /tmp/redmine.pub
redhub:redmine redmine$ git config --global user.email &quot;redmine@redhub.local&quot;
redhub:redmine redmine$ git config --global user.name &quot;Redmine Gitolite&quot;
redhub:redmine redmine$ logout</span></pre></div></div>

<p>De retour sur notre compte administrateur, nous allons ajouter l&#8217;utilisateur &laquo;&nbsp;redmine&nbsp;&raquo; à la liste des administrateurs du serveur Gitolite, ainsi que sa clé publique (je rappelle que le nom du fichier contenant la clé publique correspond au nom d&#8217;utilisateur Gitolite). Pour cela, on clone le dépôt &laquo;&nbsp;gitolite-admin.git&nbsp;&raquo;, on ajoute la clé publique, et on modifie les droits d&#8217;accès au dépôt &laquo;&nbsp;gitolite-admin&nbsp;&raquo;. Enfin, on pousse le tout vers le serveur.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">redhub:~ admin$ <span style="color: #c20cb9; font-weight: bold;">git</span> clone <span style="color: #c20cb9; font-weight: bold;">ssh</span>:<span style="color: #000000; font-weight: bold;">//</span><span style="color: #c20cb9; font-weight: bold;">git</span><span style="color: #000000; font-weight: bold;">@</span>redhub.local<span style="color: #000000; font-weight: bold;">/</span>gitolite-admin.git
redhub:~ admin$ <span style="color: #7a0874; font-weight: bold;">cd</span> gitolite-admin<span style="color: #000000; font-weight: bold;">/</span>
redhub:gitolite-admin admin$ <span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>redmine.pub keydir<span style="color: #000000; font-weight: bold;">/</span>
redhub:gitolite-admin admin$ <span style="color: #c20cb9; font-weight: bold;">git</span> add keydir<span style="color: #000000; font-weight: bold;">/</span>redmine.pub</pre></div></div>

<p>Editez ensuite le fichier &laquo;&nbsp;conf/gitolite.conf&nbsp;&raquo; et ajoutez l&#8217;utilisateur &laquo;&nbsp;redmine&nbsp;&raquo; à la liste des utilisateurs ayant un droit d&#8217;accès en lecture et écriture au dépôt &laquo;&nbsp;gitolite-admin&nbsp;&raquo;. Le contenu du fichier devrait ressembler à cela:</p>
<pre>repo gitolite-admin
    RW+     =   admin redmine</pre>
<p>On pousse ensuite les modifications vers le serveur.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">redhub:gitolite-admin admin$ <span style="color: #c20cb9; font-weight: bold;">git</span> add conf<span style="color: #000000; font-weight: bold;">/</span>gitolite.conf
redhub:gitolite-admin admin$ <span style="color: #c20cb9; font-weight: bold;">git</span> commit <span style="color: #660033;">-m</span> <span style="color: #ff0000;">&quot;Adding redmine user as an administrator&quot;</span>
redhub:gitolite-admin admin$ <span style="color: #c20cb9; font-weight: bold;">git</span> push</pre></div></div>

<p>Pour son fonctionnement, le plugin va avoir besoin d&#8217;une copie de chaque dépôt git sous sa responsabilité, et ce même si le serveur Gitolite et le serveur Redmine sont sur la même machine (c&#8217;est bête je sais, mais c&#8217;est comme ça&#8230;). On va donc dédier un emplacement pour cet usage, emplacement qui appartiendra à l&#8217;utilisateur &laquo;&nbsp;redmine&nbsp;&raquo;.</p>
<p>Comme je l&#8217;ai expliqué dans mon premier article, j&#8217;ai l&#8217;habitude de stocker toutes les données &laquo;&nbsp;serveur&nbsp;&raquo; dans /Library/Server.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">redhub:gitolite-admin admin$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Server<span style="color: #000000; font-weight: bold;">/</span>RedmineRepos
redhub:gitolite-admin admin$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chown</span> redmine:redmine <span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Server<span style="color: #000000; font-weight: bold;">/</span>RedmineRepos<span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

<p>Enfin, il nous reste à installer un &laquo;&nbsp;hook&nbsp;&raquo; coté serveur Gitolite, &laquo;&nbsp;hook&nbsp;&raquo; dont le but est de notifier Redmine de toute modification effectuée sur un dépôt git. Pour que cela fonctionne, vous devez tout d&#8217;abord, dans Redmine, autoriser l&#8217;accès distant à la gestion des dépôts et générer une clé permettant cet accès. Pour cela, il suffit de se rendre dans les paramètres de Redmine (Settings / Administration / Onglet Repositories):</p>
<div id="attachment_414" class="wp-caption aligncenter" style="width: 577px"><a href="http://www.zoccolo.com/files/2012/04/EnableWS.jpg" rel="lightbox[407]"><img class="size-full wp-image-414" title="EnableWS" src="http://www.zoccolo.com/files/2012/04/EnableWS.jpg" alt="" width="567" height="62" /></a><p class="wp-caption-text">Enable WS for repository management</p></div>
<p>On peut maintenant installer le &laquo;&nbsp;hook&nbsp;&raquo;, éditer sa configuration et notifier Gitolite de sa présence:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">redhub:gitolite-admin admin$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">su</span> - <span style="color: #c20cb9; font-weight: bold;">git</span>
redhub:~ <span style="color: #c20cb9; font-weight: bold;">git</span>$ <span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>redmine<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-gitolite<span style="color: #000000; font-weight: bold;">/</span>contrib<span style="color: #000000; font-weight: bold;">/</span>hooks<span style="color: #000000; font-weight: bold;">/</span>post-receive-redmine_gitolite .gitolite<span style="color: #000000; font-weight: bold;">/</span>hooks<span style="color: #000000; font-weight: bold;">/</span>common<span style="color: #000000; font-weight: bold;">/</span>post-receive
redhub:~ <span style="color: #c20cb9; font-weight: bold;">git</span>$ <span style="color: #c20cb9; font-weight: bold;">chmod</span> +x .gitolite<span style="color: #000000; font-weight: bold;">/</span>hooks<span style="color: #000000; font-weight: bold;">/</span>common<span style="color: #000000; font-weight: bold;">/</span>post-receive</pre></div></div>

<p>Editez le fichier &laquo;&nbsp;.gitolite/hooks/common/post-receive&nbsp;&raquo;. Les paramètres de configuration se situent en haut du fichier, et devraient après édition ressembler à ceci (remplacez la clé par celle que vous avez générée précédemment et l&#8217;adresse du serveur par l&#8217;URL complète de votre installation Redmine):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
&nbsp;
<span style="color: #007800;">HOOK_URL</span>=gitolite_hook
<span style="color: #007800;">FETCH_URL</span>=sys<span style="color: #000000; font-weight: bold;">/</span>fetch_changesets
<span style="color: #007800;">LOG</span>=<span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Server<span style="color: #000000; font-weight: bold;">/</span>Gitolite<span style="color: #000000; font-weight: bold;">/</span>.gitolite<span style="color: #000000; font-weight: bold;">/</span>logs<span style="color: #000000; font-weight: bold;">/</span>post-receive.log
&nbsp;
<span style="color: #007800;">DEFAULT_REDMINE_KEY</span>=v62Gfs0KCjeK5nvTd3F2
<span style="color: #007800;">DEFAULT_REDMINE_SERVER</span>=https:<span style="color: #000000; font-weight: bold;">//</span>redhub.local<span style="color: #000000; font-weight: bold;">/</span>redmine
<span style="color: #007800;">DEFAULT_REDMINE_PROJECT_ID</span>=<span style="color: #007800;">$GL_REPO</span>
<span style="color: #007800;">DEFAULT_CURL_IGNORE_SECURITY_CFG</span>=<span style="color: #ff0000;">&quot;true&quot;</span></pre></div></div>

<p>Avant dernière étape, relancer Redmine afin qu&#8217;il prenne en compte la présence de notre nouveau plugin.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">redhub:~ <span style="color: #c20cb9; font-weight: bold;">git</span>$ <span style="color: #7a0874; font-weight: bold;">logout</span>
&nbsp;
redhub:~ admin$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> launchctl unload <span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>LaunchDaemons<span style="color: #000000; font-weight: bold;">/</span>com.zoccolo.redmine.plist
redhub:~ admin$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> launchctl load <span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>LaunchDaemons<span style="color: #000000; font-weight: bold;">/</span>com.zoccolo.redmine.plist</pre></div></div>

<p>Il ne reste plus qu&#8217;à aller configurer le plugin directement depuis l&#8217;interface de configuration de Redmine (Settings / Administration / Plugins). Adaptez ma configuration (voir copie d&#8217;écran ci-dessous) à votre propre installation.<br />
<a href="http://www.zoccolo.com/files/2012/04/GitoliteRedmineConfig.jpg" rel="lightbox[407]"><img class="aligncenter size-full wp-image-417" title="GitoliteRedmineConfig" src="http://www.zoccolo.com/files/2012/04/GitoliteRedmineConfig.jpg" alt="Configuration Plugin Gitolite" width="634" height="282" /></a></p>
<p>Nous avons maintenant (certains diront &laquo;&nbsp;enfin&nbsp;&raquo;) atteint notre but: Avoir un applicatif de gestion de projet complet et performant. J&#8217;espère avoir été assez complet.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zoccolo.com/2012/04/16/redhub-lion-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Redmine + Gitolite: Un clone de GitHub sur OSX Lion Server&#8230; Suite</title>
		<link>http://www.zoccolo.com/2012/04/12/redhub-lion-2/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=redhub-lion-2</link>
		<comments>http://www.zoccolo.com/2012/04/12/redhub-lion-2/#comments</comments>
		<pubDate>Thu, 12 Apr 2012 12:55:46 +0000</pubDate>
		<dc:creator>Franck</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Informatique]]></category>
		<category><![CDATA[OSX Server]]></category>
		<category><![CDATA[lion]]></category>
		<category><![CDATA[macos x]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[redmine]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.zoccolo.com/?p=378</guid>
		<description><![CDATA[Seconde partie de ma série d&#8217;articles consacrés à l&#8217;installation d&#8217;un clone de GitHub sur MacOS X Lion Serveur. Après avoir installé un serveur Gitolite + git-daemon, on passe maintenant au plat de résistance: Redmine. Redmine est une application web écrite en &#8230;<p class="read-more"><a href="http://www.zoccolo.com/2012/04/12/redhub-lion-2/">Lire la suite &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>Seconde partie de ma série d&#8217;articles consacrés à l&#8217;installation d&#8217;un clone de GitHub sur MacOS X Lion Serveur. Après avoir <a title="Redmine + Gitolite: Un clone de GitHub sur OSX Lion Server" href="http://www.zoccolo.com/2012/04/07/redhub-lion/">installé un serveur Gitolite + git-daemon</a>, on passe maintenant au plat de résistance: <a title="Site Web Redmine" href="http://www.redmine.org" target="_blank">Redmine</a>.</p>
<p>Redmine est une application web écrite en <a title="Site Web Ruby" href="http://www.ruby-lang.org/fr/" target="_blank">Ruby</a>, à l&#8217;aide du framework <a href="http://rubyonrails.org/" target="_blank">Rails</a>. Apple utilise également Rails &amp; Ruby pour son gestionnaire de profils, et c&#8217;est là que les problèmes commencent: Redmine et DeviceManager ont besoin de versions différentes de packages Ruby (appelés &laquo;&nbsp;gems&nbsp;&raquo;).</p>
<p>Si, comme moi, vous vous êtes déjà amusé à installer des gems supplémentaires et mettre à jour les gems fournis avec le système, vous avez sans doute remarqué que vous aviez définitivement cassé le gestionnaire de profils (et en ce qui me concerne, je n&#8217;ai pas trouvé d&#8217;autre solutions que de réinstaller Lion Server pour le réparer). Installer Redmine sur Lion Server se transforme en challenge intéressant (alors que son installation sur un autre Unix est généralement une formalité).</p>
<p>Dans ce guide, je vais donc proposer une installation de Redmine qui utilisera son propre environnement Ruby et Rails. Ainsi, pas de risque de dégâts collatéraux avec les applications systèmes. Mais rassurez vous, vous n&#8217;aurez (presque) aucune compilation compliquée à effectuer. Grâce à un outil &laquo;&nbsp;magique&nbsp;&raquo;, j&#8217;ai nommé &laquo;&nbsp;rvm&nbsp;&raquo; (<a title="Ruby Version Manager" href="http://beginrescueend.com/" target="_blank">Ruby Version Manager</a>), quelques lignes de commandes suffiront. Rvm est souvent décrit comme l&#8217;outil de packaging qui manque à Ruby.</p>
<p>Je me suis également fixé un autre but: Installer le moins de packages tiers possible, et éviter les modifications de fichiers de configuration existants. Au final, mon installation de Redmine respectera les contraintes suivantes:</p>
<ol>
<li>Aucune interaction avec Ruby et les gems &laquo;&nbsp;système&nbsp;&raquo;. Facile en utilisant &laquo;&nbsp;rvm&nbsp;&raquo;.</li>
<li>Pas d&#8217;installation d&#8217;applications supplémentaires: On utilisera donc PostgreSQL, fourni avec le système, au lieu d&#8217;installer MySQL.</li>
<li>Pas de &laquo;&nbsp;bidouillage&nbsp;&raquo; des fichiers de configuration d&#8217;Apache: On développera donc une &laquo;&nbsp;webapp&nbsp;&raquo; à la sauce Apple: Redmine fonctionnera dans son environnement protégé (avec un utilisateur/groupe dédié), à l&#8217;aide d&#8217;<a title="Unicorn Web Server" href="http://unicorn.bogomips.org/" target="_blank">Unicorn</a>, un serveur Web léger et performant écrit en Ruby, Apache agira en tant que proxy vers ce serveur (pour info, c&#8217;est également de cette façon que fonctionne le gestionnaire de profils, Apple ayant fait le choix de <a title="Thin Site Web" href="http://code.macournoyer.com/thin/" target="_blank">Thin</a> au lieu d&#8217;Unicorn).</li>
</ol>
<p><strong>Un petit mot à propos d&#8217;Unicorn</strong>: Je l&#8217;ai préféré à Thin car contrairement à ce dernier, Unicorn gère automatiquement le &laquo;&nbsp;Load Balancing&nbsp;&raquo; entre plusieurs instances de l&#8217;application Ruby et est capable de monitorer, voir relancer automatiquement ces instances en cas de plantage. Apple a résolu ces problème en développant son propre script Ruby (voir par exemple /usr/share/devicemgr/backend/devicemgrd).</p>
<p>C&#8217;est parti !</p>
<p>On commence, comme lors du précédent guide, pas la création d&#8217;un compte utilisateur &laquo;&nbsp;redmine&nbsp;&raquo;. c&#8217;est sous ce compte que le serveur Unicorn fonctionnera:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">redhub:~ admin$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> dseditgroup <span style="color: #660033;">-q</span> <span style="color: #660033;">-o</span> create redmine
redhub:~ admin$ <span style="color: #007800;">MAXID</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span>dscl . <span style="color: #660033;">-list</span> <span style="color: #000000; font-weight: bold;">/</span>Users UniqueID <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print $2}'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sort</span> <span style="color: #660033;">-ug</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">tail</span> -<span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
redhub:~ admin$ <span style="color: #007800;">USERID</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>MAXID+<span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
redhub:~ admin$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> dscl <span style="color: #660033;">-q</span> . <span style="color: #660033;">-create</span> <span style="color: #000000; font-weight: bold;">/</span>Users<span style="color: #000000; font-weight: bold;">/</span>redmine UniqueID <span style="color: #007800;">$USERID</span>
redhub:~ admin$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> dscl <span style="color: #660033;">-q</span> . <span style="color: #660033;">-create</span> <span style="color: #000000; font-weight: bold;">/</span>Users<span style="color: #000000; font-weight: bold;">/</span>redmine RealName <span style="color: #ff0000;">&quot;Redmine Server Account&quot;</span>
redhub:~ admin$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> dscl <span style="color: #660033;">-q</span> . <span style="color: #660033;">-create</span> <span style="color: #000000; font-weight: bold;">/</span>Users<span style="color: #000000; font-weight: bold;">/</span>redmine PrimaryGroupID $<span style="color: #7a0874; font-weight: bold;">&#40;</span>dscl <span style="color: #660033;">-q</span> . <span style="color: #660033;">-read</span> <span style="color: #000000; font-weight: bold;">/</span>Groups<span style="color: #000000; font-weight: bold;">/</span>redmine PrimaryGroupID <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print $2}'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
redhub:~ admin$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> dscl <span style="color: #660033;">-q</span> . <span style="color: #660033;">-create</span> <span style="color: #000000; font-weight: bold;">/</span>Users<span style="color: #000000; font-weight: bold;">/</span>redmine Password \<span style="color: #000000; font-weight: bold;">*</span>
redhub:~ admin$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> dscl <span style="color: #660033;">-q</span> . <span style="color: #660033;">-create</span> <span style="color: #000000; font-weight: bold;">/</span>Users<span style="color: #000000; font-weight: bold;">/</span>redmine NFSHomeDirectory <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>redmine
redhub:~ admin$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> dscl <span style="color: #660033;">-q</span> . <span style="color: #660033;">-create</span> <span style="color: #000000; font-weight: bold;">/</span>Users<span style="color: #000000; font-weight: bold;">/</span>redmine UserShell <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>
redhub:~ admin$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> dscl <span style="color: #660033;">-q</span> . <span style="color: #660033;">-delete</span> <span style="color: #000000; font-weight: bold;">/</span>Users<span style="color: #000000; font-weight: bold;">/</span>redmine AuthenticationAuthority
redhub:~ admin$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> dscl <span style="color: #660033;">-q</span> . <span style="color: #660033;">-delete</span> <span style="color: #000000; font-weight: bold;">/</span>Users<span style="color: #000000; font-weight: bold;">/</span>redmine PasswordPolicyOptions
redhub:~ admin$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> dscl <span style="color: #660033;">-q</span> . <span style="color: #660033;">-delete</span> <span style="color: #000000; font-weight: bold;">/</span>Users<span style="color: #000000; font-weight: bold;">/</span>redmine dsAttrTypeNative:KerberosKeys
redhub:~ admin$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> dscl <span style="color: #660033;">-q</span> . <span style="color: #660033;">-delete</span> <span style="color: #000000; font-weight: bold;">/</span>Users<span style="color: #000000; font-weight: bold;">/</span>redmine dsAttrTypeNative:ShadowHashData
redhub:~ admin$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> dscl . <span style="color: #660033;">-append</span> <span style="color: #000000; font-weight: bold;">/</span>Groups<span style="color: #000000; font-weight: bold;">/</span>_postgres GroupMembership redmine
redhub:~ admin$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>redmine
redhub:~ admin$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chown</span> redmine:redmine <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>redmine</pre></div></div>

<p>Quelques remarques supplémentaires: J&#8217;ai décidé d&#8217;installer Redmine dans le répertoire /usr/local/share/redmine. De plus, j&#8217;ajoute le compte utilisateur &laquo;&nbsp;redmine&nbsp;&raquo; dans le groupe &laquo;&nbsp;_postgres&nbsp;&raquo;, afin que l&#8217;application Redmine puisse accéder à sa base de données par l&#8217;intermédiaire de la socket Unix configurée par défaut.</p>
<p>On passe maintenant à la seule phase de compilation de ce guide. Pour mémoire, je vous rappelle que vous aurez besoin de Xcode 4.3.2 et ses outils de compilation en ligne de commande. La compilation de Ruby nécessite en effet l&#8217;utilisation des &laquo;&nbsp;autotools GNU&nbsp;&raquo;. Ces outils étaient fournis avec Xcode, mais Apple a décidé de ne plus les livrer à partir de Xcode 4.3. Nous allons donc les installer dans la l&#8217;arborescence &laquo;&nbsp;/usr/local&nbsp;&raquo;:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">redhub:~ admin$ curl <span style="color: #660033;">-O</span> http:<span style="color: #000000; font-weight: bold;">//</span>mirrors.kernel.org<span style="color: #000000; font-weight: bold;">/</span>gnu<span style="color: #000000; font-weight: bold;">/</span>autoconf<span style="color: #000000; font-weight: bold;">/</span>autoconf-latest.tar.gz
redhub:~ admin$ <span style="color: #c20cb9; font-weight: bold;">tar</span> zxf autoconf-latest.tar.gz
redhub:~ admin$ <span style="color: #7a0874; font-weight: bold;">cd</span> autoconf-<span style="color: #000000;">2.68</span><span style="color: #000000; font-weight: bold;">/</span>
redhub:autoconf-<span style="color: #000000;">2.68</span> admin$ .<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">--prefix</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">local</span>
redhub:autoconf-<span style="color: #000000;">2.68</span> admin$ <span style="color: #c20cb9; font-weight: bold;">make</span>
redhub:autoconf-<span style="color: #000000;">2.68</span> admin$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span>
redhub:autoconf-<span style="color: #000000;">2.68</span> admin$ <span style="color: #7a0874; font-weight: bold;">cd</span> ..
redhub:~ admin$ <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-rf</span> autoconf-<span style="color: #000000;">2.68</span><span style="color: #000000; font-weight: bold;">/</span>
redhub:~ admin$ curl <span style="color: #660033;">-O</span> http:<span style="color: #000000; font-weight: bold;">//</span>mirrors.kernel.org<span style="color: #000000; font-weight: bold;">/</span>gnu<span style="color: #000000; font-weight: bold;">/</span>automake<span style="color: #000000; font-weight: bold;">/</span>automake-1.11.4.tar.gz
redhub:~ admin$ <span style="color: #c20cb9; font-weight: bold;">tar</span> zxf automake-1.11.4.tar.gz
redhub:~ admin$ <span style="color: #7a0874; font-weight: bold;">cd</span> automake-1.11.4
redhub:automake-1.11.4 admin$ .<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">--prefix</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">local</span>
redhub:automake-1.11.4 admin$ <span style="color: #c20cb9; font-weight: bold;">make</span>
redhub:automake-1.11.4 admin$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span>
redhub:automake-1.11.4 admin$ <span style="color: #7a0874; font-weight: bold;">cd</span> ..
redhub:~ admin$ <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-rf</span> automake-1.11.4
redhub:~ admin$ curl <span style="color: #660033;">-O</span> http:<span style="color: #000000; font-weight: bold;">//</span>mirrors.kernel.org<span style="color: #000000; font-weight: bold;">/</span>gnu<span style="color: #000000; font-weight: bold;">/</span>libtool<span style="color: #000000; font-weight: bold;">/</span>libtool-2.4.2.tar.gz
redhub:~ admin$ <span style="color: #c20cb9; font-weight: bold;">tar</span> zxf libtool-2.4.2.tar.gz
redhub:~ admin$ <span style="color: #7a0874; font-weight: bold;">cd</span> libtool-2.4.2
redhub:libtool-2.4.2 admin$ .<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">--prefix</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">local</span>
redhub:libtool-2.4.2 admin$ <span style="color: #c20cb9; font-weight: bold;">make</span>
redhub:libtool-2.4.2 admin$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span>
redhub:libtool-2.4.2 admin$ <span style="color: #7a0874; font-weight: bold;">cd</span> ..
redhub:~ admin$ <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-rf</span> libtool-2.4.2</pre></div></div>

<p>Dernière étape de préparation, la création de la base de données Redmine sous postgreSQL. On vérifie tout d&#8217;abord si postgreSQL est en cour d&#8217;exécution:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">redhub:~ admin$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> serveradmin status postgres
postgres:state = <span style="color: #ff0000;">&quot;RUNNING&quot;</span></pre></div></div>

<p>Si ce n&#8217;est pas le cas, on démarre le service:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">redhub:~ admin$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> serveradmin start postgres</pre></div></div>

<p>Puis on crée la base de données, ainsi qu&#8217;un utilisateur (Role) &laquo;&nbsp;redmine&nbsp;&raquo; pour postgreSQL. Dans le code SQL ci-dessous, n&#8217;oubliez pas de remplacer &lt;password&gt; par un mot de passe non trivial&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">redhub:~ admin$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> psql <span style="color: #660033;">-U</span> _postgres <span style="color: #660033;">-d</span> postgres
psql <span style="color: #7a0874; font-weight: bold;">&#40;</span>9.0.5<span style="color: #7a0874; font-weight: bold;">&#41;</span>
Type <span style="color: #ff0000;">&quot;help&quot;</span> <span style="color: #000000; font-weight: bold;">for</span> help.
&nbsp;
<span style="color: #007800;">postgres</span>=<span style="color: #666666; font-style: italic;"># CREATE ROLE redmine LOGIN ENCRYPTED PASSWORD '&lt;password&gt;' NOINHERIT VALID UNTIL 'infinity';</span>
CREATE ROLE
<span style="color: #007800;">postgres</span>=<span style="color: #666666; font-style: italic;"># CREATE DATABASE redmine WITH ENCODING='UTF8' OWNER=redmine TEMPLATE template0;</span>
CREATE DATABASE
<span style="color: #007800;">postgres</span>=<span style="color: #666666; font-style: italic;"># \q</span></pre></div></div>

<p>On va maintenant passer à l&#8217;installation de Rvm, Redmine, Unicorn. Ces opérations s&#8217;effectuent avec le compte de l&#8217;utilisateur &laquo;&nbsp;redmine&nbsp;&raquo;, puisque nous allons créer un environnement Ruby spécifique pour cet utilisateur.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">redhub:~ admin$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">su</span> - redmine</pre></div></div>

<p>On commence ensuite par créer un environnement minimal pour l&#8217;utilisateur. Cet environnement sera modifié automatiquement par Rvm lors de son installation.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">redhub:~ redmine$ <span style="color: #c20cb9; font-weight: bold;">touch</span> .bash_profile
redhub:~ redmine$ <span style="color: #7a0874; font-weight: bold;">echo</span> insecure <span style="color: #000000; font-weight: bold;">&gt;</span> .curlrc
redhub:~ redmine$ <span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">&gt;</span> .gemrc
<span style="color: #c20cb9; font-weight: bold;">install</span>: <span style="color: #660033;">--no-rdoc</span> <span style="color: #660033;">--no-ri</span>
update: <span style="color: #660033;">--no-rdoc</span> <span style="color: #660033;">--no-ri</span>
^D</pre></div></div>

<p>On installe rvm:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">redhub:~ redmine$ curl <span style="color: #660033;">-L</span> get.rvm.io <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">bash</span> <span style="color: #660033;">-s</span> stable
redhub:~ redmine$ <span style="color: #7a0874; font-weight: bold;">source</span> ~<span style="color: #000000; font-weight: bold;">/</span>.bash_profile</pre></div></div>

<p>A noter que la deuxième ligne recharge l&#8217;environnement bash, car l&#8217;installation de rvm la modifie (rvm est en fait une fonction bash qui doit être chargée dans le shell). C&#8217;est tout pour l&#8217;installation de rvm. Rien de bien compliqué pour l&#8217;instant.</p>
<p>Passons à la création de notre environnement Ruby. Nous allons installer Ruby 1.9.3. Il est en effet impossible d&#8217;installer une version plus ancienne de Ruby à l&#8217;aide de rvm, à cause d&#8217;une incompatibilité avec Xcode 4. La conséquence de cette limitation, c&#8217;est que nous devrons ensuite installer la version 1.4 lorsque celle-ci sera disponible, car la version 1.3 n&#8217;est pas compatible avec Ruby 1.9. On installe également la version 0.8.7 de rake:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">redhub:~ redmine$ rvm <span style="color: #c20cb9; font-weight: bold;">install</span> 1.9.3
redhub:~ redmine$ rvm use 1.9.3 <span style="color: #660033;">--default</span>
redhub:~ redmine$ gem <span style="color: #c20cb9; font-weight: bold;">install</span> rake <span style="color: #660033;">--version</span>=0.8.7</pre></div></div>

<p>On passe ensuite à l&#8217;installation de la version de développement de Redmine, en clonant directement le dépôt Subversion:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">redhub:~ redmine$ <span style="color: #c20cb9; font-weight: bold;">svn</span> <span style="color: #c20cb9; font-weight: bold;">co</span> http:<span style="color: #000000; font-weight: bold;">//</span>redmine.rubyforge.org<span style="color: #000000; font-weight: bold;">/</span>svn<span style="color: #000000; font-weight: bold;">/</span>branches<span style="color: #000000; font-weight: bold;">/</span>branches<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">1.4</span>-stable redmine
redhub:~ redmine$ <span style="color: #7a0874; font-weight: bold;">cd</span> redmine</pre></div></div>

<p>La version de développement de Redmine utilise dorénavant &laquo;&nbsp;bundle&nbsp;&raquo; pour gérer ses dépendances. On utilise donc la commande &laquo;&nbsp;bundle&nbsp;&raquo; pour installer (toujours dans notre environnement protégé) l&#8217;ensemble des gems nécessaires au fonctionnement de redmine en production (donc les gems nécessaires pour le développement et les tests unitaires), en excluant mysql, puisque nous utilisons postgreSQL, et rmagick, car nous ne disposons pas des librairies natives nécessaires (j&#8217;aurais pu décrire leur installation, mais comme rmagick est facultatif, je laisse cette tache aux bons soins du lecteur qui en aurait besoin).</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">redhub:redmine redmine$ bundle <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #660033;">--without</span> development <span style="color: #7a0874; font-weight: bold;">test</span> rmagick mysql</pre></div></div>

<p>C&#8217;est terminé en ce qui concerne l&#8217;installation de Redmine. On a donc maintenant un environnement Ruby on Rails totalement dédié à notre applicatif, qui n&#8217;interfère en rien avec les autres applicatifs du système. Passons à la configuration de Redmine (rien de compliqué, c&#8217;est une configuration classique)</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">redhub:redmine redmine$ <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;production:
  adapter: postgresql
  database: redmine
  username: redmine
  password: &lt;password&gt;
  encoding: utf8
  schema_search_path: public&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span> config<span style="color: #000000; font-weight: bold;">/</span>database.yml
redhub:redmine redmine$ <span style="color: #007800;">RAILS_ENV</span>=production rake config<span style="color: #000000; font-weight: bold;">/</span>initializers<span style="color: #000000; font-weight: bold;">/</span>session_store.rb
redhub:redmine redmine$ rake generate_session_store
redhub:redmine redmine$ <span style="color: #007800;">RAILS_ENV</span>=production rake db:migrate
redhub:redmine redmine$ <span style="color: #007800;">RAILS_ENV</span>=production rake redmine:load_default_data</pre></div></div>

<p>Dernière étape avec l&#8217;utilisateur &laquo;&nbsp;redmine&nbsp;&raquo;: L&#8217;installation et la configuration d&#8217;Unicorn. Unicorn est disponible sous forme de gem, et sa configuration consiste en l&#8217;écriture d&#8217;un script Ruby.:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">redhub:redmine redmine$ <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">'gem &quot;unicorn&quot;, &quot;4.2.1&quot;'</span> <span style="color: #000000; font-weight: bold;">&gt;</span> Gemfile.local
redhub:redmine redmine$ bundle <span style="color: #c20cb9; font-weight: bold;">install</span>
redhub:redmine redmine$ <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-P</span> shared<span style="color: #000000; font-weight: bold;">/</span>logs
redhub:redmine redmine$ <span style="color: #c20cb9; font-weight: bold;">mkdir</span> shared<span style="color: #000000; font-weight: bold;">/</span>pids</pre></div></div>

<p>Créez ensuite un fichier nommé &laquo;&nbsp;unicorn.rb&nbsp;&raquo; dans le répertoire courant et copiez le script suivant:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">mem = <span style="color:#996600;">`sysctl -n hw.memsize`</span>
gb = mem.<span style="color:#9900CC;">to_i</span> <span style="color:#006600; font-weight:bold;">/</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006666;">1024</span> <span style="color:#006600; font-weight:bold;">*</span> <span style="color:#006666;">1024</span> <span style="color:#006600; font-weight:bold;">*</span> <span style="color:#006666;">1024</span><span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
<span style="color:#008000; font-style:italic;"># Up to 4GB = one process per GB of RAM, then 2/GB for each above 4, up to the max</span>
num_proc = <span style="color:#006600; font-weight:bold;">&#40;</span>gb <span style="color:#006600; font-weight:bold;">&lt;</span> <span style="color:#006666;">5</span> ? gb : <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006666;">2</span> <span style="color:#006600; font-weight:bold;">*</span> gb <span style="color:#006600; font-weight:bold;">-</span> <span style="color:#006666;">4</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
num_proc = <span style="color:#006666;">1</span> <span style="color:#9966CC; font-weight:bold;">if</span> num_proc <span style="color:#006600; font-weight:bold;">&lt;</span> <span style="color:#006666;">1</span> 
num_proc = <span style="color:#006666;">10</span> <span style="color:#9966CC; font-weight:bold;">if</span> num_proc <span style="color:#006600; font-weight:bold;">&gt;</span> <span style="color:#006666;">10</span>
&nbsp;
worker_processes num_proc
working_directory = <span style="color:#996600;">&quot;/usr/local/share/redmine/redmine&quot;</span>
&nbsp;
listen <span style="color:#996600;">&quot;127.0.0.1:6660&quot;</span> 
timeout <span style="color:#006666;">600</span>
&nbsp;
preload_app <span style="color:#0000FF; font-weight:bold;">true</span>
&nbsp;
pid <span style="color:#996600;">&quot;#{working_directory}/shared/pids/unicorn.pid&quot;</span>
&nbsp;
stderr_path <span style="color:#996600;">&quot;#{working_directory}/shared/logs/unicorn.stderr.log&quot;</span>
stdout_path <span style="color:#996600;">&quot;#{working_directory}/shared/logs/unicorn.stdout.log&quot;</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">if</span> <span style="color:#CC00FF; font-weight:bold;">GC</span>.<span style="color:#9900CC;">respond_to</span>?<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:copy_on_write_friendly</span>=<span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#CC00FF; font-weight:bold;">GC</span>.<span style="color:#9900CC;">copy_on_write_friendly</span> = <span style="color:#0000FF; font-weight:bold;">true</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
before_fork <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>server, worker<span style="color:#006600; font-weight:bold;">|</span>
  old_pid = <span style="color:#996600;">&quot;#{working_directory}/shared/pids/unicorn.pid.oldbin&quot;</span>
  <span style="color:#9966CC; font-weight:bold;">if</span> <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">exists</span>?<span style="color:#006600; font-weight:bold;">&#40;</span>old_pid<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&amp;&amp;</span> server.<span style="color:#9900CC;">pid</span> != old_pid
    <span style="color:#9966CC; font-weight:bold;">begin</span>
      <span style="color:#CC00FF; font-weight:bold;">Process</span>.<span style="color:#9900CC;">kill</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;QUIT&quot;</span>, <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">read</span><span style="color:#006600; font-weight:bold;">&#40;</span>old_pid<span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">to_i</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#9966CC; font-weight:bold;">rescue</span> <span style="color:#CC00FF; font-weight:bold;">Errno</span>::ENOENT, <span style="color:#CC00FF; font-weight:bold;">Errno</span>::ESRCH
      <span style="color:#008000; font-style:italic;"># someone else did our job for us</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#008000; font-style:italic;"># the following is recomended for Rails + &quot;preload_app true&quot;</span>
  <span style="color:#008000; font-style:italic;"># as there's no need for the master process to hold a connection</span>
  <span style="color:#9966CC; font-weight:bold;">if</span> <span style="color:#9966CC; font-weight:bold;">defined</span>?<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#6666ff; font-weight:bold;">ActiveRecord::Base</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#6666ff; font-weight:bold;">ActiveRecord::Base</span>.<span style="color:#9900CC;">connection</span>.<span style="color:#9900CC;">disconnect</span>!
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
after_fork <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>server, worker<span style="color:#006600; font-weight:bold;">|</span>
  <span style="color:#9966CC; font-weight:bold;">if</span> <span style="color:#9966CC; font-weight:bold;">defined</span>?<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#6666ff; font-weight:bold;">ActiveRecord::Base</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#6666ff; font-weight:bold;">ActiveRecord::Base</span>.<span style="color:#9900CC;">establish_connection</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>Je vous invite vivement à consulter la documentation d&#8217;Unicorn pour plus d&#8217;informations. Sachez simplement que le script va déterminer le nombre d&#8217;instances de l&#8217;application à lancer (en fonction de l&#8217;espace mémoire disponible sur le serveur), et ouvrir une socket TCP, sur le port 6660, accessible uniquement en local (cette socket sera la &laquo;&nbsp;cible&nbsp;&raquo; du proxy Apache que nous verrons plus tard).</p>
<p>C&#8217;est maintenant terminé pour l&#8217;ensemble des taches à effectuer avec le compte &laquo;&nbsp;redmine&nbsp;&raquo;. Retournez sur votre compte administrateur. C&#8217;est en effet avec ce compte que devront etre effectuées les 2 taches restantes, c&#8217;est à dire l&#8217;écriture de la plist launchd qui va lancer notre serveur unicorn + redmine, puis l&#8217;écriture et l&#8217;activation de la webapp Apache.</p>
<p><strong>Pour ce guide, et afin d&#8217;obtenir un fonctionnement consistant avec les autres services web d&#8217;Apple (gestionnaire de profils, wiki), j&#8217;ai choisi de ne pas utiliser de VirtualHost Apache pour Redmine: L&#8217;application sera disponible sur le site par défaut du serveur, à travers (pour moi, le nom de machine sera certainement différent pour vous) l&#8217;URL https://redhub.local/redmine. Cette solution permet également de pouvoir profiter de SSL sans tous les problèmes de virtual hosting&#8230;</strong></p>
<p>On commence par la plist launchd. Prenez votre éditeur favori, et créez le fichier &laquo;&nbsp;/Library/LaunchDaemons/com.zoccolo.redmine.plist&nbsp;&raquo;. Copiez la plist ci-dessous dans le fichier, puis sauvez:</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;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #00bbdd;">&lt;!DOCTYPE plist PUBLIC &quot;-//Apple//DTD PLIST 1.0//EN&quot; &quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&quot;&gt;</span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;plist</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;dict<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>GroupName<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>redmine<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>UserName<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>redmine<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Label<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>com.zoccolo.redmine<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>KeepAlive<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;true</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>WorkingDirectory<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>/usr/local/share/redmine/redmine<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>EnvironmentVariables<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;dict<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>GEM_HOME<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>/usr/local/share/redmine/.rvm/gems/ruby-1.9.3-p194<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>GEM_PATH<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>/usr/local/share/redmine/.rvm/gems/ruby-1.9.3-p194:/usr/local/share/redmine/.rvm/gems/ruby-1.9.3-p194@global<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>PATH<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>/usr/local/share/redmine/.rvm/gems/ruby-1.9.3-p194/bin:/usr/local/share/redmine/.rvm/gems/ruby-1.9.3-p194@global/bin:/usr/local/share/redmine/.rvm/rubies/ruby-1.9.3-p194/bin:/usr/local/share/redmine/.rvm/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
   	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/dict<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>ProgramArguments<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;array<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>unicorn_rails<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>-E<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>production<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>-c<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>./unicorn.rb<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>--path<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>/redmine<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/array<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/dict<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/plist<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Changez le propriétaire du fichier, puis démarrez Unicorn:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">redhub:~ admin$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chown</span> root:wheel <span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>LaunchDaemons<span style="color: #000000; font-weight: bold;">/</span>com.zoccolo.redmine.plist 
redhub:~ admin$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> launchctl load <span style="color: #660033;">-w</span> <span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>LaunchDaemons<span style="color: #000000; font-weight: bold;">/</span>com.zoccolo.redmine.plist</pre></div></div>

<p>Il reste à écrire l&#8217;application web pour Apache. Apple utilise une plist pour décrire la configuration de ses webapps (man webapp.plist). Nous allons faire de meme. Prenez de nouveau votre éditeur favori, et créez le fichier &laquo;&nbsp;/etc/apache2/webapps/com.zoccolo.webapp.redmine.plist&nbsp;&raquo;. Copiez la plist ci-dessous dans le fichier, puis sauvez:</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;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #00bbdd;">&lt;!DOCTYPE plist PUBLIC &quot;-//Apple Computer//DTD PLIST 1.0//EN&quot; &quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&quot;&gt;</span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;plist</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;dict<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>name<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>com.zoccolo.webapp.redmine<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>includeFiles<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;array<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>/etc/apache2/httpd_redmine.conf<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/array<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>launchKeys<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;array<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>com.zoccolo.redmine<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>org.postgresql.postgres<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/array<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>requiredModuleNames<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;array<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>proxy_module<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>xsendfile_module<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/array<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/dict<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/plist<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Faites la meme chose avec le fichier &laquo;&nbsp;/etc/apache2/httpd_redmine.conf&nbsp;&raquo;:</p>

<div class="wp_syntax"><div class="code"><pre class="apache" style="font-family:monospace;"><span style="color: #00007f;">Alias</span> /redmine <span style="color: #7f007f;">&quot;/usr/local/share/redmine/redmine/public&quot;</span>
&nbsp;
<span style="color: #adadad; font-style: italic;"># This is needed to workaround a mod_proxy bug &lt;https://issues.apache.org/bugzilla/show_bug.cgi?id=37770&gt;</span>
<span style="color: #00007f;">SetEnvIf</span> Request_URI <span style="color: #7f007f;">&quot;^/redmine/.*&quot;</span> force-proxy-request-<span style="color: #ff0000;">1.0</span>=<span style="color: #ff0000;">1</span>
<span style="color: #00007f;">SetEnvIf</span> Request_URI <span style="color: #7f007f;">&quot;^/redmine/.*&quot;</span> proxy-<span style="color: #0000ff;">nokeepalive</span>=<span style="color: #ff0000;">1</span>
&nbsp;
&lt;<span style="color: #000000; font-weight:bold;">Proxy</span> balancer://redmineserver&gt;
    <span style="color: #00007f;">BalancerMember</span> http://127.0.0.1:<span style="color: #ff0000;">6660</span>
&lt;/<span style="color: #000000; font-weight:bold;">Proxy</span>&gt;
&nbsp;
<span style="color: #00007f;">RewriteEngine</span> <span style="color: #0000ff;">on</span>
&nbsp;
<span style="color: #adadad; font-style: italic;"># Redirect all non-static requests to unicorn</span>
<span style="color: #00007f;">RewriteCond</span> %{REQUEST_FILENAME} ^/redmine/(.*)$
<span style="color: #00007f;">RewriteCond</span> /usr/local/share/redmine/redmine/public/%1 !-f
<span style="color: #00007f;">RewriteRule</span> ^/redmine/.*$ balancer://redmineserver%{REQUEST_URI} [P,QSA,L]
&nbsp;
&lt;<span style="color: #000000; font-weight:bold;">Directory</span> /usr/local/share/redmine/redmine/public&gt;
    <span style="color: #00007f;">Options</span> <span style="color: #0000ff;">FollowSymLinks</span> MultiViews
&nbsp;
    <span style="color: #00007f;">Order</span> <span style="color: #00007f;">allow</span>,<span style="color: #00007f;">deny</span>
    <span style="color: #00007f;">Allow</span> from <span style="color: #0000ff;">all</span>
&lt;/<span style="color: #000000; font-weight:bold;">Directory</span>&gt;</pre></div></div>

<p>Dernière étape, l&#8217;activation de notre nouvelle webapp, et le redémarrage d&#8217;Apache.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">redhub:~ admin$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> webappctl start com.zoccolo.webapp.redmine
redhub:~ admin$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> apachectl graceful</pre></div></div>

<p>Et voila, si tout s&#8217;est bien passé, vous devez avoir accès à votre redmine directement depuis un navigateur.</p>
<p>Dans le prochain (et dernier) article, je passerai un peu de temps à installer quelques plugins bien utiles pour Redmine et lui refaire son look avec un thème un peu plus évolué que le thème par défaut. Je terminerai par l&#8217;intégration entre Redmine et Gitolite, ce qui permettra la gestion des dépôts git directement depuis Redmine.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zoccolo.com/2012/04/12/redhub-lion-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Redmine + Gitolite: Un clone de GitHub sur OSX Lion Server</title>
		<link>http://www.zoccolo.com/2012/04/07/redhub-lion/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=redhub-lion</link>
		<comments>http://www.zoccolo.com/2012/04/07/redhub-lion/#comments</comments>
		<pubDate>Sat, 07 Apr 2012 11:16:06 +0000</pubDate>
		<dc:creator>Franck</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Informatique]]></category>
		<category><![CDATA[OSX Server]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[gitolite]]></category>
		<category><![CDATA[lion]]></category>
		<category><![CDATA[macos x]]></category>

		<guid isPermaLink="false">http://www.zoccolo.com/?p=324</guid>
		<description><![CDATA[Tout projet de développement sérieux nécessite de bons outils. Sans un minium d&#8217;organisation, la gestion d&#8217;un projet peut très vite devenir un cauchemar. Comment effectuer un suivi de l&#8217;évolution du projet ? Comment gérer et archiver les différentes révisions et &#8230;<p class="read-more"><a href="http://www.zoccolo.com/2012/04/07/redhub-lion/">Lire la suite &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>Tout projet de développement sérieux nécessite de bons outils. Sans un minium d&#8217;organisation, la gestion d&#8217;un projet peut très vite devenir un cauchemar. Comment effectuer un suivi de l&#8217;évolution du projet ? Comment gérer et archiver les différentes révisions et versions du produit ? Comment effectuer le recensement, la résolution et le suivi des inévitables bugs, demandes d&#8217;évolutions ?</p>
<p>Ces questions trouvent leur réponse dans un outil de gestion de version et de tracking. Github en est un parfait exemple. Mais Github est une solution publique, et externaliser le stockage de vos milliers de lignes de code top secrètes ne vous plait pas&#8230; Dans cet article, je vais vous indiquer pas à pas comment héberger son propre &laquo;&nbsp;clone&nbsp;&raquo; de Github sur MacOSX Lion Serveur.</p>
<p>A ce titre je vous propose d&#8217;utiliser <a title="Redmine Website" href="http://www.redmine.org" target="_blank">Redmine</a>, <a title="Gitolite Github project root" href="https://github.com/sitaramc/gitolite" target="_blank">Gitolite</a>, ainsi que le plugin <a title="Redmine Gitolite integration plugin" href="https://github.com/ivyl/redmine-gitolite" target="_blank">Redmine-gitolite</a> qui va permettre une intégration parfaite entre ces 2 outils. Il existe déjà de nombreux articles similaires, proposant l&#8217;installation de ces outils sur Linux/Unix et Windows, mais l&#8217;installation sur OSX Serveur est plus périlleuse, car elle nécessite la mise à jour de plusieurs composants ruby utilisés par Apple, <a title="Lion Server Technical Note about Ruby gems" href="http://support.apple.com/kb/TS4042" target="_blank">mise à jour rendant certaines fonctionnalités systèmes inopérantes</a>.</p>
<h2>Pré requis</h2>
<p>Pour suivre ce guide, vous aurez besoin de:</p>
<ol>
<li>MacOS X Lion Server à jour (10.7.3 au moment où j&#8217;écris ces lignes).</li>
<li>Xcode 4.3.2 et ses outils en ligne de commande (malheureusement nécessaires car git n&#8217;est pas installé dans le système de base).</li>
<li>Un compte administrateur.</li>
<li>Être à l&#8217;aise avec le Terminal. La plupart des manipulations vont en effet nécessiter l&#8217;exécution de commandes dans un shell.</li>
</ol>
<h2>Gitolite: Un serveur Git sécurisé</h2>
<p>L&#8217;application Gitolite permet l&#8217;hébergement centralisé de dépôts Git. Elle propose une gestion très fine des droits d&#8217;accès aux dépôts, ainsi qu&#8217;un accès sécurisé à travers SSH et un couple de clés publiques/privées. Redmine gérant la notion de projet public/privé, je décrirai également la configuration de git-daemon, qui permettra un accès anonyme en lecture seule aux dépôts qui autorisent un tel accès.</p>
<p>Comme expliqué plus haut, Gitolite est accessible à travers SSH. Par conséquent, la première chose à faire est d&#8217;activer le serveur SSH de votre serveur si ce n&#8217;est déjà fait. Pour cela, lancez l&#8217;application Server.app et autorisez les sessions à distance via SSH:</p>
<p><a href="http://www.zoccolo.com/files/2012/04/SSHActivation.jpg" rel="lightbox[324]"><img class="aligncenter size-medium wp-image-329" title="Activation SSH" src="http://www.zoccolo.com/files/2012/04/SSHActivation-300x208.jpg" alt="" width="300" height="208" /></a></p>
<p>Nous allons ensuite créer l&#8217;utilisateur &laquo;&nbsp;git&nbsp;&raquo; local sur le serveur. Cet utilisateur sera le propriétaire local des dépôts hébergés, ainsi que le compte SSH utilisé pour y accéder. C&#8217;est parti pour nos premières lignes de shell.</p>
<p>Première étape, créer un groupe &laquo;&nbsp;git&nbsp;&raquo; et un utilisateur &laquo;&nbsp;git&nbsp;&raquo;:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">redhub:~ admin$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> dseditgroup <span style="color: #660033;">-q</span> <span style="color: #660033;">-o</span> create <span style="color: #c20cb9; font-weight: bold;">git</span>
redhub:~ admin$ <span style="color: #007800;">MAXID</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span>dscl . <span style="color: #660033;">-list</span> <span style="color: #000000; font-weight: bold;">/</span>Users UniqueID <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print $2}'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sort</span> <span style="color: #660033;">-ug</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">tail</span> -<span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
redhub:~ admin$ <span style="color: #007800;">USERID</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>MAXID+<span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
redhub:~ admin$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> dscl <span style="color: #660033;">-q</span> . <span style="color: #660033;">-create</span> <span style="color: #000000; font-weight: bold;">/</span>Users<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">git</span> UniqueID <span style="color: #007800;">$USERID</span>
redhub:~ admin$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> dscl <span style="color: #660033;">-q</span> . <span style="color: #660033;">-create</span> <span style="color: #000000; font-weight: bold;">/</span>Users<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">git</span> RealName <span style="color: #ff0000;">&quot;Gitolite Server Account&quot;</span>
redhub:~ admin$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> dscl <span style="color: #660033;">-q</span> . <span style="color: #660033;">-create</span> <span style="color: #000000; font-weight: bold;">/</span>Users<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">git</span> PrimaryGroupID $<span style="color: #7a0874; font-weight: bold;">&#40;</span>dscl <span style="color: #660033;">-q</span> . <span style="color: #660033;">-read</span> <span style="color: #000000; font-weight: bold;">/</span>Groups<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">git</span> PrimaryGroupID <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print $2}'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></div></div>

<p>On désactive l&#8217;authentification par mot de passe, puisque seule l&#8217;authentification par paire clé publique/privée sera utilisée:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">redhub:~ admin$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> dscl <span style="color: #660033;">-q</span> . <span style="color: #660033;">-create</span> <span style="color: #000000; font-weight: bold;">/</span>Users<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">git</span> Password \<span style="color: #000000; font-weight: bold;">*</span></pre></div></div>

<p>On configure le répertoire racine du compte ainsi que son shell. Vous pouvez changer l&#8217;emplacement du home directory, mais personnellement j&#8217;ai l&#8217;habitude de mettre tout ce qui concerne les données &laquo;&nbsp;serveur&nbsp;&raquo; dans /Library/Server&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">redhub:~ admin$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> dscl <span style="color: #660033;">-q</span> . <span style="color: #660033;">-create</span> <span style="color: #000000; font-weight: bold;">/</span>Users<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">git</span> NFSHomeDirectory <span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Server<span style="color: #000000; font-weight: bold;">/</span>Gitolite
redhub:~ admin$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> dscl <span style="color: #660033;">-q</span> . <span style="color: #660033;">-create</span> <span style="color: #000000; font-weight: bold;">/</span>Users<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">git</span> UserShell <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></pre></div></div>

<p>Enfin, on supprime les données du compte non nécessaires. Cela a pour effet, entre autre, de ne pas faire apparaitre le compte dans les liste des utilisateurs du panneau de configuration, ainsi que dans l&#8217;écran de login du serveur.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">redhub:~ admin$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> dscl <span style="color: #660033;">-q</span> . <span style="color: #660033;">-delete</span> <span style="color: #000000; font-weight: bold;">/</span>Users<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">git</span> AuthenticationAuthority
redhub:~ admin$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> dscl <span style="color: #660033;">-q</span> . <span style="color: #660033;">-delete</span> <span style="color: #000000; font-weight: bold;">/</span>Users<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">git</span> PasswordPolicyOptions
redhub:~ admin$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> dscl <span style="color: #660033;">-q</span> . <span style="color: #660033;">-delete</span> <span style="color: #000000; font-weight: bold;">/</span>Users<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">git</span> dsAttrTypeNative:KerberosKeys
redhub:~ admin$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> dscl <span style="color: #660033;">-q</span> . <span style="color: #660033;">-delete</span> <span style="color: #000000; font-weight: bold;">/</span>Users<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">git</span> dsAttrTypeNative:ShadowHashData</pre></div></div>

<p>Enfin, on crée le dossier de l&#8217;utilisateur &laquo;&nbsp;git&nbsp;&raquo; et on lui en attribue la propriété.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">redhub:~ admin$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Server<span style="color: #000000; font-weight: bold;">/</span>Gitolite
redhub:~ admin$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chown</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>Library<span style="color: #000000; font-weight: bold;">/</span>Server<span style="color: #000000; font-weight: bold;">/</span>Gitolite</pre></div></div>

<p>Passons maintenant à l&#8217;installation de Gitolite. Vous allez avoir besoin d&#8217;une clé SSH pour vous identifier en tant qu&#8217;administrateur du serveur Gitolite. Donc si vous n&#8217;en possédez pas déjà une, il est temps de la créer.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">redhub:~ admin$ <span style="color: #c20cb9; font-weight: bold;">ssh-keygen</span>
Generating public<span style="color: #000000; font-weight: bold;">/</span>private rsa key pair.
Enter <span style="color: #c20cb9; font-weight: bold;">file</span> <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #c20cb9; font-weight: bold;">which</span> to save the key <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000; font-weight: bold;">/</span>Users<span style="color: #000000; font-weight: bold;">/</span>admin<span style="color: #000000; font-weight: bold;">/</span>.ssh<span style="color: #000000; font-weight: bold;">/</span>id_rsa<span style="color: #7a0874; font-weight: bold;">&#41;</span>:
Created directory <span style="color: #ff0000;">'/Users/admin/.ssh'</span>.
Enter passphrase <span style="color: #7a0874; font-weight: bold;">&#40;</span>empty <span style="color: #000000; font-weight: bold;">for</span> no passphrase<span style="color: #7a0874; font-weight: bold;">&#41;</span>:
Enter same passphrase again:
Your identification has been saved <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">/</span>Users<span style="color: #000000; font-weight: bold;">/</span>admin<span style="color: #000000; font-weight: bold;">/</span>.ssh<span style="color: #000000; font-weight: bold;">/</span>id_rsa.
Your public key has been saved <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">/</span>Users<span style="color: #000000; font-weight: bold;">/</span>admin<span style="color: #000000; font-weight: bold;">/</span>.ssh<span style="color: #000000; font-weight: bold;">/</span>id_rsa.pub.
The key fingerprint is:
<span style="color: #000000;">22</span>:09:<span style="color: #000000;">39</span>:ff:a2:<span style="color: #000000;">43</span>:<span style="color: #000000;">84</span>:c4:9f:3b:c4:<span style="color: #000000;">79</span>:b1:4f:<span style="color: #000000;">48</span>:<span style="color: #000000;">42</span> admin<span style="color: #000000; font-weight: bold;">@</span>redhub.local
The key<span style="color: #ff0000;">'s randomart image is:
+--[ RSA 2048]----+
|. .E |
| o o o |
|..* = + |
|. .X = . |
| .. * + S |
| .o o o |
| . o . |
| .. . |
| .. |
+-----------------+</span></pre></div></div>

<p>Copier votre clé publique (dans mon cas /Users/admin/.ssh/id_rsa.pub) dans un endroit où vous pourrez y accéder depuis le compte utilisateur &laquo;&nbsp;git&nbsp;&raquo;, en la renommant, car Gitolite utilise le nom de fichier de la clé publique en tant qu&#8217;identifiant (login) de l&#8217;utilisateur (pour la gestion des droits d&#8217;accès aux dépôts git).</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">redhub:~ admin$ <span style="color: #c20cb9; font-weight: bold;">cp</span> .ssh<span style="color: #000000; font-weight: bold;">/</span>id_rsa.pub <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>admin.pub</pre></div></div>

<p>Il est temps de télécharger et installer Gitolite. Récemment, son auteur l&#8217;a réécrit entièrement et indique que cette nouvelle version (&laquo;&nbsp;g3&#8243;) est la seule supportée à présent. <del>C&#8217;est donc cette version que nous allons cloner depuis son dépôt github</del> <del datetime="2012-05-04T13:58:06+00:00">La version disponible actuellement ne fonctionnant pas correctement sur MacOS X (pour une raison obscure), j&#8217;ai &laquo;&nbsp;forké&nbsp;&raquo; de dépôt initial et modifié le code dans mon dépôt pour contourner le problème. C&#8217;est donc ma version que nous allons cloner, et procéder à l&#8217;installation</del> Edit: L&#8217;auteur a pris en compte mes remarques et modifications afin de faire fonctionner gitolite sur MacOS X. Par conséquent mon fork n&#8217;a plus de raison d&#8217;être et c&#8217;est le dépôt original que nous allons cloner. L&#8217;opération de téléchargement et d&#8217;installation sont effectuées avec l&#8217;utilisateur local &laquo;&nbsp;git&nbsp;&raquo;.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">redhub:~ admin$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">su</span> - <span style="color: #c20cb9; font-weight: bold;">git</span>
redhub:~ <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>sitaramc<span style="color: #000000; font-weight: bold;">/</span>gitolite.git
redhub:~ <span style="color: #c20cb9; font-weight: bold;">git</span>$ <span style="color: #c20cb9; font-weight: bold;">mkdir</span> bin 
redhub:~ <span style="color: #c20cb9; font-weight: bold;">git</span>$ gitolite<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #660033;">-ln</span>
<span style="color: #666666; font-style: italic;"># ^D = Presser Control+D ci-dessous</span>
redhub:~ <span style="color: #c20cb9; font-weight: bold;">git</span>$ <span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">&gt;</span>.bash_profile
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PATH</span>=<span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>bin:<span style="color: #007800;">$PATH</span>
^D
redhub:~ <span style="color: #c20cb9; font-weight: bold;">git</span>$ <span style="color: #7a0874; font-weight: bold;">source</span> .bash_profile
redhub:~ <span style="color: #c20cb9; font-weight: bold;">git</span>$ gitolite setup <span style="color: #660033;">-pk</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>admin.pub
Initialized empty Git repository <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Server<span style="color: #000000; font-weight: bold;">/</span>Gitolite<span style="color: #000000; font-weight: bold;">/</span>repositories<span style="color: #000000; font-weight: bold;">/</span>gitolite-admin.git<span style="color: #000000; font-weight: bold;">/</span>
Initialized empty Git repository <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Server<span style="color: #000000; font-weight: bold;">/</span>Gitolite<span style="color: #000000; font-weight: bold;">/</span>repositories<span style="color: #000000; font-weight: bold;">/</span>testing.git<span style="color: #000000; font-weight: bold;">/</span>
WARNING: <span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Server<span style="color: #000000; font-weight: bold;">/</span>Gitolite<span style="color: #000000; font-weight: bold;">/</span>.ssh missing; creating a new one
WARNING: <span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Server<span style="color: #000000; font-weight: bold;">/</span>Gitolite<span style="color: #000000; font-weight: bold;">/</span>.ssh<span style="color: #000000; font-weight: bold;">/</span>authorized_keys missing; creating a new one</pre></div></div>

<p>Gitolite est maintenant fonctionnel, et pour toute information complémentaire, je vous invite à consulter sa <a title="Gitolite &quot;G3&quot; documentation" href="http://sitaramc.github.com/gitolite/g3/" target="_blank">documentation</a> (ce qui n&#8217;est pas nécessaire si vous allez jusqu&#8217;au bout de ce guide, puisque Redmine gèrera entièrement Gitolite à votre place).</p>
<p>Il reste la cerise sur le gâteau: L&#8217;accès restreint en lecture seule, configurable pour chaque projet, à l&#8217;aide de git-daemon. Si vous ne voulez pas proposer un tel accès, inutile de suivre les étapes suivantes, passez directement à l&#8217;installation de Redmine.</p>
<p>Première étape, modifier l&#8217;umask de gitolite afin que git-daemon (qui fonctionnera avec les droits restreints de l&#8217;utilisateur &laquo;&nbsp;gitdaemon&nbsp;&raquo; que nous allons créer juste après) puisse accéder aux dépôts. Pour cela (toujours avec le compte &laquo;&nbsp;git&nbsp;&raquo;), éditez le fichier .gitolite.rc et remplacez la valeur de la variable <strong>UMASK</strong>, par défaut à 0077, par <strong>0027</strong>.</p>
<p>Les opérations à réaliser avec le compte &laquo;&nbsp;git&nbsp;&raquo; sont maintenant terminées. Quittez le compte (et retournez à votre compte administrateur) en pressant Controle+D.</p>
<p>Seconde étape: On crée un utilisateur &laquo;&nbsp;gitdaemon&nbsp;&raquo;, avec comme groupe primaire le groupe &laquo;&nbsp;git&nbsp;&raquo;.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">redhub:~ admin$ <span style="color: #007800;">MAXID</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span>dscl . <span style="color: #660033;">-list</span> <span style="color: #000000; font-weight: bold;">/</span>Users UniqueID <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print $2}'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sort</span> <span style="color: #660033;">-ug</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">tail</span> -<span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
redhub:~ admin$ <span style="color: #007800;">USERID</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>MAXID+<span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
redhub:~ admin$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> dscl <span style="color: #660033;">-q</span> . <span style="color: #660033;">-create</span> <span style="color: #000000; font-weight: bold;">/</span>Users<span style="color: #000000; font-weight: bold;">/</span>gitdaemon UniqueID <span style="color: #007800;">$USERID</span>
redhub:~ admin$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> dscl <span style="color: #660033;">-q</span> . <span style="color: #660033;">-create</span> <span style="color: #000000; font-weight: bold;">/</span>Users<span style="color: #000000; font-weight: bold;">/</span>gitdaemon RealName <span style="color: #ff0000;">&quot;Git Daemon Server Account&quot;</span>
redhub:~ admin$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> dscl <span style="color: #660033;">-q</span> . <span style="color: #660033;">-create</span> <span style="color: #000000; font-weight: bold;">/</span>Users<span style="color: #000000; font-weight: bold;">/</span>gitdaemon PrimaryGroupID $<span style="color: #7a0874; font-weight: bold;">&#40;</span>dscl <span style="color: #660033;">-q</span> . <span style="color: #660033;">-read</span> <span style="color: #000000; font-weight: bold;">/</span>Groups<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">git</span> PrimaryGroupID <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print $2}'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
redhub:~ admin$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> dscl <span style="color: #660033;">-q</span> . <span style="color: #660033;">-create</span> <span style="color: #000000; font-weight: bold;">/</span>Users<span style="color: #000000; font-weight: bold;">/</span>gitdaemon Password \<span style="color: #000000; font-weight: bold;">*</span>
redhub:~ admin$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> dscl <span style="color: #660033;">-q</span> . <span style="color: #660033;">-create</span> <span style="color: #000000; font-weight: bold;">/</span>Users<span style="color: #000000; font-weight: bold;">/</span>gitdaemon NFSHomeDirectory <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>empty
redhub:~ admin$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> dscl <span style="color: #660033;">-q</span> . <span style="color: #660033;">-create</span> <span style="color: #000000; font-weight: bold;">/</span>Users<span style="color: #000000; font-weight: bold;">/</span>gitdaemon UserShell <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><span style="color: #c20cb9; font-weight: bold;">false</span>
redhub:~ admin$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> dscl <span style="color: #660033;">-q</span> . <span style="color: #660033;">-delete</span> <span style="color: #000000; font-weight: bold;">/</span>Users<span style="color: #000000; font-weight: bold;">/</span>gitdaemon AuthenticationAuthority
redhub:~ admin$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> dscl <span style="color: #660033;">-q</span> . <span style="color: #660033;">-delete</span> <span style="color: #000000; font-weight: bold;">/</span>Users<span style="color: #000000; font-weight: bold;">/</span>gitdaemon PasswordPolicyOptions
redhub:~ admin$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> dscl <span style="color: #660033;">-q</span> . <span style="color: #660033;">-delete</span> <span style="color: #000000; font-weight: bold;">/</span>Users<span style="color: #000000; font-weight: bold;">/</span>gitdaemon dsAttrTypeNative:KerberosKeys
redhub:~ admin$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> dscl <span style="color: #660033;">-q</span> . <span style="color: #660033;">-delete</span> <span style="color: #000000; font-weight: bold;">/</span>Users<span style="color: #000000; font-weight: bold;">/</span>gitdaemon dsAttrTypeNative:ShadowHashData</pre></div></div>

<p>Prenez ensuite votre éditeur favori, et copiez la plist ci-dessous dans le fichier /Library/LaunchDaemons/com.zoccolo.git-daemon.plist:</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;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #00bbdd;">&lt;!DOCTYPE plist PUBLIC &quot;-//Apple//DTD PLIST 1.0//EN&quot; &quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&quot;&gt;</span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;plist</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;dict<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>GroupName<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>git<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>KeepAlive<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;true</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Label<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>com.zoccolo.git-daemon<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>ProgramArguments<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;array<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>/usr/bin/git<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>daemon<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>--base-path=/Library/Server/Gitolite/repositories<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>--reuseaddr<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>--syslog<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/array<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>RunAtLoad<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;true</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>UserName<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>gitdaemon<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/dict<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/plist<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Enfin, changez le propriétaire du fichier (qui doit obligatoirement être root) et son group (qui doit obligatoirement être wheel), et lancez git-daemon à l&#8217;aide de la commande &laquo;&nbsp;launchctl load&nbsp;&raquo; (à noter l&#8217;option -w qui permet de spécifier que le daemon doit être relancé après un redémarrage du serveur):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">redhub:~ admin$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chown</span> root:wheel <span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>LaunchDaemons<span style="color: #000000; font-weight: bold;">/</span>com.zoccolo.git-daemon.plist
redhub:~ admin$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> launchctl load <span style="color: #660033;">-w</span> <span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>LaunchDaemons<span style="color: #000000; font-weight: bold;">/</span>com.zoccolo.git-daemon.plist</pre></div></div>

<p>&laquo;&nbsp;Et voila !!&nbsp;&raquo;</p>
<p>Le couple Gitolite + git-daemon est en place sur votre serveur !</p>
<p>Passons maintenant au plat de résistance: Redmine. <strong>Mais ce sera pour un prochain article !</strong></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zoccolo.com/2012/04/07/redhub-lion/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>groths.org » TRIM Enabler for Mac</title>
		<link>http://www.zoccolo.com/2011/03/28/trim-enabler-for-mac/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=trim-enabler-for-mac</link>
		<comments>http://www.zoccolo.com/2011/03/28/trim-enabler-for-mac/#comments</comments>
		<pubDate>Mon, 28 Mar 2011 09:32:48 +0000</pubDate>
		<dc:creator>Franck</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Informatique]]></category>
		<category><![CDATA[macos x]]></category>
		<category><![CDATA[snow leopard]]></category>
		<category><![CDATA[ssd]]></category>
		<category><![CDATA[trim]]></category>

		<guid isPermaLink="false">http://www.zoccolo.com/?p=302</guid>
		<description><![CDATA[Vous avez la chance de posséder un Mac équipé d&#8217;un disque SSD ? Vous avez la malchance de posséder un disque SSD non fourni par Apple ? Vous êtes déçu que MacOS X 10.6.7 ne supporte par le TRIM sur &#8230;<p class="read-more"><a href="http://www.zoccolo.com/2011/03/28/trim-enabler-for-mac/">Lire la suite &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<ul>
<li>Vous avez la chance de posséder un Mac équipé d&#8217;un disque SSD ?</li>
<li>Vous avez la malchance de posséder un disque SSD non fourni par Apple ?</li>
<li>Vous êtes déçu que MacOS X 10.6.7 ne supporte par le TRIM sur votre disque SSD ?</li>
</ul>
<p>La solution: TRIM Enabler</p>
<p><a href="http://www.zoccolo.com/files/2011/03/trimscreen.png" rel="lightbox[302]"><img class="aligncenter size-full wp-image-309" src="http://www.zoccolo.com/files/2011/03/trimscreen.png" alt="" width="391" height="438" /></a></p>
<p><a href="http://www.groths.org/?p=308">groths.org » TRIM Enabler for Mac</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zoccolo.com/2011/03/28/trim-enabler-for-mac/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Comprendre le multitâche d&#8217;iOS 4</title>
		<link>http://www.zoccolo.com/2010/10/28/comprendre-le-multitache-dios-4/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=comprendre-le-multitache-dios-4</link>
		<comments>http://www.zoccolo.com/2010/10/28/comprendre-le-multitache-dios-4/#comments</comments>
		<pubDate>Thu, 28 Oct 2010 12:08:15 +0000</pubDate>
		<dc:creator>Franck</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Informatique]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[multitâche]]></category>

		<guid isPermaLink="false">http://www.zoccolo.com/?p=276</guid>
		<description><![CDATA[Oliver Drobnik propose un article très complet, détaillé et illustré sur le fonctionnement du multitâche d&#8217;iOS 4. Un &#171;&#160;must read&#160;&#187; pour tout développeur iPhone/iPad ! Understanding iOS 4 Backgrounding and Delegate Messaging @ Cocoanetics.]]></description>
			<content:encoded><![CDATA[<p>Oliver Drobnik propose un article très complet, détaillé et illustré sur le fonctionnement du multitâche d&#8217;iOS 4. Un &laquo;&nbsp;must read&nbsp;&raquo; pour tout développeur iPhone/iPad !</p>
<p><a href="http://www.drobnik.com/touch/2010/07/understanding-ios-4-backgrounding-and-delegate-messaging/">Understanding iOS 4 Backgrounding and Delegate Messaging @ Cocoanetics</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zoccolo.com/2010/10/28/comprendre-le-multitache-dios-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>bbum&#8217;s weblog-o-mat » objc_msgSend() Tour</title>
		<link>http://www.zoccolo.com/2010/02/04/bbums-weblog-o-mat-blog-archive-objc_msgsend-tour/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=bbums-weblog-o-mat-blog-archive-objc_msgsend-tour</link>
		<comments>http://www.zoccolo.com/2010/02/04/bbums-weblog-o-mat-blog-archive-objc_msgsend-tour/#comments</comments>
		<pubDate>Thu, 04 Feb 2010 08:19:36 +0000</pubDate>
		<dc:creator>Franck</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Informatique]]></category>
		<category><![CDATA[macos x]]></category>
		<category><![CDATA[objective c]]></category>
		<category><![CDATA[runtime]]></category>

		<guid isPermaLink="false">http://www.zoccolo.com/?p=250</guid>
		<description><![CDATA[Tout ce que vous avez toujours voulu savoir le fonctionnement du runtime d&#8217;envoi de messages d&#8217;Objective-C 2.0. Dans cette série d&#8217;articles, Bill Bumgarner détaille instruction par instruction le fonctionnement de la fonction objc_msgSend() (dont le code source en assembleur commenté &#8230;<p class="read-more"><a href="http://www.zoccolo.com/2010/02/04/bbums-weblog-o-mat-blog-archive-objc_msgsend-tour/">Lire la suite &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>Tout ce que vous avez toujours voulu savoir le fonctionnement du runtime d&#8217;envoi de messages d&#8217;Objective-C 2.0. Dans cette série d&#8217;articles, <a href="http://www.friday.com/bbum/" target="_self">Bill Bumgarner</a> détaille instruction par instruction le fonctionnement de la fonction objc_msgSend() (dont le code source en assembleur commenté est <a href="http://www.opensource.apple.com/source/objc4/objc4-437.1/runtime/Messengers.subproj/objc-msg-x86_64.s" target="_blank">publiquement disponible</a>).</p>
<p>Après lecture de cette série d&#8217;article, l&#8217;envoi de messages en Objective-C n&#8217;aura plus de secret pour vous !</p>
<p>C&#8217;est par là (en Anglais évidemment) : <a href="http://www.friday.com/bbum/2009/12/18/objc_msgsend-part-1-the-road-map/">bbum&#8217;s weblog-o-mat » Blog Archive » objc_msgSend() Tour Part 1: The Road Map</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zoccolo.com/2010/02/04/bbums-weblog-o-mat-blog-archive-objc_msgsend-tour/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iWillApps » Detecting Piracy</title>
		<link>http://www.zoccolo.com/2010/01/25/detecting-piracy/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=detecting-piracy</link>
		<comments>http://www.zoccolo.com/2010/01/25/detecting-piracy/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 12:03:21 +0000</pubDate>
		<dc:creator>Franck</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Informatique]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[piracy]]></category>

		<guid isPermaLink="false">http://www.zoccolo.com/?p=245</guid>
		<description><![CDATA[Le piratage des applications iPhone est un gros problème. S&#8217;il est assez simple de détecter si une application a été piratée, il est aussi très simple de modifier le code d&#8217;une application qui effectuerait cette détection. L&#8217;article iWillApps » Detecting Piracy &#8230;<p class="read-more"><a href="http://www.zoccolo.com/2010/01/25/detecting-piracy/">Lire la suite &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>Le piratage des applications iPhone est un gros problème. S&#8217;il est assez simple de détecter si une application a été piratée, il est aussi très simple de modifier le code d&#8217;une application qui effectuerait cette détection. L&#8217;article <a href="http://www.iwillapps.com/wordpress/?p=70">iWillApps » Detecting Piracy</a> suggère une solution de détection un peu moins triviale, qui proposera un nouveau challenge à ceux qui préfèrent ne pas payer les applications qu&#8217;ils utilisent&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zoccolo.com/2010/01/25/detecting-piracy/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>ZFS sur MacOS X : C&#8217;est mort !</title>
		<link>http://www.zoccolo.com/2009/10/29/zfs-sur-macos-x-cest-mort/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=zfs-sur-macos-x-cest-mort</link>
		<comments>http://www.zoccolo.com/2009/10/29/zfs-sur-macos-x-cest-mort/#comments</comments>
		<pubDate>Thu, 29 Oct 2009 16:21:12 +0000</pubDate>
		<dc:creator>Franck</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Informatique]]></category>
		<category><![CDATA[macos x]]></category>
		<category><![CDATA[NetApp]]></category>
		<category><![CDATA[Sun]]></category>
		<category><![CDATA[ZFS]]></category>

		<guid isPermaLink="false">http://www.zoccolo.com/?p=232</guid>
		<description><![CDATA[Apple a bel et bien enterré l&#8217;idée d&#8217;utiliser ZFS dans MacOS X. La cause principale ? Sun violerait certains brevets logiciels appartenant à NetApp. Apple ne pouvant prendre le risque de se retrouver également dans la tourmente, ZFS est tout &#8230;<p class="read-more"><a href="http://www.zoccolo.com/2009/10/29/zfs-sur-macos-x-cest-mort/">Lire la suite &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>Apple a bel et bien enterré l&#8217;idée d&#8217;utiliser ZFS dans MacOS X. La cause principale ? Sun violerait certains brevets logiciels appartenant à NetApp.</p>
<p>Apple ne pouvant prendre le risque de se retrouver également dans la tourmente, ZFS est tout simplement abandonné.</p>
<p>Source : <a href="http://storagemojo.com/2009/10/27/mac-zfs-is-dead/">StorageMojo</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zoccolo.com/2009/10/29/zfs-sur-macos-x-cest-mort/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Où est passé ZFS dans Snow Leopard ?</title>
		<link>http://www.zoccolo.com/2009/09/01/ou-est-passe-zfs-dans-snow-leopard/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ou-est-passe-zfs-dans-snow-leopard</link>
		<comments>http://www.zoccolo.com/2009/09/01/ou-est-passe-zfs-dans-snow-leopard/#comments</comments>
		<pubDate>Tue, 01 Sep 2009 13:40:19 +0000</pubDate>
		<dc:creator>Franck</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Informatique]]></category>
		<category><![CDATA[macos x]]></category>
		<category><![CDATA[snow leopard]]></category>
		<category><![CDATA[ZFS]]></category>

		<guid isPermaLink="false">http://www.zoccolo.com/?p=225</guid>
		<description><![CDATA[Alors que tout le monde l&#8217;attendait, grosse déception : ZFS est totalement absent de Snow Leopard. Plusieurs informations contradictoires circulent sur les raisons de cette absence. Robin Harris, sur son blog, évoque quelques pistes intéressantes, et tente de prédire le &#8230;<p class="read-more"><a href="http://www.zoccolo.com/2009/09/01/ou-est-passe-zfs-dans-snow-leopard/">Lire la suite &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>Alors que tout le monde l&#8217;attendait, grosse déception : ZFS est totalement absent de Snow Leopard.</p>
<p>Plusieurs informations contradictoires circulent sur les raisons de cette absence. Robin Harris, sur son blog, évoque quelques pistes intéressantes, et tente de prédire le futur de ZFS (Article en Anglais) :<a href="http://storagemojo.com/2009/08/31/why-did-apple-drop-zfs/"> Why did Apple drop ZFS?</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zoccolo.com/2009/09/01/ou-est-passe-zfs-dans-snow-leopard/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Snow Leopard en précommande !</title>
		<link>http://www.zoccolo.com/2009/08/24/snow-leopard-en-precommande/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=snow-leopard-en-precommande</link>
		<comments>http://www.zoccolo.com/2009/08/24/snow-leopard-en-precommande/#comments</comments>
		<pubDate>Mon, 24 Aug 2009 13:19:56 +0000</pubDate>
		<dc:creator>Franck</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Informatique]]></category>
		<category><![CDATA[64 bits]]></category>
		<category><![CDATA[iLife]]></category>
		<category><![CDATA[iWork]]></category>
		<category><![CDATA[Mac Box]]></category>
		<category><![CDATA[snow leopard]]></category>

		<guid isPermaLink="false">http://www.zoccolo.com/?p=208</guid>
		<description><![CDATA[Les Apple Store en ligne viennent de réouvrir: comme attendu, Snow Leopard est désormais disponible en précommande: Snow Leopard, 29 € Snow Leopard, 5 licences, 49 € Mac Box Set (Snow Leopard, iLife 09, iWork 09), 169 € « Apple &#8230;<p class="read-more"><a href="http://www.zoccolo.com/2009/08/24/snow-leopard-en-precommande/">Lire la suite &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>Les Apple Store en ligne viennent de réouvrir: comme attendu, Snow Leopard est désormais disponible en précommande:</p>
<ul>
<li><a href="http://store.apple.com/fr/go/product/MC223F/A" target="_self">Snow Leopard, 29 €</a></li>
<li><a href="http://store.apple.com/fr/go/product/MC224F/A" target="_blank">Snow Leopard, 5 licences, 49 €</a></li>
<li><a href="http://store.apple.com/fr/go/product/MC209F/A" target="_blank">Mac Box Set (Snow Leopard, iLife 09, iWork 09), 169 €</a></li>
</ul>
<blockquote><p>« Apple a annoncé aujourd&#8217;hui que la commercialisation de Mac OS X 10.6 Snow Leopard débuterait le vendredi 28 août auprès des Revendeurs Agréés Apple », précise le communiqué de presse de Cupertino.</p>
<p>« les ingénieurs d&#8217;Apple ont perfectionné 90 % des plus de 1 000 projets de Mac OS X. Les utilisateurs remarqueront ainsi un Finder plus réactif ; Mail qui charge les messages deux fois plus rapidement ; Time Machine dont la sauvegarde initiale est accélérée jusqu&#8217;à 80 % ; un Dock avec intégration d&#8217;Exposé ; QuickTime X avec un lecteur remanié qui permet aux utilisateurs de visualiser, d&#8217;enregistrer, d&#8217;ajuster et de partager facilement leurs vidéos ; et une version 64 bits de Safari 4 qui offre jusqu&#8217;à 50 % de gain de performances et résiste aux plantages causés par les plug-ins. Snow Leopard voit sa taille réduite de moitié par rapport à la version précédente et libère ainsi jusqu&#8217;à 7 Go d&#8217;espace disque une fois installé.</p>
<p>Pour la première fois, les applications système, notamment le Finder, Mail, iCal, iChat et Safari, sont en 64 bits et Snow Leopard, grâce à sa prise en charge des processeurs 64 bits, met à profit les gros volumes de RAM pour offrir des performances accrues et une sécurité renforcée, tout en restant compatible avec les applications 32 bits. Grand Central Dispatch (GCD) procure aux développeurs de logiciels un nouveau moyen révolutionnaire de créer des applications tirant parti des processeurs multicœurs. Quant à OpenCL, standard ouvert basé sur le langage C, il permet aux développeurs d&#8217;exploiter l&#8217;incroyable puissance de calcul du processeur graphique pour des tâches d&#8217;une toute autre nature.</p>
<p>Snow Leopard est le seul système d&#8217;exploitation pour ordinateurs de bureau à intégrer la prise en charge de Microsoft Exchange Server 2007, permettant d&#8217;utiliser Mac OS X Mail, le Carnet d&#8217;adresses et iCal pour envoyer et recevoir des e-mails, lancer des invitations à des réunions ou y répondre, ainsi que faire des recherches dans vos contacts et gérer ces derniers avec des listes d&#8217;adresses globales. Les informations issues d&#8217;Exchange fonctionnent de façon totalement transparente dans Snow Leopard, de sorte que les utilisateurs peuvent tirer parti des fonctionnalités exclusives de Mac OS X telles que les recherches Spotlight et les aperçus Coup d&#8217;œil. »</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.zoccolo.com/2009/08/24/snow-leopard-en-precommande/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using apc
Database Caching 6/52 queries in 0.057 seconds using apc
Object Caching 709/838 objects using apc

Served from: www.zoccolo.com @ 2012-05-21 06:51:57 -->
