Installing Gitlab on Rackspace Cloud Server is the first text guide for our series on Gitlab originated from the article – Options of Installing Gitlab for Code Hosting. We provided the idea on how to calculate the cost of hosting on Cloud platform – its indispensable , specially if you are a new user. Installing Gitlab on Rackspace Cloud Server is a bit complex if you are habituated to install the CMS like Drupal, Joomla! or blogging softwares like WordPress – we basically configure them as LAMP Server.
Introduction for Installing Gitlab on Rackspace Cloud Server
If you are new to Rackspace Cloud Control Panel or this website, please visit my YouTube profile to check the list to find any guide video on Rackspace Cloud Server. The beginning, that means login; creating a server is better shown on a video than in text. Obviously, we will upload the video of Installing Gitlab on Rackspace Cloud Server too in future. Usually we write the text guide with all commands as the leading article and on the Video Guide, the explanations are written.
Installing Gitlab on Rackspace Cloud Server : Steps
We are using a Mac with iTerm2 for SSH tunneling. If you want to install some SSL certificate on your server, like for experimentation, you can follow our guide on Installing Free SSL Certificate for Rackspace Cloud Server. That part plus adding domain name on Rackspace Cloud Server. This is unmanaged server setup. Its unmanaged that is why the guide is. You will be billed around a dollar for running for few hours to test. To “Stop Billing”, you have to take the full server’s backup and delete the instance. There is no “pause billing” kind of button still date in server industry (I hope there was).
---
This guide does not include Redis server inclusion. It is purely simple setup.
First install sudo :
1 | apt-get install sudo |
Then install vim :
1 | sudo apt-get install -y vim |
Please see this previous guide. This is specially for Windows users and never used Linux users to get an idea what we are doing. We are using the latest Debian 6.0 version. We need to update and edit the sources.list file. Reference can be found in these places :
1 | http://www.mayin.org/ajayshah/COMPUTING/debian-principles.html |
1 | http://www.debian.org/releases/stable/ |
Run this command :
1 | sudo nano /etc/apt/sources.list |
Uncomment the sources which are commented out. It is somewhat like that linked guide above.
Run update and upgrade :
1 | apt-get update |
1 | apt-get upgrade |
It is better to go to the control panel (of Rackspace) and restart the server. Now login through SSH again and install vim :
1 | sudo apt-get install -y vim |
Run the commands to install all the components :
1 | sudo apt-get install -y build-essential zlib1g-dev |
1 | sudo apt-get install -y libyaml-dev libssl-dev libgdbm-dev libreadline-dev libncurses5-dev |
1 | sudo apt-get install -y libffi-dev curl git-core |
1 | sudo apt-get install -y openssh-server redis-server postfix checkinstall |
1 | sudo apt-get install -y libxml2-dev libxslt-dev libcurl4-openssl-dev libicu-dev |
You can combine the commands. I have shown separately so that you can notice that this is a setup where open ssh ans Redis are getting installed. Python needs to be 2.7 :
1 | sudo apt-get install python2.7 |
You can install latest Python too :
1 | sudo apt-get install python |
In official guide they have symlinked Python’s two versions :
1 | sudo ln -s /usr/bin/python /usr/bin/python2 |
Depending on the build, you might get error; then you have to symlink.
You have to install Ruby. Reference can be found on official Debian’s Wiki :
1 | http://wiki.debian.org/Ruby |
First go to tmp folder :
1 | cd /tmp |
create a directory named ruby :
1 | mkdir ruby |
Either wget or curl from Ruby’s repo :
1 | http://ftp.ruby-lang.org/pub/ruby/ |
For example this tar ball :
1 | http://ftp.ruby-lang.org/pub/ruby/ruby-1.9.3-rc1.tar.gz |
Uncompress it and cd to that named folder. Run these :
1 | ./configure |
1 | make sudo |
1 | make install |
1 | sudo gem install bundler |
Now, the work begins for Gitlab :
1 | sudo adduser --disabled-login --gecos 'GitLab' git |
The next commands are for setup of the Gitlab Shell, I have followed the official guide :
1 | sudo su git |
1 | cd /home/git |
1 | git clone https://github.com/gitlabhq/gitlab-shell.git cd gitlab-shell |
1 | git checkout v1.1.0 git checkout -b v1.1.0 |
1 | cp config.yml.example config.yml |
You need a domain name. Else you will face terrific issues to configure :
1 | vim config.yml |
1 | ./bin/install |
This is why I pointed you before towards that old domain adding guide.
We can use Rackspace Cloud’s Database as a Service (MySQL) and login there as root from command line :
1 | mysql -u root -p |
1 | mysql> CREATE USER '<span style="color: #ff0000;">gitlab</span>'@'<span style="color: #ff0000;">ipaddress</span>' IDENTIFIED BY '$<span style="color: #ff0000;">password</span>'; |
Red fonts are with variable values.
1 | mysql> CREATE DATABASE IF NOT EXISTS `<span style="color: #ff0000;">gitlabhq_production</span>` |
1 | DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`; |
The above and below two commands are of one line each. I broken it for WordPress’s issue.
1 | mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, |
1 | ALTER ON `<span style="color: #ff0000;">gitlabhq_production</span>`.* TO '<span style="color: #ff0000;">gitlab</span>'@'ipaddress'; |
Now go to git’s home :
1 | cd /home/git |
Now you can follow their official guide from here :
1 | https://github.com/gitlabhq/gitlabhq/blob/5-0-stable/doc/install/installation.md#clone-the-source |
Do not read the SSH guide first. In our case, depending on the cert, the changes will be a bit different. Change according to the changes. Actually changing the IP works.
This is Installing Gitlab on Rackspace Cloud Server guide. There are few differences with the default official one. Gitlab installation part is same. I said at the beginning – its not WordPress! It will take time. But, obviously its less costly way :
1 | http://www.gitlab.com/cloud/ |
Clone one copy of all softwares related to Gitlab and create a optical disk. We have seen many open source projects to go free to full paid only options. They simply deletes all the repo from everywhere, the .org point towards the .com. This is a new model, I call it “Open Source as a Service” – when free contributions are not needed, close it. Debian, CentOS, WordPress – these are kind of grand fathers and has no such parallel models.