Installing Gitlab

Raspberry Pi

# login as root
$ sudo su

# follow gitlab installation for specified operating system
$ apt-get install gitlab-ce

# install web server
$ apt-get install nginx

# check log for errors. Port conflicts will be notified
$ cat /var/log/nginx/error.log

# change port if desired
$ nano /etc/nginx/sites-enabled/default

server {
        listen 81 default_server;
        listen [::]:81 default_server;

        # SSL configuration

# reconfigure gitlab
$ gitlab-ctl reconfigure

# change gitlab port to match nginx port
$ nano /opt/gitlab/embedded/service/gitlab-rails/config/gitlab.yml

  ## GitLab settings
  gitlab:
    ## Web server settings (note: host is the FQDN, do not include http://)
    host: gitlab.example.com
    port: 81
    https: false

.......

test:
  <<: *base
  gravatar:
    enabled: true
  gitlab:
    host: localhost
    port: 81

# change gitlab port to match nginx port
$ nano /etc/gitlab/gitlab.rb

## Url on which GitLab will be reachable.
## For more details on configuring external_url see:
## https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/doc/settings/configuration.md#configuring-the-external-url-for-gitlab
external_url 'http://gitlab.com.local:81/'

........

## Advanced settings
# unicorn['listen'] = '127.0.0.1'
# unicorn['port'] = 8081
# unicorn['socket'] = '/var/opt/gitlab/gitlab-rails/sockets/gitlab.socket'
# unicorn['pidfile'] = '/opt/gitlab/var/unicorn/unicorn.pid'

# reconfigure gitlab
$ gitlab-ctl reconfigure

# restart gitlab
$ sudo gitlab-ctl restart

# restart server
$ sudo reboot

# restart nginx
$ /etc/init.d/nginx restart

# check if listen to port
$ nmap -sS 192.168.0.14

PORT     STATE SERVICE
81/tcp   open  hosts2-ns
85/tcp   open  mit-ml-dev
443/tcp  open  https
3128/tcp open  squid-http
3389/tcp open  ms-wbt-server
9418/tcp open  git

# navigate to page. Be careful with browser cache (especially firefox)
http://192.168.0.14:81/

# gitlab repositories location
$ sudo su
$ cd /var/opt/gitlab/git-data/repositories/

sources

http://www.thecfguy.com/blog/how-to-change-default-port-for-gitlab/

troubleshooting

# Reconfigure freezes at ruby_block[supervise_redis_sleep] action run
https://gitlab.com/gitlab-org/omnibus-gitlab/issues/430#note_1308607
http://stackoverflow.com/questions/22328923/impossible-to-install-gitlab-on-ubuntu-12-04#answer-25785708

when accessing the file tab there was an ajax request that was loading a 500 error page.
Looked into the log by running
$ sudo gitlab-ctl tail
and found this error message

Errno::ENOMEM (Cannot allocate memory - /opt/gitlab/embedded/bin/git):
.......

Found out that not enough memory was being allocate. May be because its a raspberry pi and it has limited memory.
The solution was to reduce unicorn worker processes thus reducing the memory consumption.
$ nano /etc/gitlab/gitlab.rb

##################
# GitLab Unicorn #
##################
## Tweak unicorn settings.

# unicorn['worker_timeout'] = 60
unicorn['worker_processes'] = 1

# Deleting branches and committing changes (edit file) using GitLab hangs it
error: proxyRoundTripper: POST " failed with: "EOF"

The corresponding unicorn worker waits for the git hook to complete and can not serve other requests during this time. The hook uses the GitLab web API to check if the user is allowed to execute the requested git operation. Because I had unicorn running with only one worker, no other worker was available to serve the API request, thus resulting in a deadlock.
https://gitlab.com/gitlab-org/gitlab-ce/issues/13947

$ nano /etc/gitlab/gitlab.rb

unicorn['worker_processes'] = 2

# remove GitLab
$ apt-get purge gitlab-ce

# remove nginx
$ apt-get purge nginx nginx-common nginx-full

Use apache server instead of nginx

followed these these steps

# Additional
Before running 'gitlab-ctl reconfigure', first run 'gitlab-ctl start postgresql', else there will be an error that postgresql is not running.

# enable apache modules
# http://stackoverflow.com/questions/25785903/gitlab-7-2-1-with-apache-server-instead-of-nginx#comment-65475363
# http://askubuntu.com/questions/64454/how-do-i-enable-the-mod-rewrite-apache-module-for-ubuntu-11-04#answer-64460
$ sudo a2enmod rewrite
$ sudo a2enmod proxy_http

If you get permission errors like "You don't have permission to access /assets/logo-white-0b53cd4ea06811d79b3acd486384e047.png on this server." then you need "Require all granted" in the <Location> in your apache vhost configuration file

# sources
http://stackoverflow.com/questions/25785903/gitlab-7-2-1-with-apache-server-instead-of-nginx#answer-25809733