04.05[Ubuntu] Redmine+Gitosis – An Awesome Project Management Solution
When it comes to project management, there are a lot of awesome offerings out there. When you’re looking for something free, your list gets a little smaller. Redmine is an awesome project management solution written in Ruby. It features bug/issue/time tracking, multiple users and projects, repository watching, forums, wiki, documents, and more. Gitosis is a Git-hosting server to make it easy for you to put your Git repositories online. Put ‘em both together and you’ve got a really powerful way to manage your projects, either for yourself or for your company. Let’s get to work.
First, let’s install everything we’ll need:
sudo apt-get install redmine redmine-sqlite libapache2-mod-passenger gitosis git-core
Note: you can replace redmine-sqlite above with either redmine-mysql or redmine-pgsql to use those databases rather than SQLite. I prefer SQLite, so that’s what I’m sticking to.
Redmine
Now let’s focus on getting Redmine installed. Let’s make it available via Apache with the Passenger module. First, symlink your Redmine configuration to exist in your web server. My web server’s root directory is at /var/www, so I’ll symlink mine to /var/www/redmine:
sudo ln -s /usr/share/redmine/public /var/www/redmine
Now, let’s edit Passenger so that the module runs as the right user. Edit the /etc/apache2/mods-available/passenger.conf file, adding the following line between the <IfModule ...> tags:
PassengerDefaultUser www-data
Save it, exit and let’s keep going. Now, configure the Redmine location in your Apache virtual host by adding the following few lines into your virtual host definition file at /etc/apache2/sites-available/default:
<Directory /var/www/redmine>
RailsBaseURI /redmine
PassengerResolveSymlinksInDocumentRoot on
</Directory>
Now, enable the Passenger module and restart Apache:
sudo a2enmod passenger
sudo /etc/init.d/apache2 restart
Finally, visit localhost/redmine in your browser and login using “admin” as a username and “admin” as a password. Coolness. Now, onto Gitosis.
Gitosis
We’ve already installed Gitosis using the command above. Now, let’s configure it for use.
First, reconfigure Gitosis to use your RSA SSH key. If you don’t have SSH set up, you should do that first so that this key exists.
sudo -H -u gitosis gitosis-init < ~/.ssh/id_rsa.pub
Now, let’s check out the Gitosis admin repository, so we can make our changes to the configuration settings.
git clone gitosis@yourserver.com:gitosis-admin.git
Note: if you’ve really locked down your SSH server and only permit certain users from connecting, you’ll have to add the user “gitosis” to your AllowUsers list in /etc/ssh/sshd_config.
How do we add a project? All we really need to do is to add the following to the gitosis-admin/gitosis.conf file:
[group {PROJECT_NAME}]
writable = {PROJECT_NAME}
members = {KEYFILE_NAME}
What this really translates to is something like this:
[group android-project]
writable = android-project
members = mykeyfile@myhost.com
Voila! Simply git add *, git commit, and git push to commit your changes. To add a remote origin to your existing Git projects, run the following command in the basedir of your Git repository:
git remote add origin gitosis@localhost:android-project.git
git push origin master
Now, simply point Redmine at your repository’s location, which follows the following pattern:
/srv/gitosis/repositories/{REPO_NAME}.git
or, in the real world:
/srv/gitosis/repositories/android-project.git
And we’re done! Pretty easy, huh?

Leave a Reply