Hosting Git repositories on Dreamhost
Over the past weeks, I have been experimenting with different setups for hosting Git repositories. The environments where I tested these were very different: on my Dreamhost accout I can’t run daemon processes, while on the company server, I’m very well allowed to.
However, even with these different environments, I didn’t want to learn and maintain different Git hosting setups on each of these environments. In the end, I decided to go with Gitosis, a simple management system for Git repositories, where the communication between client and server is based on SSH and public/private keypairs.
I got Gitosis up and running quite fast on the company server. However, I have full control of this machine, and I can install all the required software I needed. On Dreamhost, it’s a completely different story.
Since Gitosis is mostly written in Python, I first checked for the Python version on my Dreamhost machine: 2.3.5. I decided to upgrade to a later version as per these instructions. I installed Python 2.6.2 instead of the mentioned 2.5.2. This was the latest stable version in the 2.6 range at the time of writing. Installation went fine.
Second pre-requisite for Gitosis is Git itself. The version of Git installed on my Dreamhost machine was 1.5.4.1. Time to upgrade! I followed the instructions from this article, but updated the prefix argument of the configure script to als put the files in $HOME/opt, next to my custom Python distribution.
Before you continue with installing Gitosis, first install the Python setuptools. Download the latest setuptools egg and install it in your private Python distribution.
$ wget http://pypi.python.org/packages/2.6/s/setuptools/setuptools-0.6c9-py2.6.egg $ sh setuptools-0.6c9-py2.6.egg
Now you can continue with the installation instructions for Gitosis from the article mentioned before. Since I installed a custom Python distribution, I can skip setting the PYTHONPATH. The custom Python has it’s module search path set correctly already.
In a previous article, I discussed a passwordless SSH setup. I assume you have your public key already copied to the Git user account on Dreamhost. If so, you can initialize Gitosis as follows:
$ gitosis-init < /tmp/id_rsa.pub Initialized empty Git repository in /home/mygituser/repositories/gitosis-admin.git/ Reinitialized existing Git repository in /home/mygituser/repositories/gitosis-admin.git/
Now that Gitosis is installed successfully, I continued reading on how to add users and repositories. Quite simple actually!
1 Comment so far
Leave a reply
[...] I started by upgrading Python for my Dreamhost user. I followed my own post, except that I used Python 2.6 instead of 2.5. I missed one step that was caught by a pingback post: [...]