SlideShare ist ein Scribd-Unternehmen logo
1 von 7
Downloaden Sie, um offline zu lesen
Installing Gitlab with Gitolite and Git on CentOS




                   Md. Raiful Hasan

                   DIVINE IT LIMITED




                             www.divine-it.net | DIVINE IT LIMITED   1
Requirements: CentOS 6.3 Minimal

Updating and adding basic software and services
Add EPEL repository

  rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-7.noarch.rpm



Install the required tools for gitlab and
  yum -y groupinstall 'Development Tools' 'Additional Development'

  gitoliteyum -y install readline readline-devel ncurses-devel gdbm-devel glibc-devel tcl-devel openssl-devel
  curl-devel expat-devel db4-devel byacc gitolite sqlite-devel gcc-c++ libyaml libyaml-devel libffi libffi-devel
  libxml2 libxml2-devel libxslt libxslt-devel libicu libicu-devel system-config-firewall-tui python-devel redis



Downloading and extracting ruby:

  curl -O http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p320.tar.gz

  tar xzvf ruby-1.9.2-p320.tar.gz

  cd ruby-1.9.2-p320



Now here are two choices.

                           1. For Single ruby user.
                           2. For Multiple ruby versions user.

1 . Configure without binary suffix

 ./configure --enable-shared --disable-pthread



2 . Configure with binary suffix (for parallel installation of ruby versions)

  ./configure --enable-shared --disable-pthread --program-suffix _n


When choosing this option, the binary ruby will be named ruby_n and gem gem_n. Also we will have to
use rake_n.




                                                               www.divine-it.net | DIVINE IT LIMITED          2
Now install ruby:
  make && make install



Replace the 64 in the path with 32 if you're running on a 32 bit box

  yum install qt-devel qtwebkit-devel

  export PATH=$PATH:/usr/lib64/qt4/bin




Now we have to install all the gems GitLab needs to run:

  gem update --system

  gem update

  gem install rails




Now everything is set up and we can start to configure the environment for GitLab. First we create a
user that will run GitLab:

  adduser --shell /bin/bash --create-home --home-dir /home/gitlab gitlab



Because this user will be the Admin of the repos on the server, we need to have a RSA key pair to
authenticate:

  su - gitlab -c "ssh-keygen -t rsa"



Now switch back to root account. Because GitLab is only a graphical user interface to manage repos, we
need a power full backend. gitolite will do this for us.
We also need a user for gitolite.

  adduser --system --shell /bin/sh --comment 'gitolite' --create-home --home-dir /home/git git




                                                            www.divine-it.net | DIVINE IT LIMITED   3
Gitolite needs to know one key that it knows as admin. We will pass the key of GitLab to gitolite. To do
so we first copy the private key of our gitlab user to the home
directory of our gitolite user:

 # make sure do this as root


  cp /home/gitlab/.ssh/id_rsa.pub /home/git/gitlab.pub



Now we need to initialize gitolite:

  su git

  gl-setup ~/gitlab.pub # this passes the admin key to gitolite




Switch back to root user now.

We now need to give our management software (GitLab) access to the repos:

  usermod -a -G git gitlab

  chmod -R g+rwX /home/git/repositories/

  chmod 770 /home/git




Because the gitlab user will need a password later on, we configure it right now, so we are finished with
all the user stuff.

  passwd gitlab # please choose a good password :)




As next step we need to introduce GitLab to gitolite (that is, we let them change their SSH-keys)

  su gitlab

  ssh root@localhost



... And back to the root user.


                                                              www.divine-it.net | DIVINE IT LIMITED   4
GitLab needs a few gems, we haven't installed yet:
As mentioned before, the gitlab user will have to do a bit of administration stuff, so we need to give him
sudo rights. To do so, we edit the sudoers file with visudo:

  visudo




Add gitlab ALL=(ALL) ALL after root ALL=(ALL) ALL so it looks like this:


  ...

  root ALL=(ALL) ALL

  gitlab ALL=(ALL) ALL

  ...




