GitLab is an extraordinarily powerful open source code cooperation platform, git repository manager GitLab provides git repository management, code reviews, issue tracking, Gitlab easily integrate with LDAP and Active Directory server. It’s fully supported with mysql and postgreysql database server.
Install GitLab on ubuntu
Processing triggers for libc-bin …
ldconfig deferred processing now taking place
root@git:~# cd /tmp/
install git 2.0.0
######################################################################## 100.0%
root@git:/tmp#
root@git:~# cd git-2.0.0/
root@git:~# make prefix=/usr/local all
root@git:~# Install into /usr/local/bin
root@git:~# sudo make prefix=/usr/local install
Note :- While editing config/gitlab.yml (Step 5), change the git -> bin_path to /usr/local/bin/git
Install and configure postfix as public internet site
install ruby 2.1.2
root@git:/tmp/ruby# curl -L –progress ftp://ftp.ruby-lang.org/pub/ruby/2.1/ruby-2.1.2.tar.gz | tar xz
######################################################################## 100.0%
######################################################################## 100.0%root@git:/tmp/ruby#
root@git:~# cd ruby-2.1.2
root@git:/tmp/ruby/ruby-2.1.2#./configure –disable-install-rdoc
root@git:/tmp/ruby/ruby-2.1.2##make
root@git:/tmp/ruby/ruby-2.1.2##sudo make install
Install the Bundler Gem:
3. System Users
Create a git user for GitLab:
Adding user `git’ …
Adding new group `git’ (1001) …
Adding new user `git’ (1001) with group `git’ …
Creating home directory `/home/git’ …
Copying files from `/etc/skel’ …
install mysql
# Install the database packages
Verify you have MySQL version 5.5.14
Create a user and database for GitLab
mysql> CREATE DATABASE IF NOT EXISTS `gitlabhq_production` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`;
mysql> SET storage_engine=INNODB;
mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, LOCK TABLES ON `gitlabhq_production`.* TO ‘git’@’localhost’;
# verify connection with new database with the new user
# You are done installing the database and can go back to the rest of the installation.
5. Redis
# Configure redis to use sockets
Disable Redis listening on TCP by setting ‘port’ to 0
Enable Redis socket for default Debian / Ubuntu path
Restart redis to Activate the changes to redis.conf
Add git to the redis group
6. GitLab Installation and configuration
We are going to install GitLab into home directory of the user “git”
root@git:/tmp/#sudo -u git -H git clone https://gitlab.com/gitlab-org/gitlab-ce.git -b 7-3-stable gitlab
root@git:/tmp/#cd /home/git/gitlab
Copy the example GitLab config
# Update GitLab config file, according instructions at top of file
Make sure GitLab can write to the log/ and tmp/ directories
root@git:/tmp/#sudo chown -R git tmp/
root@git:/tmp/#sudo chmod -R u+rwX log/
root@git:/tmp/#sudo chmod -R u+rwX tmp/
Create directory for satellites
root@git:/tmp/#sudo chmod u+rwx,g=rx,o-rwx /home/git/gitlab-satellites
Make sure GitLab is able write to the tmp/pids/ and tmp/sockets/ directories
root@git:/tmp/#sudo chmod -R u+rwX tmp/sockets/
Make sure GitLab is able write to the public/uploads/ directory
Copy the example Unicorn config
verify available cores on the server
2
root@git:/tmp/#sudo -u git -H editor config/unicorn.rb
# Copy the example Rack attack config
Configure Git global settings for git user, useful when editing via web
Replace the user.email with original mail id
root@git:/tmp/#sudo -u git -H git config –global user.email “example@example.com”
root@git:/tmp/#sudo -u git -H git config –global core.autocrlf input
Setup and configure Redis connection settings
if you need to Change the Redis socket path if you are not using the default Debian / Ubuntu configuration
Important Note: Make sure to cofigure both gitlab.yml and unicorn.rb to according your setup.
Configure GitLab DB Settings
# PostgreSQL only:
# MySQL only:
root@git:/tmp/#sudo -u git -H editor config/database.yml
dabaname
database user
database user password
install gems For PostgreSQL database
install gems for Mysql database
Install GitLab shell
If you want modify gitlab-shell config as follows:
Initialize Database and Activate Advanced Features
Administrator account created:
login………root
password……#{password}
To change the password perform the following command.
Configure GitLab init script
root@git:/tmp/#sudo cp lib/support/init.d/gitlab.default.example /etc/default/gitlab
Note : If you installed GitLab in another directory or as a user other than the default you should change these settings in /etc/default/gitlab. Do not edit /etc/init.d/gitlab as it will be changed on upgrade.
Setup GitLab start on boot time:
To Setup Logrotate
Verify if GitLab and its environment are configured properly or not:
Compile Assets
Start Your GitLab server
or
Finally Install nginx to access the gitlab through browser
Site Configuration according GitLab
root@git:/tmp/#sudo ln -s /etc/nginx/sites-available/gitlab /etc/nginx/sites-enabled/gitlab
Edit the config file and change default domain with your FQDN hostname or domain name:
Finally restart the nginx
or
Verify the application status
Finally access GitLab by using http://server-IP-or-hostname/ url.
