系統(tǒng)之家 - 系統(tǒng)光盤下載網(wǎng)站!

當(dāng)前位置:系統(tǒng)之家 > 系統(tǒng)教程 > CentOS系統(tǒng)安裝GitLab

CentOS系統(tǒng)安裝GitLab的步驟

時(shí)間:2015-03-25 17:21:14 作者:qipeng 來源:系統(tǒng)之家 1. 掃描二維碼隨時(shí)看資訊 2. 請(qǐng)使用手機(jī)瀏覽器訪問: https://m.xitongzhijia.net/xtjc/20150325/42793.html 手機(jī)查看 評(píng)論

  GitLab是用于倉(cāng)庫(kù)管理系統(tǒng)的開源項(xiàng)目,一般安裝于Ubuntu和Debian系統(tǒng),當(dāng)然也可以安裝于CentOS系統(tǒng),今天小編要給大家介紹的就是GitLab在CentOS系統(tǒng)下的安裝,以及GitLab安裝前的配置,一起來學(xué)習(xí)下吧。

 CentOS系統(tǒng)安裝GitLab的步驟

  前置要求

  一定要先關(guān)閉iptable與selinux

  本文安裝的系統(tǒng)為centos 6.2 64位系統(tǒng),安裝在dell r410機(jī)器

  1、安裝epel與基礎(chǔ)依賴庫(kù)及軟件

  cd /tmp

  wget https://download.Fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm

  1rpm -Uvh epel-release-6-8.noarch.rpm

  2yum install -y readline-devel libyaml-devel gdbm-devel ncurses-devel redis openssl-devel

  3zlib-devel gcc gcc-c++ make autoconf readline-devel curl-devel expat-devel gettext-devel

  4tk-devel libxml2-devel libffi-devel libxslt-devel libicu-devel httpd httpd-devel gitolite git-all python-devel python-pip sqlite-devel sendmail vim mysql-devel mysql-server patch libyaml* pcre-devel

  2、安裝ruby(一般默認(rèn)安裝都是1.8的,官方要求1.9以上)

  mkdir /tmp/ruby && cd /tmp/ruby

  curl --progress https://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p392.tar.gz | tar xz

  cd ruby-1.9.3-p392/

  。/configure

  make

  make install

  gem install bundler

  ln -s /usr/local/bin/ruby /usr/bin/ruby

  ln -s /usr/local/bin/gem /usr/bin/gem

  ln -s /usr/local/bin/bundle /usr/bin/bundle

  3、創(chuàng)建一個(gè)git用戶供GitLab使用

  adduser --comment ‘GitLab’ git

  chmod –R 755 /home/git

  4、安裝gitlab 的shell

  # Login as git

  sudo su git

  # Go to home directory

  cd /home/git

  # Clone gitlab shell

  git clone https://github.com/gitlabhq/gitlab-shell.git

  cd gitlab-shell

  # switch to right version

  git checkout v1.3.0

  cp config.yml.example config.yml

  # Edit config and replace gitlab_url

  # with something like ‘https://domain.com/’

  vim config.yml

  # Do setup

  。/bin/install

  5、建立gitlab數(shù)據(jù)庫(kù)并授權(quán)

  # Login to MySQL

  mysql -u root -p

  # Create a user for GitLab. (change $password to a real password)

  mysql》 CREATE USER ‘gitlab’@‘localhost’ IDENTIFIED BY ‘gitlab’;

  # Create the GitLab production database

  mysql》 CREATE DATABASE IF NOT EXISTS `gitlabhq_production` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`;

  # Grant the GitLab user necessary permissopns on the table.

  mysql》 GRANT SELECT, LOCK TABLES, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON `gitlabhq_production`.* TO ‘gitlab’@‘localhost’;

  # Quit the database session

  mysql》 \q

  6、克隆gitlab源

  # Clone GitLab repository

  cd /home/git

  sudo -u git -H git clone https://github.com/gitlabhq/gitlabhq.git gitlab

  # Go to gitlab dir

  cd /home/git/gitlab

  # Checkout to stable release

  sudo -u git -H git checkout 5-1-stable

  Configure it

  cd /home/git/gitlab

  # Copy the example GitLab config

  sudo -u git -H cp config/gitlab.yml.example config/gitlab.yml

  # Make sure to change “localhost” to the fully-qualified domain name of your

  # host serving GitLab where necessary

  sudo -u git -H vim config/gitlab.yml

  # Make sure GitLab can write to the log/ and tmp/ directories

  sudo chown -R git log/

  sudo chown -R git tmp/

  sudo chmod -R u+rwX log/

  sudo chmod -R u+rwX tmp/

  # Create directory for satellites

  sudo -u git -H mkdir /home/git/gitlab-satellites

  # Create directories for sockets/pids and make sure GitLab can write to them

  sudo -u git -H mkdir tmp/pids/

  sudo -u git -H mkdir tmp/sockets/

  sudo chmod -R u+rwX tmp/pids/

  sudo chmod -R u+rwX tmp/sockets/

  # Create public/uploads directory otherwise backup will fail

  sudo -u git -H mkdir public/uploads

  sudo chmod -R u+rwX public/uploads

  # Copy the example Puma config

  sudo -u git -H cp config/puma.rb.example config/puma.rb

  # Configure Git global settings for git user, useful when editing via web

  # Edit user.email according to what is set in gitlab.yml

  sudo -u git -H git config --global user.name “GitLab”

  sudo -u git -H git config --global user.email “gitlab@localhost”

  上面就是CentOS安裝配置GitLab的方法介紹了,在安裝GitLab前需要配置GitLab環(huán)境,需安裝安裝epel與基礎(chǔ)依賴庫(kù)及軟件,再配置GitLab數(shù)據(jù)庫(kù)。

標(biāo)簽 CentOS

發(fā)表評(píng)論

0

沒有更多評(píng)論了

評(píng)論就這些咯,讓大家也知道你的獨(dú)特見解

立即評(píng)論

以上留言僅代表用戶個(gè)人觀點(diǎn),不代表系統(tǒng)之家立場(chǎng)

其他版本軟件

熱門教程

人氣教程排行

Linux系統(tǒng)推薦

掃碼關(guān)注
掃碼關(guān)注

掃碼關(guān)注 官方交流群 軟件收錄