After another two gems we are finished with the gem stuff:

  gem install ruby-debug19

  gem install charlock_holmes




We now switch to our gitlab user and we won't use our root account anymore:


  su gitlab


Get the GitLab software:

  cd && git clone git://github.com/gitlabhq/gitlabhq.git

  cd gitlabhq




We're nearly done. Next we bundle our application.
  bundle install



                                                           www.divine-it.net | DIVINE IT LIMITED   5
GitLab will use a MySQL database (in our case), which we need to install and start:
  yum -y install mysql-server

  /etc/init.d/mysqld start




To configure the MySQL server easily we use:

  mysql_secure_installation




Remember the password you type in for root!

We now connect to our database server to create a user for GitLab:

  mysql -u root -p




We now have a mysql shell.

 mysql> CREATE DATABASE gitlab CHARACTER SET UTF8;

 mysql> GRANT ALL PRIVILEGES ON gitlab.* TO 'gitlabusr'@'localhost' IDENTIFIED BY 'password' WITH GRANT
 OPTION;

 mysql> quit


Remember the password and username (here: gitlabusr and password)!

To create the database a script is deployed with GitLab. However it needs an additional service to run:

  sudo nohup redis-server > /dev/null




Enter the password you created for the gitlab user and hit CTRL+Z. Then type
  bg

The service is now running in background.




                                                        www.divine-it.net | DIVINE IT LIMITED     6
We now configure GitLab by copying the configurion files from example to real:

  cp ~/gitlabhq/config/database.yml.mysql ~/gitlabhq/config/database.yml

  cp ~/gitlabhq/config/gitlab.yml.example ~/gitlabhq/config/gitlab.yml




In database.yml you have to edit the production settings of your database (at the very top of the file).
You have to change the database-name, username and password.

We will now create the database structure:

 RAILS_ENV=production rake db:setup

 RAILS_ENV=production rake db:seed_fu




To start the server we use

  bundle exec rails s -e production



We're done. All us have to do now, is set up firewall and navigate to http://ip-or-domain:3000/ and log
in with

user: admin@local.host
pass: 5iveL!fe




                                                           www.divine-it.net | DIVINE IT LIMITED   7

Weitere ähnliche Inhalte

Was ist angesagt?

Intro to Git DevOps Tally Presentation 101615
Intro to Git DevOps Tally Presentation 101615Intro to Git DevOps Tally Presentation 101615
Intro to Git DevOps Tally Presentation 101615Brian K. Vagnini
 
Dev ninja -> vagrant + virtualbox + chef-solo + git + ec2
Dev ninja  -> vagrant + virtualbox + chef-solo + git + ec2Dev ninja  -> vagrant + virtualbox + chef-solo + git + ec2
Dev ninja -> vagrant + virtualbox + chef-solo + git + ec2Yros
 
Docker use dockerfile
Docker use dockerfileDocker use dockerfile
Docker use dockerfilecawamata
 
Set up Hadoop Cluster on Amazon EC2
Set up Hadoop Cluster on Amazon EC2Set up Hadoop Cluster on Amazon EC2
Set up Hadoop Cluster on Amazon EC2IMC Institute
 
Intro to Git for Drupal 7
Intro to Git for Drupal 7Intro to Git for Drupal 7
Intro to Git for Drupal 7Chris Caple
 
docker build with Ansible
docker build with Ansibledocker build with Ansible
docker build with AnsibleBas Meijer
 
Exploring the Future of Helm
Exploring the Future of HelmExploring the Future of Helm
Exploring the Future of HelmMatthew Farina
 
Cookbook testing with KitcenCI and Serverrspec
Cookbook testing with KitcenCI and ServerrspecCookbook testing with KitcenCI and Serverrspec
Cookbook testing with KitcenCI and ServerrspecDaniel Paulus
 
