Outils pour utilisateurs

Outils du site


en:computing:network_system:installation_d_un_serveur_gitolite_redmine

Ceci est une ancienne révision du document !


References :

Install needed packages

First install thin web server, gitolite for git hosting and redmine to manage your project.

$ sudo apt-get install gitolite redmine thin

Install plugin

To make gitolite and redmine able to exchange, we need to add a plugin to redmine. Clone the plugin from github.

$ cd /usr/share/redmine/vendor/plugins/
$ sudo git clone git://github.com/gdoffe/redmine-gitolite.git

Add ruby dependancies.

$ sudo gem install net-ssh lockfile ruby-openid
$ sudo gem install gitolite --pre

Configuration

Launch redmine and plugins database init.

sudo RAILS_ENV=production rake db:migrate
sudo RAILS_ENV=production rake db:migrate_plugins
sudo RAILS_ENV=production rake redmine:load_default_data

Configure thin web server to listen for redmine requests.

$ sudo thin config -C /etc/thin/redmine.yml -c /usr/share/redmine --servers 1 -e production --user redmine --group www-data --port 8080

Create a folder where the plugin will store the git repositories.

$ sudo mkdir /var/cache/redmine/repositories

Create a user who runs redmine (here we call him redmine) and generate his SSH keys.

$ sudo addgroup redmine
$ sudo adduser --disabled-password --ingroup redmine --home /usr/share/redmine/ redmine
$ sudo chown redmine.redmine /usr/share/redmine -Rf
$ sudo chown redmine.www-data /var/cache/redmine/ -Rf
$ sudo chown redmine.www-data /var/log/redmine/ -Rf
$ sudo su - redmine
$ ssh-keygen -t rsa

Next copy his public key to a temporary place.

$ cp ~/.ssh/id_rsa.pub /tmp/redmine.pub

Create log folder for the web server.

$ mkdir ~/log

Initialize git ids, name and email.

$ git config --global user.name "Redmine"
$ git config --global user.email ""

Now you have to restart the web server to make redmine accessible.

$ exit
$ sudo service thin restart

Create a special user gitolite which will be used by the redmine plugin to talk with gitolite.

$ sudo addgroup gitolite
$ sudo adduser --disabled-password --home /home/gitolite --ingroup gitolite gitolite

As gitolite application uses ssh to access git repositories, generate your ssh keys to be administrator.

This is the Linux user account that will be the first administrator of your gitolite server. Note it carefully, we will need it later.

$ ssh-keygen -t rsa
$ cp ~/.ssh/id_rsa.pub /tmp/<mon_login>.pub

Now log in as gitolite user to launch gitolite setup process.

$ sudo su - gitolite
$ gl-setup /tmp/<mon_login>.pub

Copy a git hook to keep redmine projects synchronised with git repositories.

$ cp /usr/share/redmine/vendor/plugins/redmine-gitolite/contrib/hooks/post-receive-redmine_gitolite .gitolite/hooks/common/post-receive

Now edit .gitolite/hooks/common/post-receive file to set DEFAULT_REDMINE_KEY and DEFAULT_REDMINE_SERVER as in redmine settings. Respectively API Key et Host name and path (which should be something like http:<hostname>:8080). <note important>Enable WS for repository management must be checked in order to generate the API key.</note> <note tip>Default login/password for redmine administration is admin/admin .</note> Delete hooked flag from all repositories and re-launch setup to propagate the hook. <code>$ rm `find repositories/ -name gitolite-hooked -print` $ gl-setup</code> Go back to the account able to administrate gitolite to modify its configuration. <code>$ exit $ cd /tmp $ git clone gitolite@localhost:gitolite-admin $ cd gitolite-admin/</code> Copy in the project gitolite-admin the public key from the user running redmine. Add this user name to the repositories access configuration file. <note important>This key must be named redmine.pub and thus the user rtunning redmine must be also called redmine in the gitolite configuration file conf/gitolite.conf.</note> <code>$ cp /tmp/redmine.pub keydir/ $ git add keydir/redmine.pub $ vim conf/gitolite.conf</code> conf/gitolite.conf file : <code →repo gitolite-admin RW+ = admdev RW = redmine repo testing RW+ = @all</code> Commit your modifications and push them to the server. <code>$ git commit -a -m “Add root user public key. Add RW access to gitolite-admin repo for root user.” $ git push</code> With the user running redmine, launch a SSH connection to the gitolite server to add it to his SSH** known hosts. <code>$ sudo su - redmine $ ssh gitolite@localhost info $ exit</code> Restart web server and that's all. <code>$ sudo service thin restart</code>

en/computing/network_system/installation_d_un_serveur_gitolite_redmine.1331252364.txt.gz · Dernière modification: 2012/09/20 10:53 (modification externe)