Let’s make it ab ovo. Big Boss wants to keep track of The Code bug, objectives, and whatever else somehow nicely, and after a few ‘I don’t know what is the best solution’ I got the hint: I should investigate myself and just do it™. We both agreed on using GitLab (I’ve never actually used it, but I like GitHub and Git), but Big Boss was not so sure as he’d had problems before installing it next to an Apache server. As our server still hasn’t arrived, I decided to install GitLab on my own machine, a Linode server on which basically all my academic life depends on. It is already running my personal website and some svn/git servers, so it was no option to use the out-of-the-box solution from GitLab, which includes its own Ruby server. So, that’s why, here, a quick guide to install GitLab next to an Apache server running on Ubuntu:
- Get the last version of GitLab Community Edition (CE) through their repository. For this, I just followed the instructions on the GitHub website.
- When that is finished, GitLab should be installed and there should be a conflict between Apache and the server used by GitLab, Unicorn. First we have to reconfigure GitLab.
- Find the gitlab configuration file
gitlab.rb, in my case in
/etc/gitlab/. Edit (or uncomment) the following fields:
external_url "http://gitlab.mydomain.com:80" nginx['enable'] = false ci_nginx['enable'] = false web_server['external_users'] = ['www-data']
gitlab.mydomain.comshould be the host of your GitLab code. Port 80 can be changed to anything, but then keep that in mind for what follows. Also,
www-datais the username used by your Apache configuration; this is the default value.
- Reconfigure GitLab:
sudo gitlab-ctl reconfigure
- Next, we need to create an appropriate Apache config file. Luckily, the guys of GitLab provide one. I used gitlab-apache24.conf, but they’re all pretty similar. There are some things that need to be modified in this file, basically just replace all appearances of
YOUR_SERVER_FQDNwith the host address,
- You probably need to activate the necessary modules of Apache. In the terminal:
sudo a2enmod rewrite sudo a2enmod proxy sudo a2enmod proxy_http
Most probably the two first ones were already activated.
- If you’re running Ubuntu, then the Apache configuration file needs to be placed in the right place. In the Apache config directory (usually
sites-available, and rename it to reflect the domain name:
mv gitlab-apache24.conf /etc/apache2/sites-available/gitlab.mydomain.com.conf
- Then enable the site:
- That should actually be it. In my case, I was struggling for a while with a 504 error. All I had to do was go to the DNS Manager of Linode and add a CNAME Record for my new virtual server. And then, back to The Code.