Into to Docker (Central PA Java User Group - 8/14/2017)
Into to Docker (Central PA Java User Group - 8/14/2017)Into to Docker (Central PA Java User Group - 8/14/2017)
Into to Docker (Central PA Java User Group - 8/14/2017)Mike Melusky
 
Infrastructure = Code
Infrastructure = CodeInfrastructure = Code
Infrastructure = CodeGeorg Sorst
 
Boulder dev ops-meetup-11-2012-rundeck
Boulder dev ops-meetup-11-2012-rundeckBoulder dev ops-meetup-11-2012-rundeck
Boulder dev ops-meetup-11-2012-rundeckWill Sterling
 
Python virtualenv & pip in 90 minutes
Python virtualenv & pip in 90 minutesPython virtualenv & pip in 90 minutes
Python virtualenv & pip in 90 minutesLarry Cai
 
Undoing Things in Git
Undoing Things in GitUndoing Things in Git
Undoing Things in Gitgittower
 
Ansible, best practices
Ansible, best practicesAnsible, best practices
Ansible, best practicesBas Meijer
 
SkySQL & MariaDB What's all the buzz?
SkySQL & MariaDB What's all the buzz?SkySQL & MariaDB What's all the buzz?
SkySQL & MariaDB What's all the buzz?Ivan Zoratti
 
Introduction to bower
Introduction to bowerIntroduction to bower
Introduction to bowerJitendra Zaa
 
Apache Hadoop & Hive installation with movie rating exercise
Apache Hadoop & Hive installation with movie rating exerciseApache Hadoop & Hive installation with movie rating exercise
Apache Hadoop & Hive installation with movie rating exerciseShiva Rama Krishna Dasharathi
 

Was ist angesagt? (20)

Intro to Git DevOps Tally Presentation 101615
Intro to Git DevOps Tally Presentation 101615Intro to Git DevOps Tally Presentation 101615
Intro to Git DevOps Tally Presentation 101615
 
Dev ninja -> vagrant + virtualbox + chef-solo + git + ec2
Dev ninja  -> vagrant + virtualbox + chef-solo + git + ec2Dev ninja  -> vagrant + virtualbox + chef-solo + git + ec2
Dev ninja -> vagrant + virtualbox + chef-solo + git + ec2
 
Docker use dockerfile
Docker use dockerfileDocker use dockerfile
Docker use dockerfile
 
Helm @ Orchestructure
Helm @ OrchestructureHelm @ Orchestructure
Helm @ Orchestructure
 
Set up Hadoop Cluster on Amazon EC2
Set up Hadoop Cluster on Amazon EC2Set up Hadoop Cluster on Amazon EC2
Set up Hadoop Cluster on Amazon EC2
 
Intro to Git for Drupal 7
Intro to Git for Drupal 7Intro to Git for Drupal 7
Intro to Git for Drupal 7
 
docker build with Ansible
docker build with Ansibledocker build with Ansible
docker build with Ansible
 
Exploring the Future of Helm
Exploring the Future of HelmExploring the Future of Helm
Exploring the Future of Helm
 
Docker
DockerDocker
Docker
 
Cookbook testing with KitcenCI and Serverrspec
Cookbook testing with KitcenCI and ServerrspecCookbook testing with KitcenCI and Serverrspec
Cookbook testing with KitcenCI and Serverrspec
 
Into to Docker (Central PA Java User Group - 8/14/2017)
Into to Docker (Central PA Java User Group - 8/14/2017)Into to Docker (Central PA Java User Group - 8/14/2017)
Into to Docker (Central PA Java User Group - 8/14/2017)
 
Infrastructure = Code
Infrastructure = CodeInfrastructure = Code
Infrastructure = Code
 
Boulder dev ops-meetup-11-2012-rundeck
Boulder dev ops-meetup-11-2012-rundeckBoulder dev ops-meetup-11-2012-rundeck
Boulder dev ops-meetup-11-2012-rundeck
 
