Matt Harris

Just another WordPress weblog

Installing Git binaries onto a MediaTemple server

2008-08-06T01:27:21+00:00August 6th, 2008

This is part 1 of a series on setting up your systems to use Git.

As a developer I make frequent use of version control systems to keep my code safe and easily keep production sites up to date. I previously used the widely supported SVN but have recently moved to the open source project Git. This move hasn’t been without it’s problems though and one of the largest was that Git wasn’t installed on my MediaTemple (MT) servers. Luckily, I found an MT knowledge base article titled “Installing Git on a (dv) 3.5 server” but soon found it had a couple of holes in it which prevented a successful install.

So, in case you find yourself in the same boat, I present my method for installing Git on a MediaTemple Dedicated Virtual 3.5 Server.

This method may work on other providers servers; if it does drop me a comment and i’ll update the post. What I can tell you is this method is for CentOS 5 and will not work on a MediaTemple dv3 (it’s running Centos 4).

These steps are provided as a guide only and you follow them at your own risk.

What you will need

  1. SSH root access to your server (MediaTemple offer this though the Account Center
  2. Developer tools installed on your server (MediaTemple offer this though the Account Center
  3. An empty text document to save some links into
  4. About 30 minutes of time (after backing up)

Method

  1. Ensure you have a backup of your server
  2. Using your favourite web browser navigate to http://mirror.centos.org/centos/5/os/i386/CentOS/, this address is case sensitive
  3. You’ll see a whole list of packages which you can install. The ones you need to locate the current links for are:
  4. Log into your server using SSH.
    ssh root@your-domain.com
  5. Install the python-iniparse package by entering the command: (replace with the URL you copied earlier):
    rpm -Uvh http://mirror.centos.org/centos/5/os/i386/CentOS/python-iniparse-0.2.3-4.el5.noarch.rpm
  6. Install yum by entering the command: (replace with the URL you copied earlier)
    rpm -Uvh http://mirror.centos.org/centos/5/os/i386/CentOS/yum-3.2.8-9.el5.centos.1.noarch.rpm
  7. The last rpm we need is EPEL. Install this by entering:
    rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-2.noarch.rpm
  8. yum is now installed, making things a lot easier
  9. Tell yum to update itself and everything it knows about by entering the command:
    yum -y update
  10. When yum has finished updating, we can install Git. Simply enter:
    yum install git
    and answer y to the prompts

Git is now successfully installed on your MediaTemple server ready for use. Next post is about Generating an SSH keypair which you need to access your remote repository.