简单安装
Omnibus 包安装 GitLab
http://www.21yunwei.com/archives/4351
http://peiqiang.net/2014/07/30/install-gitlab.html
http://blog.csdn.net/hustpzb/article/details/8230454/
源码安装
一、环境
gitlab的安装说明https://github.com/lubia/gitlab-recipes/tree/master/install/centos
系统:CentOS6.4最小化安装
gitlab 5.2.0
centos64
Redis 2.6.13
nginx-1.4.1
mysql-
gitlab中文使用指南:GitLab使用介绍
首先我们选择比较快的yum源,不然安装速度会非常的慢的.这里使用中国科技大学的yum源http://lug.ustc.edu.cn/wiki/mirrors/help/centos更换yum源方法参考:http://blog.haohtml.com/archives/5669,
三。默认安装的git版本可能会低一些,需要升级到最新版本才可以.
yum -y
install
readline-devel gdbm-devel ncurses-devel openssl-devel zlib-devel
gcc
gcc
-c++
make
autoconf curl-devel expat-devel gettext-devel tk-devel libxml2-devel libffi-devel libxslt-devel libicu-devel git-all python-devel vim
sudo
四、安装git
删除系统默认的git,使用源码安装git
[root@gitlab~]
#git--version
gitversion1.7.1
[root@gitlab~]
#yumremovegit-y
#下载源码安装包
[root@gitlab~]
#wgethttps://www.kernel.org/pub/software/scm/git/git-2.1.3.tar.gz
[root@gitlab~]
#tar zxfgit-2.1.3.tar.gz
[root@gitlab~]
#cdgit-2.1.3
[root@gitlabgit-2.1.3]
#./configure
[root@gitlabgit-2.1.3]
#make&&makeprefix=/usr/localinstall
[root@gitlabgit-2.1.3]
#ln-s/usr/local/bin/git/usr/bin/
[root@gitlabgit-2.1.3]
#git--version
gitversion2.1.3
删除系统自带的ruby环境,确保ruby是2.0以上的版本
[root@gitlab~]
#yumremoveruby-y
#下载ruby安装包,最少2.0以上
[root@gitlab~]
#wgetftp://ftp.ruby-lang.org/pub/ruby/ruby-2.1.2.tar.gz
[root@gitlab~]
#tar zxvfruby-2.1.2.tar.gz
[root@gitlab~]
#cdruby-2.1.2
[root@gitlabruby-2.1.2]
#./configure--prefix=/usr/local/
[root@gitlabruby-2.1.2]
#make&&makeinstall
安装bundler
[root@gitlabruby-2.1.2]
#geminstallbundler--no-doc
六、创建git用户
[root@gitlab~]
#adduser--system--shell/bin/bash--comment'GitLab'--create-home--home-dir/home/git/git
查看MysqL安装结果
创建数据库并授权
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
@H_404_369@
29
30
31
32
|
[root@gitlab~]
#MysqL-uroot-p-h127.0.0.1
Enterpassword:
#这里的密码是我的安装脚本中提供的密码
WelcometotheMysqLmonitor.Commandsendwith;or\g.
Serverversion:5.5.37Sourcedistribution
Copyright(c)2000,2014,Oracleand
/or
itsaffiliates.Allrightsreserved.
OracleisaregisteredtrademarkofOracleCorporationand
/or
its
affiliates.Othernamesmaybetrademarksoftheirrespective
owners.
Type
'help;'
or
'\h'
for
help.Type
'\c'
to
clear
thecurrentinputstatement.
MysqL>CREATEDATABASEIFNOTEXISTS`gitlabhq_production`DEFAULTCHARACTERSET`utf8`COLLATE`utf8_unicode_ci`;
QueryOK,1rowaffected(0.00sec)
MysqL>GRANTSELECT,LOCKTABLES,INSERT,UPDATE,DELETE,CREATE,DROP,INDEX,ALTERON`gitlabhq_production`.*TO
'git'
@
'localhost'
IDENTIFIEDBY
'gitpasswd'
;
QueryOK,0rowsaffected(0.00sec)
MysqL>flushprivileges;
QueryOK,0rowsaffected(0.01sec)
+------+-----------+-------------------------------------------+
|user|host|password|
+------+-----------+-------------------------------------------+
|root|localhost|*B181A5BCA7C882221F5B8F6F9657AE71FF67EDDB|
|root|127.0.0.1|*B181A5BCA7C882221F5B8F6F9657AE71FF67EDDB|
|git|localhost|*6EA0EDE421A05E610ADBFC5D47B93B6E06C6216F|
+------+-----------+-------------------------------------------+
3rows
in
set
(0.00sec)
|
@H_410_301@
[root@gitlab~]
#MysqL-ugit-p-hlocalhost
Enterpassword:
#这里的密码是上文中给定的gitpasswd
WelcometotheMysqLmonitor.Commandsendwith;or\g.
Serverversion:5.5.37Sourcedistribution
Copyright(c)2000,Oracleand
/or
itsaffiliates.Allrightsreserved.
OracleisaregisteredtrademarkofOracleCorporationand
/or
its
affiliates.Othernamesmaybetrademarksoftheirrespective
owners.
Type
'help;'
or
'\h'
for
help.Type
'\c'
to
clear
thecurrentinputstatement.
MysqL>showdatabases;
+---------------------+
|Database|
+---------------------+
|information_schema|
|gitlabhq_production|
|
test
|
+---------------------+
3rows
in
set
(0.00sec)
安装redis 及 配置redis
安装redis
[root@gitlab~]
#chkconfigredison
[root@gitlab~]
#/etc/init.d/redisstart
Startingredis-server:[OK]
[root@gitlab~]
#netstat-anpt|grepredis
tcp00127.0.0.1:63790.0.0.0:*LISTEN8755
/redi
九、安装gitlab
[root@gitlab~]
#cd/home/git/
[root@gitlabgit]
#sudo-ugit-Hgitclonehttps://gitlab.com/gitlab-org/gitlab-ce.git-b7-4-stablegitlab
Cloninginto
'gitlab'
...
remote:Countingobjects:127971,
done
.
remote:Compressingobjects:100%(32073
/32073
),
done
.
remote:Total127971(delta97845),reused123442(delta94050)
Receivingobjects:100%(127971
/127971
),81.35MiB|1.63MiB
/s
,
done
.
Resolvingdeltas:100%(97845
/97845
),
done
.
Checkingconnectivity...
done
.
[root@gitlabgit]
#cdgitlab/
[root@gitlabgitlab]
#sudo-ugit-Hcpconfig/gitlab.yml.exampleconfig/gitlab.yml
#下面这条命令可以不用操作,保持默认即可
[root@gitlabgitlab]
#sudo-ugit-Hvimconfig/gitlab.yml
gitlab:
##Webserversettings(note:hostistheFQDN,donotincludehttp://)
port:80
https:
false
#修改相应的目录权限
[root@gitlabgitlab]
#chown-Rgitlog/
[root@gitlabgitlab]
#chown-Rgittmp/
[root@gitlabgitlab]
#chmod-Ru+rwXlog/
[root@gitlabgitlab]
#chmod-Ru+rwXtmp/
[root@gitlabgitlab]
#chmod-Ru+rwXtmp/pids/
[root@gitlabgitlab]
#chmod-Ru+rwXtmp/sockets/
[root@gitlabgitlab]
#chmod-Ru+rwXpublic/uploads