Python virtualenv & pip in 90 minutes
Python virtualenv & pip in 90 minutesPython virtualenv & pip in 90 minutes
Python virtualenv & pip in 90 minutes
 
Undoing Things in Git
Undoing Things in GitUndoing Things in Git
Undoing Things in Git
 
Ansible, best practices
Ansible, best practicesAnsible, best practices
Ansible, best practices
 
SkySQL & MariaDB What's all the buzz?
SkySQL & MariaDB What's all the buzz?SkySQL & MariaDB What's all the buzz?
SkySQL & MariaDB What's all the buzz?
 
Introduction to bower
Introduction to bowerIntroduction to bower
Introduction to bower
 
Apache Hadoop & Hive installation with movie rating exercise
Apache Hadoop & Hive installation with movie rating exerciseApache Hadoop & Hive installation with movie rating exercise
Apache Hadoop & Hive installation with movie rating exercise
 
Ansible best practices
Ansible best practicesAnsible best practices
Ansible best practices
 

Andere mochten auch

Nway-Project, Git, github & opensource
Nway-Project, Git, github & opensourceNway-Project, Git, github & opensource
Nway-Project, Git, github & opensourceHudson Mendes
 
Basics About Git & GitHub
Basics About Git & GitHubBasics About Git & GitHub
Basics About Git & GitHubRaiful Hasan
 
Git para iniciantes v1.3.0 @ PHP Conference Brasil 2012
Git para iniciantes v1.3.0 @ PHP Conference Brasil 2012Git para iniciantes v1.3.0 @ PHP Conference Brasil 2012
Git para iniciantes v1.3.0 @ PHP Conference Brasil 2012Mauro George
 
Fluxo de desenvolvimento de software utilizando Git
Fluxo de desenvolvimento de software utilizando GitFluxo de desenvolvimento de software utilizando Git
Fluxo de desenvolvimento de software utilizando GitBruno Ricardo Siqueira
 
Controle de versão utilizando git
Controle de versão utilizando gitControle de versão utilizando git
Controle de versão utilizando gitfredmosc
 
Gitlab flow solo
Gitlab flow soloGitlab flow solo
Gitlab flow soloviniciusban
 
Introduction to Gitlab
Introduction to GitlabIntroduction to Gitlab
Introduction to GitlabJulien Pivotto
 

Andere mochten auch (14)

Nway-Project, Git, github & opensource
Nway-Project, Git, github & opensourceNway-Project, Git, github & opensource
Nway-Project, Git, github & opensource
 
Basics About Git & GitHub
Basics About Git & GitHubBasics About Git & GitHub
Basics About Git & GitHub
 
Git Rápido e Fácil
Git Rápido e FácilGit Rápido e Fácil
Git Rápido e Fácil
 
git 101
git 101git 101
git 101
 
Introdução ao Git
Introdução ao Git   Introdução ao Git
Introdução ao Git
 
Git para iniciantes v1.3.0 @ PHP Conference Brasil 2012
Git para iniciantes v1.3.0 @ PHP Conference Brasil 2012Git para iniciantes v1.3.0 @ PHP Conference Brasil 2012
Git para iniciantes v1.3.0 @ PHP Conference Brasil 2012
 
Fluxo de desenvolvimento de software utilizando Git
Fluxo de desenvolvimento de software utilizando GitFluxo de desenvolvimento de software utilizando Git
Fluxo de desenvolvimento de software utilizando Git
 
GIT Introduction
GIT IntroductionGIT Introduction
GIT Introduction
 
Controle de versão utilizando git
Controle de versão utilizando gitControle de versão utilizando git
Controle de versão utilizando git
 
Gitlab flow
Gitlab flowGitlab flow
Gitlab flow
 
Gitlab flow solo
Gitlab flow soloGitlab flow solo
Gitlab flow solo
 
Up GitLab Presentation 2015
Up GitLab Presentation 2015Up GitLab Presentation 2015
Up GitLab Presentation 2015
 
