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 :
apt-get install sudo
Then install vim :
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 :
Run this command :
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 :
It is better to go to the control panel (of Rackspace) and restart the server. Now login through SSH again and install vim :
sudo apt-get install -y vim
Run the commands to install all the components :
sudo apt-get install -y build-essential zlib1g-dev
sudo apt-get install -y libyaml-dev libssl-dev libgdbm-dev libreadline-dev libncurses5-dev
sudo apt-get install -y libffi-dev curl git-core
sudo apt-get install -y openssh-server redis-server postfix checkinstall
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 :
sudo apt-get install python2.7
You can install latest Python too :
sudo apt-get install python
In official guide they have symlinked Python’s two versions :
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 :
First go to tmp folder :
create a directory named ruby :
Either wget or curl from Ruby’s repo :
For example this tar ball :
Uncompress it and cd to that named folder. Run these :
sudo gem install bundler
Now, the work begins for Gitlab :
sudo adduser --disabled-login --gecos 'GitLab' git
The next commands are for setup of the Gitlab Shell, I have followed the official guide :
sudo su git
git clone https://github.com/gitlabhq/gitlab-shell.git cd gitlab-shell
git checkout v1.1.0 git checkout -b v1.1.0
cp config.yml.example config.yml
You need a domain name. Else you will face terrific issues to configure :
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 :
mysql -u root -p
mysql> CREATE USER 'gitlab'@'ipaddress' IDENTIFIED BY '$password';
Red fonts are with variable values.
mysql> CREATE DATABASE IF NOT EXISTS `gitlabhq_production`
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.
mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX,
ALTER ON `gitlabhq_production`.* TO 'gitlab'@'ipaddress';
Now go to git’s home :
Now you can follow their official guide from here :
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 :
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.