Install GitLab on Centos 5

Find an article
Sep 1
Published by in with 4 Comments
( words)
Warning! There was an error loading some of the images for this post.

So GitLab doesn’t officially support Centos 5, or at least they don’t provide any documentation on how to install it for Centos 5. Initially I found the following recipe for installing from source on Centos 6, which I thought would be a good enough starting point: https://gitlab.com/gitlab-org/gitlab-recipes/tree/master/install/centos. The guide seemed to be working great until I hit a couple of stumbling blocks detailed below:

  1. “Install Gems”: Here I hit a problem with ‘charlock_holmes’ breaking the installation process. Centos 5 comes with libicu 3.6 which is too old for GitLab so you need to install a more up-to-date version, I went with 4.2:
    yum remove libicu
    mkdir /tmp/libicu && cd /tmp/libicu
    curl --progress http://download.icu-project.org/files/icu4c/4.2.1/icu4c-4_2_1-src.tgz | tar xz
    cd icu/source
    ./configure
    make
    make install

    You should now be okay to install ‘charlock_holmes’, you can check by running:
    gem install charlock_holmes -v '0.6.9.4'
    I proceeded to run the Install Gems command from the guide again and hit another problem – cmake wasn’t installed:
    yum install cmake

Other than this minor set back all other commands seemed to work a treat.

 

I also wanted to run GitLab from a sub-directory rather than using a VirtualHost on Apache.  The configuration of this turned out to be rather simple:

  1.  In your application.rb file: config.relative_url_root = “/gitlab”
  2. In your gitlab.yml file: relative_url_root: /gitlab
  3. In your unicorn.rb: ENV[‘RAILS_RELATIVE_URL_ROOT’] = “/gitlab”
  4. In ../gitlab-shell/config.yml: gitlab_url: “http://127.0.0.1/gitlab”
  5.  To update the path, run: sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=production

Then add the following to your httpd.conf (assuming default GitLab configuration – per the guide):

<IfModule mod_proxy.c>
ProxyRequests On

SSLProxyEngine on
ProxyPass /gitlab/ http://127.0.0.1:8080/gitlab/
ProxyPassReverse /gitlab/ http://127.0.0.1:8080/gitlab/
ProxyPass /gitlab http://127.0.0.1:8080/gitlab
ProxyPassReverse /gitlab http://127.0.0.1:8080/gitlab
</IfModule>

4 Comments

Leave a Reply

Your email address will not be published.