Introduction to Gitlab
Introduction to GitlabIntroduction to Gitlab
Introduction to Gitlab
 
Aprendendo Git
Aprendendo GitAprendendo Git
Aprendendo Git
 

Ähnlich wie Git lab installation guide

How To Install GitLab As Your Private GitHub Clone
How To Install GitLab As Your Private GitHub CloneHow To Install GitLab As Your Private GitHub Clone
How To Install GitLab As Your Private GitHub CloneVEXXHOST Private Cloud
 
GIT in a nutshell
GIT in a nutshellGIT in a nutshell
GIT in a nutshellalignan
 
FOSDEM 2017: GitLab CI
FOSDEM 2017:  GitLab CIFOSDEM 2017:  GitLab CI
FOSDEM 2017: GitLab CIOlinData
 
Gitlab Training with GIT and SourceTree
Gitlab Training with GIT and SourceTreeGitlab Training with GIT and SourceTree
Gitlab Training with GIT and SourceTreeTeerapat Khunpech
 
5 Things I Wish I Knew About Gitlab CI
5 Things I Wish I Knew About Gitlab CI5 Things I Wish I Knew About Gitlab CI
5 Things I Wish I Knew About Gitlab CISebastian Witowski
 
Matt Gauger - Git & Github web414 December 2010
Matt Gauger - Git & Github web414 December 2010Matt Gauger - Git & Github web414 December 2010
Matt Gauger - Git & Github web414 December 2010Matt Gauger
 
The Secrets of The FullStack Ninja - Part A - Session I
The Secrets of The FullStack Ninja - Part A - Session IThe Secrets of The FullStack Ninja - Part A - Session I
The Secrets of The FullStack Ninja - Part A - Session IOded Sagir
 
Git for a newbie
Git for a newbieGit for a newbie
Git for a newbieAnuj Sharma
 
Hands on Docker - Launch your own LEMP or LAMP stack - SunshinePHP
Hands on Docker - Launch your own LEMP or LAMP stack - SunshinePHPHands on Docker - Launch your own LEMP or LAMP stack - SunshinePHP
Hands on Docker - Launch your own LEMP or LAMP stack - SunshinePHPDana Luther
 
Gitlab ci, cncf.sk
Gitlab ci, cncf.skGitlab ci, cncf.sk
Gitlab ci, cncf.skJuraj Hantak
 
Gitlab and Lingvokot
Gitlab and LingvokotGitlab and Lingvokot
Gitlab and LingvokotLingvokot
 
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis OverviewLeo Lorieri
 
Docker at Digital Ocean
Docker at Digital OceanDocker at Digital Ocean
Docker at Digital OceanCloud 66
 
Git intro hands on windows with msysgit
Git intro hands on windows with msysgitGit intro hands on windows with msysgit
Git intro hands on windows with msysgitGeshan Manandhar
 
Introduction to git and Github
Introduction to git and GithubIntroduction to git and Github
Introduction to git and GithubWycliff1
 
Os dev tool box
Os dev tool boxOs dev tool box
Os dev tool boxbpowell29a
 

Ähnlich wie Git lab installation guide (20)

How To Install GitLab As Your Private GitHub Clone
How To Install GitLab As Your Private GitHub CloneHow To Install GitLab As Your Private GitHub Clone
How To Install GitLab As Your Private GitHub Clone
 
GIT in a nutshell
GIT in a nutshellGIT in a nutshell
GIT in a nutshell
 
FOSDEM 2017: GitLab CI
FOSDEM 2017:  GitLab CIFOSDEM 2017:  GitLab CI
FOSDEM 2017: GitLab CI
 
Gitlab Training with GIT and SourceTree
Gitlab Training with GIT and SourceTreeGitlab Training with GIT and SourceTree
Gitlab Training with GIT and SourceTree
 
