歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> 在RHEL6/CentOS6/ScientificLinux6上安裝GitLab 6.0.2

在RHEL6/CentOS6/ScientificLinux6上安裝GitLab 6.0.2

日期:2017/2/28 14:35:24   编辑:Linux教程

目錄
1. 安裝額外的包倉庫
2. 安裝必需的軟件包
3. 安裝git 1.8版本。
4. 設置redis自動啟動
5. 安裝ruby
6. 創建git系統用戶
7. 安裝GitLab shell
8. 安裝MySQL數據庫
9. 安裝GitLab

下載
配置
配置GitLab數據庫鏈接
安裝Gems
初始化數據庫並激活高級特性
安裝init腳本
檢查應用程序狀況
啟動gitlab
再次檢查應用程序狀態
10. 配置Apache
創建SSL證書
創建虛擬主機
11. 配置防火牆
12. 完成!
因開發需要,我需要安裝一個Git服務器供公司內部做代碼托管之用。當前最著名的Git服務器就是GitLab。Scientific Linux是重新編譯的Red Hat Enterprise Linux,由費米國家加速器實驗室、歐洲核研究組織以及世界各地的大學和實驗室共同開發。

下面記錄下我在Scientific Linux 6.4版上安裝GitLab 6.0.2的過程。

1. 安裝額外的包倉庫
sudo wget -O /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6 https://Fedoraproject.org/static/0608B895.txt

sudo rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6

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

sudo yum-config-manager --enable epel

sudo rpm -ivh http://li.nux.ro/download/nux/dextop/el6/x86_64/nux-dextop-release-0-2.el6.nux.noarch.rpm

2. 安裝必需的軟件包
su -

yum -y update

yum -y groupinstall 'Development Tools'

yum -y install vim-enhanced readline readline-devel ncurses-devel gdbm-devel glibc-devel tcl-devel openssl-devel curl-devel expat-devel db4-devel byacc 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 sudo wget crontabs logwatch logrotate perl-Time-HiRes python27 python27-devel

如果一些軟件包(例如gdbm-devel, libffi-devel和libicu-devel)未能安裝,運行下面的命令:

yum-config-manager --enable rhel-6-server-optional-rpms

然後重新安裝上面的軟件包。

3. 安裝git 1.8版本。
su -

cd /tmp

yum -y install git perl-ExtUtils-MakeMaker

git clone git://github.com/git/git.git

cd /tmp/git/

git checkout v1.8.4

autoconf

./configure --prefix=/usr/local

make && make install

rm -rf /tmp/git/

yum erase git

4. 設置redis自動啟動
sudo chkconfig redis --level 235 on

sudo service redis start

5. 安裝ruby
curl --progress ftp://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p247.tar.gz | tar xz

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

curl --progress ftp://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p247.tar.gz | tar xz

cd ruby-2.0.0-p247

./configure --prefix=/usr/local/

make && make install

sudo gem install bundler --no-ri --no-rdoc

6. 創建git系統用戶
su -

adduser --system --shell /bin/bash --comment 'GitLab' --create-home --home-dir /home/git/ git

su -

echo [email protected] > /root/.forward

chown root /root/.forward

chmod 600 /root/.forward

restorecon /root/.forward

echo [email protected] > /home/git/.forward

chown git /home/git/.forward

chmod 600 /home/git/.forward

restorecon /home/git/.forward

7. 安裝GitLab shell
su -

su - git

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

cd gitlab-shell

git checkout v1.7.0

cp config.yml.example config.yml

vim config.yml

修改gitlab_url為http://git.linuxidc.com/

./bin/install

8. 安裝MySQL數據庫
su -

yum install -y mysql-server mysql-devel

chkconfig mysqld --level 235 on

service mysqld start

登錄MySQL

mysql -u root -p

CREATE USER 'gitlab'@'localhost' IDENTIFIED BY 'supersecret';

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

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

\q

GitLab 的詳細介紹:請點這裡
GitLab 的下載地址:請點這裡

Copyright © Linux教程網 All Rights Reserved