( words)
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:
- “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:
- In your application.rb file: config.relative_url_root = “/gitlab”
- In your gitlab.yml file: relative_url_root: /gitlab
- In your unicorn.rb: ENV[‘RAILS_RELATIVE_URL_ROOT’] = “/gitlab”
- In ../gitlab-shell/config.yml: gitlab_url: “http://127.0.0.1/gitlab”
- 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
I combined your tutorial with this one: https://www.rosehosting.com/blog/install-gitlab-on-a-centos-linux-vps-with-nginx-and-mysql and I’ve managed to install Gitlab on my CentOS 5 machine.
I suggest you to use nginx instead of Apache. It is faster and consumes less memory.
Thank you!
Hi Vince,
I’m glad the tutorial helped you out and you manage to get everything working! I also agree with you, nginx is definitely the better choice of web server 🙂
Hello Kieran,I has read your tutorial and set the sub-directory successfully.Now I can access my gitlab by ‘xxx.xx.xxx.xx/gitlab’,however,another website that running on my apache can’t work now,but it works well before.I don’t know why.When I access the ‘xxx.xx.xxx.xx/zentao’,It just return the Error “Not Found: /zentao”
If you know the reason,could you please tell me?Thank you very much.
Hi Hiufan,
I’m sorry to hear about your troubles. I’m honestly not sure why that would be the case, none of the above changes should have effected anything else on the web server. I would probably recommend checking the Apache error log and also double check your Apache configuration for any clashes. You shouldn’t have any VirtualHosts enabled for gitlab, the proxypass just simply passes requests to /gitlab or /gitlab/ over to Ruby.