5 Things I Wish I Knew About Gitlab CI
5 Things I Wish I Knew About Gitlab CI5 Things I Wish I Knew About Gitlab CI
5 Things I Wish I Knew About Gitlab CI
 
Matt Gauger - Git & Github web414 December 2010
Matt Gauger - Git & Github web414 December 2010Matt Gauger - Git & Github web414 December 2010
Matt Gauger - Git & Github web414 December 2010
 
The Secrets of The FullStack Ninja - Part A - Session I
The Secrets of The FullStack Ninja - Part A - Session IThe Secrets of The FullStack Ninja - Part A - Session I
The Secrets of The FullStack Ninja - Part A - Session I
 
Git for a newbie
Git for a newbieGit for a newbie
Git for a newbie
 
Hands on Docker - Launch your own LEMP or LAMP stack - SunshinePHP
Hands on Docker - Launch your own LEMP or LAMP stack - SunshinePHPHands on Docker - Launch your own LEMP or LAMP stack - SunshinePHP
Hands on Docker - Launch your own LEMP or LAMP stack - SunshinePHP
 
Git github
Git githubGit github
Git github
 
Gitlab ci, cncf.sk
Gitlab ci, cncf.skGitlab ci, cncf.sk
Gitlab ci, cncf.sk
 
Gitlab and Lingvokot
Gitlab and LingvokotGitlab and Lingvokot
Gitlab and Lingvokot
 
Introduction to Git and Github
Introduction to Git and GithubIntroduction to Git and Github
Introduction to Git and Github
 
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
 
Docker at Digital Ocean
Docker at Digital OceanDocker at Digital Ocean
Docker at Digital Ocean
 
Git hooks
Git hooksGit hooks
Git hooks
 
Git intro hands on windows with msysgit
Git intro hands on windows with msysgitGit intro hands on windows with msysgit
Git intro hands on windows with msysgit
 
Introduction to git and Github
Introduction to git and GithubIntroduction to git and Github
Introduction to git and Github
 
Os dev tool box
Os dev tool boxOs dev tool box
Os dev tool box
 
Basic Rails Training
Basic Rails TrainingBasic Rails Training
Basic Rails Training
 

Kürzlich hochgeladen

The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 

Kürzlich hochgeladen (20)

The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 

