简单安装
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-
@H_403_62@一.GitLab使用介绍
gitlab中文使用指南:GitLab使用介绍
首先我们选择比较快的yum源,不然安装速度会非常的慢的.这里使用中国科技大学的yum源http://lug.ustc.edu.cn/wiki/mirrors/help/centos更换yum源方法参考:http://blog.haohtml.com/archives/5669,
三。默认安装的git版本可能会低一些,需要升级到最新版本才可以.
yum -y @H_403_62@
install@H_403_62@
readline-devel gdbm-devel ncurses-devel openssl-devel zlib-devel@H_403_62@
gcc@H_403_62@
gcc@H_403_62@
-c++@H_403_62@
make@H_403_62@
autoconf curl-devel expat-devel gettext-devel tk-devel libxml2-devel libffi-devel libxslt-devel libicu-devel git-all python-devel vim@H_403_62@
sudo@H_403_62@
@H_403_62@
@H_403_62@
@H_403_62@
四、安装git
删除系统默认的git,使用源码安装git
@H_403_62@
[root@gitlab~]@H_403_62@
#git--version
gitversion1.7.1@H_403_62@
@H_403_62@
[root@gitlab~]@H_403_62@
#yumremovegit-y
@H_403_62@
#下载源码安装包@H_403_62@
[root@gitlab~]@H_403_62@
#wgethttps://www.kernel.org/pub/software/scm/git/git-2.1.3.tar.gz@H_403_62@
gitversion2.1.3@H_403_62@
五、安装ruby环境
删除系统自带的ruby环境,确保ruby是2.0以上的版本
#下载ruby安装包,最少2.0以上@H_403_62@
七、安装MysqL
http://blog.csdn.net/ssdfsfdf/article/details/44425785
查看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
29
30
31
32
Serverversion:5.5.37Sourcedistribution@H_403_62@
affiliates.Othernamesmaybetrademarksoftheirrespective@H_403_62@
owners.@H_403_62@
Type@H_403_62@
'help;'@H_403_62@
or@H_403_62@
'\h'@H_403_62@
for@H_403_62@
help.Type@H_403_62@
'\c'@H_403_62@
to@H_403_62@
clear@H_403_62@
thecurrentinputstatement.@H_403_62@
MysqL>CREATEDATABASEIFNOTEXISTS`gitlabhq_production`DEFAULTCHARACTERSET`utf8`COLLATE`utf8_unicode_ci`;@H_403_62@
QueryOK,1rowaffected(0.00sec)@H_403_62@
MysqL>GRANTSELECT,LOCKTABLES,INSERT,UPDATE,DELETE,CREATE,DROP,INDEX,ALTERON`gitlabhq_production`.*TO@H_403_62@
'git'@H_403_62@
@@H_403_62@
'localhost'@H_403_62@
IDENTIFIEDBY@H_403_62@
'gitpasswd'@H_403_62@
;@H_403_62@
QueryOK,0rowsaffected(0.00sec)@H_403_62@
QueryOK,0rowsaffected(0.01sec)@H_403_62@
+------+-----------+-------------------------------------------+@H_403_62@
|user|host|password|@H_403_62@
+------+-----------+-------------------------------------------+@H_403_62@
|root|localhost|*B181A5BCA7C882221F5B8F6F9657AE71FF67EDDB|@H_403_62@
|root|127.0.0.1|*B181A5BCA7C882221F5B8F6F9657AE71FF67EDDB|@H_403_62@
|git|localhost|*6EA0EDE421A05E610ADBFC5D47B93B6E06C6216F|@H_403_62@
+------+-----------+-------------------------------------------+@H_403_62@
@H_704_301@
Serverversion:5.5.37Sourcedistribution@H_403_62@
affiliates.Othernamesmaybetrademarksoftheirrespective@H_403_62@
owners.@H_403_62@
Type@H_403_62@
'help;'@H_403_62@
or@H_403_62@
'\h'@H_403_62@
for@H_403_62@
help.Type@H_403_62@
'\c'@H_403_62@
to@H_403_62@
clear@H_403_62@
thecurrentinputstatement.@H_403_62@
+---------------------+@H_403_62@
|Database|@H_403_62@
+---------------------+@H_403_62@
|information_schema|@H_403_62@
|gitlabhq_production|@H_403_62@
+---------------------+@H_403_62@
安装redis 及 配置redis
安装redis
Startingredis-server:[OK]@H_403_62@
tcp00127.0.0.1:63790.0.0.0:*LISTEN8755@H_403_62@/redi@H_403_62@
@H_403_62@
九、安装gitlab
@H_403_62@
@H_403_62@
[root@gitlab~]@H_403_62@
#cd/home/git/
@H_403_62@
[root@gitlabgit]@H_403_62@
#sudo-ugit-Hgitclonehttps://gitlab.com/gitlab-org/gitlab-ce.git-b7-4-stablegitlab@H_403_62@
remote:Compressingobjects:100%(32073@H_403_62@
/32073@H_403_62@
),@H_403_62@
done@H_403_62@
.@H_403_62@
remote:Total127971(delta97845),reused123442(delta94050)@H_403_62@
Receivingobjects:100%(127971@H_403_62@
/127971@H_403_62@
),81.35MiB|1.63MiB@H_403_62@
/s@H_403_62@
,@H_403_62@
done@H_403_62@
.@H_403_62@
@H_403_62@
[root@gitlabgitlab]@H_403_62@
#sudo-ugit-Hcpconfig/gitlab.yml.exampleconfig/gitlab.yml
@H_403_62@
#下面这条命令可以不用操作,保持默认即可@H_403_62@
gitlab:@H_403_62@
@H_403_62@
host:www.gitlab.com@H_403_62@
#这里设置的域名是为后面的postfix使用的,在后文中的gitlab.conf站点配置文件中也是使用的这个域名,普通用户访问gitlab使用这个域名@H_403_62@
#创建目录@H_403_62@
1@H_403_62@
worker_processes1@H_403_62@
[root@gitlabgitlab]@H_403_62@
#sudo-ugit-Hcpconfig/initializers/rack_attack.rb.exampleconfig/initializers/rack_attack.rb@H_403_62@
#编辑连接redis的配置@H_403_62@
@H_403_62@
production:@H_403_62@
@H_403_62@
[root@gitlabgitlab]@H_403_62@
#sudo-ugit-Hchmodo-rwxconfig/database.yml
十一、安装gem
@H_403_62@
source@H_403_62@
"https://ruby.taobao.org"@H_403_62@
#将第一行修改成taobao的源
gitlab]@H_403_62@#sudo-ugitvimGemfile@H_403_62@@H_403_62@@H_403_62@.lock
remote: https://ruby.taobao.org/:wq:wq
@H_403_62@
[root@gitlabgitlab]@H_403_62@
#ln-s/usr/local/bin/bundle/usr/bin/
@H_403_62@
[root@gitlabgitlab]@H_403_62@
#sudo-ugit-Hbundleinstall--deployment--withoutdevelopmenttestpostgresaws
@H_403_62@
Gem files will remain installed in /home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/charlock_holmes-0.6.9.4 for inspection.
Results logged to
/home/git/gitlab/vendor/bundle/ruby/2.1.0/extensions/x86_64-linux/2.1.0-static/charlock_holmes-0.6.9.4/gem_make.out
An error occurred while installing charlock_holmes (0.6.9.4),and Bundler cannot continue.
Make sure that `gem install charlock_holmes -v '0.6.9.4'` succeeds before bundling.
解决 错误
gem list
看看 是不是已经装了 版本不一样
charlock_holmes-0.6.9.4
卸载到 gem uninstall charlock_holmes
安装
sudo gem install charlock_holmes -v '0.6.9.4'
Gem files will remain installed in /home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/MysqL2-0.3.16 for inspection.
Results logged to /home/git/gitlab/vendor/bundle/ruby/2.1.0/extensions/x86_64-linux/2.1.0-static/MysqL2-0.3.16/gem_make.out
An error occurred while installing MysqL2 (0.3.16),and Bundler cannot continue.
Make sure that `gem install MysqL2 -v '0.3.16'` succeeds before bundling.
MysqL2 错误
An error occurred while installing MysqL2 (0.3.16),and Bundler cannot continue.
Make sure that `gem install MysqL2 -v '0.3.16'` succeeds before bundling.
gem install MysqL2 -v '0.3.16'`
yum install MysqL-devel
十二、安装gitlab-shell
[root@gitlabgitlab]@H_403_62@
# sudo-ugit-Hbundleexecrakegitlab:shell:install[v2.0.1]REDIS_URL=unix:/var/run/redis redis.sockRAILS_ENV=production
@H_403_62@
gitclone@H_403_62@
'https://gitlab.com/gitlab-org/gitlab-shell.git'@H_403_62@
'/home/git/gitlab-shell/'@H_403_62@
remote:Compressingobjects:100%(1639@H_403_62@
/1639@H_403_62@
),@H_403_62@
done@H_403_62@
.@H_403_62@
Receivingobjects:100%(2118@H_403_62@
/2118@H_403_62@
),306.39KiB|177.00KiB@H_403_62@
/s@H_403_62@
,@H_403_62@
done@H_403_62@
.@H_403_62@
gitreset--hard$(gitdescribev2.0.1||gitdescribeorigin@H_403_62@
/v2@H_403_62@
.0.1)||gitfetchorigin&&gitreset--hard$(gitdescribev2.0.1||gitdescribeorigin@H_403_62@
/v2@H_403_62@
.0.1)@H_403_62@
HEADisnowata3b5445Fixbugwhenchangestopost-receiveworkerwasnotdumpedproperly@H_403_62@
HEADisnowata3b5445Fixbugwhenchangestopost-receiveworkerwasnotdumpedproperly@H_403_62@
touch@H_403_62@
/home/git/@H_403_62@
.@H_403_62@
ssh@H_403_62@
/authorized_keys@H_403_62@
:OK@H_403_62@
chmod@H_403_62@
600@H_403_62@
/home/git/@H_403_62@
.@H_403_62@
ssh@H_403_62@
/authorized_keys@H_403_62@
:OK@H_403_62@
find@H_403_62@
/home/git/repositories/@H_403_62@
-@H_403_62@
type@H_403_62@
d-@H_403_62@
exec@H_403_62@
chmod@H_403_62@
g+s{};:OK
@H_403_62@
---@H_403_62@
user:git@H_403_62@
http_settings:@H_403_62@
redis:@H_403_62@
log_level:INFO@H_403_62@
十三、初始化数据库
Thiswillcreatethenecessarydatabasetablesandseedthedatabase.@H_403_62@
Doyouwantto@H_403_62@
continue@H_403_62@
(@H_403_62@
yes@H_403_62@
/no@H_403_62@
)?@H_403_62@
yes@H_403_62@
#输入yes
十四、下载服务脚本
@H_403_62@
[root@gitlabgitlab]@H_403_62@
#wget-O/etc/init.d/gitlabhttps://gitlab.com/gitlab-org/gitlab-recipes/raw/master/init/sysvinit/centos/gitlab-unicorn@H_403_62@
#配置gitlab的启动级别@H_403_62@
#配置logrotate@H_403_62@
[root@gitlabgitlab]@H_403_62@
#sudo-ugit-Hbundleexecrakegitlab:env:infoRAILS_ENV=production@H_403_62@
Systeminformation@H_403_62@
System: @H_403_62@
CurrentUser: git@H_403_62@
UsingRVM: no@H_403_62@
RubyVersion: 2.1.2p95@H_403_62@
GemVersion: 2.2.2@H_403_62@
BundlerVersion:1.9.7@H_403_62@
RakeVersion: 10.3.2@H_403_62@
SidekiqVersion:2.17.0@H_403_62@
GitLabinformation@H_403_62@
Version: 7.4.5@H_403_62@
Revision: 19d572e@H_403_62@
SSHCloneURL: git@localhost:some-project.git@H_403_62@
UsingLDAP: no@H_403_62@
UsingOmniauth: no@H_403_62@
GitLabShell@H_403_62@
Version: 2.0.1@H_403_62@
[root@gitlabgitlab]@H_403_62@
#sudo-ugit-Hbundleexecrakeassets:precompileRAILS_ENV=production@H_403_62@
#启动gitlab服务@H_403_62@
Startingunicorn:[OK]@H_403_62@
Startingsidekiq:[OK]
十五、安装Nginx服务,并下载gitlab的站点配置文件
这里的Nginx使用yum进行安装
@H_403_62@
[root@gitlabgitlab]@H_403_62@
#yuminstall-yNginx
No package Nginx available. 解决:
http://blog.chinaunix.net/uid-29612873-id-4226804.html
@H_403_62@
[root@gitlabgitlab]@H_403_62@
#chkconfigNginxon
@H_403_62@
[root@gitlabgitlab]@H_403_62@
#wget-O/etc/Nginx/conf.d/gitlab.confhttps://gitlab.com/gitlab-org/gitlab-ce/raw/master/lib/support/Nginx/gitlab-ssl@H_403_62@
将Nginx用户添加到git组
server_name www.gitlab.com@H_403_62@
配置SSL证书
十六、Gitlab配置SMTP邮件
原文链接:https://www.f2er.com/centos/376543.html