For the people not knowing what GIT is or what it’s used for here’s a link to read about itWhat
is GIT. This post wouldn’t have been possible if it was not for the work done by the community atGitLab.
Please donate to this project.
Installation
This installation was done on a Ubuntu 12.04 server. A clean install was done with no extra packages installed with the baseinstallation. The server is setup on a VM running on VMWare ESX4.
The installation consists of 6 steps:
Install packages / dependencies
Install ruby
Install gitolite
Install and configure Gitlab.
Start the web front-end
Start a Resque worker (for background processing)
First 3 steps can be easily skipped with simply install script:
# Install curl and sudo
apt-get install curl sudo
# 3 steps in 1 command
curl https://raw.github.com/gitlabhq/gitlabhq/master/doc/debian_ubuntu.sh | sh
Now you can go to step 4″
1.
Install packages
Keep
in mind thatsudois not installed for debian by default. You should install it with as root (to gain root access on Ubuntu login with your username and sudo -i ):
wget <a href="http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p290.tar.gz">http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p290.tar.gz</a>
tar xzfv ruby-1.9.2-p290.tar.gz
cd ruby-1.9.2-p290
./configure
make
sudo make install
CHECK: Logout & login again to apply git group to your user
# clone admin repo to add localhost to known_hosts
# & be sure your user has access to gitolite
sudo -u gitlab -H git clone git@localhost:gitolite-admin.git /tmp/gitolite-admin
# if succeed you can remove it
sudo rm -rf /tmp/gitolite-admin
IMPORTANT!
If you cant clonegitolite-adminrepository
– DONT PROCEED INSTALLATION
4. Install gitlab and configuration. Check status configuration.
# SQLite
sudo -u gitlab cp config/database.yml.sqlite config/database.yml
# Or
# Mysql
sudo -u gitlab cp config/database.yml.example config/database.yml
# Change username/password of config/database.yml to real one
Install gems
sudo -u gitlab -H bundle install --without development test --deployment
upstream gitlab {
server unix:/home/gitlab/gitlab/tmp/sockets/gitlab.socket;
}
server {
listen YOUR_SERVER_IP:80;
server_name gitlab.YOUR_DOMAIN.com;
root /home/gitlab/gitlab/public;
# individual nginx logs for this gitlab vhost
access_log /var/log/nginx/gitlab_access.log;
error_log /var/log/nginx/gitlab_error.log;
location / {
# serve static files from defined root folder;.
# @gitlab is a named location for the upstream fallback, see below
try_files $uri $uri/index.html $uri.html @gitlab;
}
# if a file, which is not found in the root folder is requested,
# then the proxy pass the request to the upsteam (gitlab unicorn)
location @gitlab {
proxy_redirect off;
# you need to change this to "https", if you set "ssl" directive to "on"
proxy_set_header X-FORWARDED_PROTO http;
proxy_set_header Host gitlab.YOUR_SUBDOMAIN.com:80;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://gitlab;
}
}