Git lab installation guide

  • 1. Installing Gitlab with Gitolite and Git on CentOS Md. Raiful Hasan DIVINE IT LIMITED www.divine-it.net | DIVINE IT LIMITED 1
  • 2. Requirements: CentOS 6.3 Minimal Updating and adding basic software and services Add EPEL repository rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-7.noarch.rpm Install the required tools for gitlab and yum -y groupinstall 'Development Tools' 'Additional Development' gitoliteyum -y install readline readline-devel ncurses-devel gdbm-devel glibc-devel tcl-devel openssl-devel curl-devel expat-devel db4-devel byacc gitolite sqlite-devel gcc-c++ libyaml libyaml-devel libffi libffi-devel libxml2 libxml2-devel libxslt libxslt-devel libicu libicu-devel system-config-firewall-tui python-devel redis Downloading and extracting ruby: curl -O http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p320.tar.gz tar xzvf ruby-1.9.2-p320.tar.gz cd ruby-1.9.2-p320 Now here are two choices. 1. For Single ruby user. 2. For Multiple ruby versions user. 1 . Configure without binary suffix ./configure --enable-shared --disable-pthread 2 . Configure with binary suffix (for parallel installation of ruby versions) ./configure --enable-shared --disable-pthread --program-suffix _n When choosing this option, the binary ruby will be named ruby_n and gem gem_n. Also we will have to use rake_n. www.divine-it.net | DIVINE IT LIMITED 2
  • 3. Now install ruby: make && make install Replace the 64 in the path with 32 if you're running on a 32 bit box yum install qt-devel qtwebkit-devel export PATH=$PATH:/usr/lib64/qt4/bin Now we have to install all the gems GitLab needs to run: gem update --system gem update gem install rails Now everything is set up and we can start to configure the environment for GitLab. First we create a user that will run GitLab: adduser --shell /bin/bash --create-home --home-dir /home/gitlab gitlab Because this user will be the Admin of the repos on the server, we need to have a RSA key pair to authenticate: su - gitlab -c "ssh-keygen -t rsa" Now switch back to root account. Because GitLab is only a graphical user interface to manage repos, we need a power full backend. gitolite will do this for us. We also need a user for gitolite. adduser --system --shell /bin/sh --comment 'gitolite' --create-home --home-dir /home/git git www.divine-it.net | DIVINE IT LIMITED 3
  • 4. Gitolite needs to know one key that it knows as admin. We will pass the key of GitLab to gitolite. To do so we first copy the private key of our gitlab user to the home directory of our gitolite user: # make sure do this as root cp /home/gitlab/.ssh/id_rsa.pub /home/git/gitlab.pub Now we need to initialize gitolite: su git gl-setup ~/gitlab.pub # this passes the admin key to gitolite Switch back to root user now. We now need to give our management software (GitLab) access to the repos: usermod -a -G git gitlab chmod -R g+rwX /home/git/repositories/ chmod 770 /home/git Because the gitlab user will need a password later on, we configure it right now, so we are finished with all the user stuff. passwd gitlab # please choose a good password :) As next step we need to introduce GitLab to gitolite (that is, we let them change their SSH-keys) su gitlab ssh root@localhost ... And back to the root user. www.divine-it.net | DIVINE IT LIMITED 4
  • 5. GitLab needs a few gems, we haven't installed yet: As mentioned before, the gitlab user will have to do a bit of administration stuff, so we need to give him sudo rights. To do so, we edit the sudoers file with visudo: visudo Add gitlab ALL=(ALL) ALL after root ALL=(ALL) ALL so it looks like this: ... root ALL=(ALL) ALL gitlab ALL=(ALL) ALL ... After another two gems we are finished with the gem stuff: gem install ruby-debug19 gem install charlock_holmes We now switch to our gitlab user and we won't use our root account anymore: su gitlab Get the GitLab software: cd && git clone git://github.com/gitlabhq/gitlabhq.git cd gitlabhq We're nearly done. Next we bundle our application. bundle install www.divine-it.net | DIVINE IT LIMITED 5
  • 6. GitLab will use a MySQL database (in our case), which we need to install and start: yum -y install mysql-server /etc/init.d/mysqld start To configure the MySQL server easily we use: mysql_secure_installation Remember the password you type in for root! We now connect to our database server to create a user for GitLab: mysql -u root -p We now have a mysql shell. mysql> CREATE DATABASE gitlab CHARACTER SET UTF8; mysql> GRANT ALL PRIVILEGES ON gitlab.* TO 'gitlabusr'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION; mysql> quit Remember the password and username (here: gitlabusr and password)! To create the database a script is deployed with GitLab. However it needs an additional service to run: sudo nohup redis-server > /dev/null Enter the password you created for the gitlab user and hit CTRL+Z. Then type bg The service is now running in background. www.divine-it.net | DIVINE IT LIMITED 6
  • 7. We now configure GitLab by copying the configurion files from example to real: cp ~/gitlabhq/config/database.yml.mysql ~/gitlabhq/config/database.yml cp ~/gitlabhq/config/gitlab.yml.example ~/gitlabhq/config/gitlab.yml In database.yml you have to edit the production settings of your database (at the very top of the file). You have to change the database-name, username and password. We will now create the database structure: RAILS_ENV=production rake db:setup RAILS_ENV=production rake db:seed_fu To start the server we use bundle exec rails s -e production We're done. All us have to do now, is set up firewall and navigate to http://ip-or-domain:3000/ and log in with user: admin@local.host pass: 5iveL!fe www.divine-it.net | DIVINE IT LIMITED 7