时间:2021-07-01 10:21:17 帮助过:8人阅读
GitLab是用于仓库管理系统的开源项目,一般安装于Ubuntu和Debian系统,当然也可以安装于CentOS系统,今天小编要给大家介绍的就是GitLab在CentOS系统下的安装,以及GitLab安装前的配置,一起来学习下吧。
前置要求
一定要先关闭iptable与selinux
本文安装的系统为centos 6.2 64位系统,安装在dell r410机器
1、安装epel与基础依赖库及软件
cd /tmp
wget http://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(一般默认安装都是1.8的,官方要求1.9以上)
mkdir /tmp/ruby && cd /tmp/ruby
curl --progress http://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、创建一个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 ‘http://domain.com/’
vim config.yml
# Do setup
。/bin/install