CentOS6.4 安装gitlab

前端之家收集整理的这篇文章主要介绍了CentOS6.4 安装gitlab前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

简单安装

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最小化安装

IP:192.168.1.113

gitlab 5.2.0
centos64
Redis 2.6.13
nginx-1.4.1
mysql-

git version 2.1.3


@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版本可能会低一些,需要升级到最新版本才可以.

1. Packages / Dependencies
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@
[root@gitlab~]@H_403_62@ #tar zxfgit-2.1.3.tar.gz@H_403_62@
[root@gitlab~]@H_403_62@ #cdgit-2.1.3@H_403_62@
[root@gitlabgit-2.1.3]@H_403_62@ #./configure@H_403_62@
[root@gitlabgit-2.1.3]@H_403_62@ #make&&makeprefix=/usr/localinstall@H_403_62@
[root@gitlabgit-2.1.3]@H_403_62@ #ln-s/usr/local/bin/git/usr/bin/@H_403_62@
[root@gitlabgit-2.1.3]@H_403_62@ #git--version@H_403_62@
gitversion2.1.3@H_403_62@

五、安装ruby环境

删除系统自带的ruby环境,确保ruby是2.0以上的版本

[root@gitlab~]@H_403_62@ #yumremoveruby-y@H_403_62@

#下载ruby安装包,最少2.0以上@H_403_62@
[root@gitlab~]@H_403_62@ #wgetftp://ftp.ruby-lang.org/pub/ruby/ruby-2.1.2.tar.gz@H_403_62@
[root@gitlab~]@H_403_62@ #tar zxvfruby-2.1.2.tar.gz@H_403_62@
[root@gitlab~]@H_403_62@ #cdruby-2.1.2@H_403_62@
[root@gitlabruby-2.1.2]@H_403_62@ #./configure--prefix=/usr/local/@H_403_62@
[root@gitlabruby-2.1.2]@H_403_62@ #make&&makeinstall


安装bundler

@H_403_62@
[root@gitlabruby-2.1.2]@H_403_62@ #geminstallbundler--no-doc

六、创建git用户@H_403_62@


[root@gitlab~]@H_403_62@ #adduser--system--shell/bin/bash--comment'GitLab'--create-home--home-dir/home/git/git@H_403_62@


七、安装MysqL

http://blog.csdn.net/ssdfsfdf/article/details/44425785



查看MysqL安装结果

@H_704_301@
1
2
[root@gitlab~]@H_403_62@ #MysqL--version@H_403_62@
MysqLVer14.14Distrib5.5.37,@H_403_62@ for@H_403_62@ Linux(x86_64)usingEditLinewrapper@H_403_62@

创建数据库并授权

@H_704_301@
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
[root@gitlab~]@H_403_62@ #MysqL-uroot-p-h127.0.0.1@H_403_62@
Enterpassword:@H_403_62@ #这里的密码是我的安装脚本中提供的密码@H_403_62@
WelcometotheMysqLmonitor.Commandsendwith;or\g.@H_403_62@
YourMysqLconnection@H_403_62@ id@H_403_62@ is6@H_403_62@
Serverversion:5.5.37Sourcedistribution@H_403_62@
Copyright(c)2000,2014,Oracleand@H_403_62@ /or@H_403_62@ itsaffiliates.Allrightsreserved.@H_403_62@
OracleisaregisteredtrademarkofOracleCorporationand@H_403_62@ /or@H_403_62@ its@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@
MysqL>flushprivileges;@H_403_62@
QueryOK,0rowsaffected(0.01sec)@H_403_62@
MysqL>@H_403_62@ select@H_403_62@ user,host,passwordfromMysqL.user;@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@
3rows@H_403_62@ in@H_403_62@ set@H_403_62@ (0.00sec)@H_403_62@


测试新建的用户能否登陆MysqL


[root@gitlab~]@H_403_62@ #MysqL-ugit-p-hlocalhost@H_403_62@
Enterpassword:@H_403_62@ #这里的密码是上文中给定的gitpasswd@H_403_62@
WelcometotheMysqLmonitor.Commandsendwith;or\g.@H_403_62@
YourMysqLconnection@H_403_62@ id@H_403_62@ is8@H_403_62@
Serverversion:5.5.37Sourcedistribution@H_403_62@
Copyright(c)2000,Oracleand@H_403_62@ /or@H_403_62@ itsaffiliates.Allrightsreserved.@H_403_62@
OracleisaregisteredtrademarkofOracleCorporationand@H_403_62@ /or@H_403_62@ its@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>showdatabases;@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@ test@H_403_62@ |@H_403_62@
+---------------------+@H_403_62@
3rows@H_403_62@ in@H_403_62@ set@H_403_62@ (0.00sec)@H_403_62@

安装redis 及 配置redis

安装redis



[root@gitlab~]@H_403_62@ #chkconfigredison@H_403_62@
[root@gitlab~]@H_403_62@ #/etc/init.d/redisstart@H_403_62@
Startingredis-server:[OK]@H_403_62@
[root@gitlab~]@H_403_62@ #netstat-anpt|grepredis@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@
Cloninginto@H_403_62@ 'gitlab'@H_403_62@ ...@H_403_62@
remote:Countingobjects:127971,@H_403_62@ done@H_403_62@ .@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@
Resolvingdeltas:100%(97845@H_403_62@ /97845@H_403_62@ ),@H_403_62@ done@H_403_62@ .@H_403_62@
Checkingconnectivity...@H_403_62@ done@H_403_62@ .@H_403_62@

@H_403_62@
[root@gitlabgit]@H_403_62@ #cdgitlab/@H_403_62@

[root@gitlabgitlab]@H_403_62@ #sudo-ugit-Hcpconfig/gitlab.yml.exampleconfig/gitlab.yml

@H_403_62@
#下面这条命令可以不用操作,保持默认即可@H_403_62@
[root@gitlabgitlab]@H_403_62@ #sudo-ugit-Hvimconfig/gitlab.yml@H_403_62@
gitlab:@H_403_62@
@H_403_62@ ##Webserversettings(note:hostistheFQDN,donotincludehttp://)@H_403_62@
@H_403_62@ host:www.gitlab.com@H_403_62@ #这里设置的域名是为后面的postfix使用的,在后文中的gitlab.conf站点配置文件中也是使用的这个域名,普通用户访问gitlab使用这个域名@H_403_62@
@H_403_62@ port:80@H_403_62@
@H_403_62@ https:@H_403_62@ false@H_403_62@
#修改相应的目录权限@H_403_62@
[root@gitlabgitlab]@H_403_62@ #chown-Rgitlog/@H_403_62@
[root@gitlabgitlab]@H_403_62@ #chown-Rgittmp/@H_403_62@
[root@gitlabgitlab]@H_403_62@ #chmod-Ru+rwXlog/@H_403_62@
[root@gitlabgitlab]@H_403_62@ #chmod-Ru+rwXtmp/@H_403_62@
[root@gitlabgitlab]@H_403_62@ #chmod-Ru+rwXtmp/pids/@H_403_62@
[root@gitlabgitlab]@H_403_62@ #chmod-Ru+rwXtmp/sockets/@H_403_62@
[root@gitlabgitlab]@H_403_62@ #chmod-Ru+rwXpublic/uploads@H_403_62@


#创建目录@H_403_62@
[root@gitlabgitlab]@H_403_62@ #sudo-ugit-Hmkdir/home/git/gitlab-satellites@H_403_62@
[root@gitlabgitlab]@H_403_62@ #chmodu+rwx,g=rx,o-rwx/home/git/gitlab-satellites@H_403_62@
编辑配置文件unicorn.rb@H_403_62@
[root@gitlabgitlab]@H_403_62@ #sudo-ugit-Hcpconfig/unicorn.rb.exampleconfig/unicorn.rb@H_403_62@
[root@gitlabgitlab]@H_403_62@ #nproc@H_403_62@
1@H_403_62@
[root@gitlabgitlab]@H_403_62@ #sudo-ugit-Hvimconfig/unicorn.rb@H_403_62@
worker_processes1@H_403_62@
#复制配置文件rack_attack.rb@H_403_62@
[root@gitlabgitlab]@H_403_62@ #sudo-ugit-Hcpconfig/initializers/rack_attack.rb.exampleconfig/initializers/rack_attack.rb@H_403_62@
#定义全局的用户和邮箱@H_403_62@
[root@gitlabgitlab]@H_403_62@ #sudo-ugit-Hgitconfig--globaluser.name"GitLab"@H_403_62@
[root@gitlabgitlab]@H_403_62@ #sudo-ugit-Hgitconfig--globaluser.email"gitlab@weyee.com"@H_403_62@
[root@gitlabgitlab]@H_403_62@ #sudo-ugit-Hgitconfig--globalcore.autocrlfinput@H_403_62@
#编辑连接redis的配置@H_403_62@
[root@gitlabgitlab]@H_403_62@ #sudo-ugit-Hcpconfig/resque.yml.exampleconfig/resque.yml@H_403_62@
[root@gitlabgitlab]@H_403_62@ #sudo-ugit-Hvimconfig/resque.yml@H_403_62@
development:redis:@H_403_62@ //localhost@H_403_62@ :6379@H_403_62@
test@H_403_62@ :redis:@H_403_62@ //localhost@H_403_62@ :6379@H_403_62@
production:unix:@H_403_62@ /var/run/redis/redis@H_403_62@ .sock@H_403_62@

十、编辑gitlab数据库文件
@H_403_62@

@H_403_62@

[root@gitlabgitlab]@H_403_62@ #sudo-ugitcpconfig/database.yml.MysqLconfig/database.yml@H_403_62@
[root@gitlabgitlab]@H_403_62@ #sudo-ugit-Hvimconfig/database.yml@H_403_62@
production:@H_403_62@
@H_403_62@ adapter:MysqL2@H_403_62@
@H_403_62@ encoding:utf8@H_403_62@
@H_403_62@ collation:utf8_general_ci@H_403_62@
@H_403_62@ reconnect:@H_403_62@ false@H_403_62@
@H_403_62@ database:gitlabhq_production@H_403_62@
@H_403_62@ pool:10@H_403_62@
@H_403_62@ username:git@H_403_62@
@H_403_62@ password:@H_403_62@ "gitpasswd"@H_403_62@
@H_403_62@
#修改数据库文件权限@H_403_62@
[root@gitlabgitlab]@H_403_62@ #sudo-ugit-Hchmodo-rwxconfig/database.yml

十一、安装gem

@H_403_62@
#添加淘宝的ruby源@H_403_62@
[root@gitlabgitlab]@H_403_62@ #sudo-ugitvimGemfile@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@ #cd/home/git/gitlab@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@ #ln-s/usr/local/bin/ruby/usr/bin/ruby@H_403_62@
[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@
Cloninginto@H_403_62@ '/home/git/gitlab-shell'@H_403_62@ ...@H_403_62@
remote:Countingobjects:2118,@H_403_62@ done@H_403_62@ .@H_403_62@
remote:Compressingobjects:100%(1639@H_403_62@ /1639@H_403_62@ ),@H_403_62@ done@H_403_62@ .@H_403_62@
remote:Total2118(delta1301),reused710(delta400)@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@
Resolvingdeltas:100%(1301@H_403_62@ /1301@H_403_62@ ),@H_403_62@ done@H_403_62@ .@H_403_62@
Checkingconnectivity...@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@
bin@H_403_62@ /install@H_403_62@
mkdir@H_403_62@ -p@H_403_62@ /home/git/repositories/@H_403_62@ :OK@H_403_62@
mkdir@H_403_62@ -p@H_403_62@ /home/git/@H_403_62@ .@H_403_62@ ssh@H_403_62@ :OK@H_403_62@
chmod@H_403_62@ 700@H_403_62@ /home/git/@H_403_62@ .@H_403_62@ ssh@H_403_62@ :OK@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@
chmod@H_403_62@ -Rug+rwX,o-rwx@H_403_62@ /home/git/repositories/@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@
#gitlab-shell配置文件内容@H_403_62@
[root@gitlabgitlab]@H_403_62@ #sudo-ugit-Hvim/home/git/gitlab-shell/config.yml@H_403_62@
---@H_403_62@
user:git@H_403_62@
gitlab_url:https:@H_403_62@ //localhost/@H_403_62@ #使用https@H_403_62@
http_settings:@H_403_62@
@H_403_62@ self_signed_cert:@H_403_62@ true@H_403_62@ #修改成true@H_403_62@
repos_path:@H_403_62@ "/home/git/repositories/"@H_403_62@
auth_file:@H_403_62@ "/home/git/.ssh/authorized_keys"@H_403_62@
redis:@H_403_62@
@H_403_62@ bin:@H_403_62@ "/usr/bin/redis-cli"@H_403_62@
@H_403_62@ namespace:resque:gitlab@H_403_62@
@H_403_62@ socket:@H_403_62@ "/var/run/redis/redis.sock"@H_403_62@
log_level:INFO@H_403_62@
audit_usernames:@H_403_62@ false@H_403_62@

十三、初始化数据库

[root@gitlabgitlab]@H_403_62@ #sudo-ugit-Hbundleexecrakegitlab:setupRAILS_ENV=production@H_403_62@
Thiswillcreatethenecessarydatabasetablesandseedthedatabase.@H_403_62@
YouwillloseanyprevIoUsdatastored@H_403_62@ in@H_403_62@ thedatabase.@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@
[root@gitlabgitlab]@H_403_62@ #chmod+x/etc/init.d/gitlab@H_403_62@
[root@gitlabgitlab]@H_403_62@ #chkconfig--addgitlab@H_403_62@
[root@gitlabgitlab]@H_403_62@ #chkconfiggitlabon@H_403_62@
#配置logrotate@H_403_62@
[root@gitlabgitlab]@H_403_62@ #cplib/support/logrotate/gitlab/etc/logrotate.d/gitlab@H_403_62@
#检测gitlab的应用支持状态,并配置@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@
Directory: @H_403_62@ /home/git/gitlab@H_403_62@
DBAdapter: MysqL2@H_403_62@
URL: http:@H_403_62@ //localhost@H_403_62@
HTTPCloneURL: http:@H_403_62@ //localhost/some-project@H_403_62@ .git@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@
Repositories: @H_403_62@ /home/git/repositories/@H_403_62@
Hooks: @H_403_62@ /home/git/gitlab-shell/hooks/@H_403_62@
Git: @H_403_62@ /usr/bin/git@H_403_62@
[root@gitlabgitlab]@H_403_62@ #sudo-ugit-Hbundleexecrakeassets:precompileRAILS_ENV=production@H_403_62@
#启动gitlab服务@H_403_62@
[root@gitlabgitlab]@H_403_62@ #servicegitlabstart@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组
[root@gitlabgitlab]@H_403_62@ #usermod-a-GgitNginx@H_403_62@
[root@gitlabgitlab]@H_403_62@ #chmodg+rx/home/git/@H_403_62@
[root@gitlabgitlab]@H_403_62@ #vim/etc/Nginx/conf.d/gitlab.conf@H_403_62@
#编辑文件/etc/Nginx/conf.d/gitlab.conf,修改其中的serve_rname@H_403_62@
server_name www.gitlab.com@H_403_62@


配置SSL证书
[root@gitlabgitlab]@H_403_62@ #mkdir-p/etc/Nginx/ssl@H_403_62@
[root@gitlabgitlab]@H_403_62@ #cd/etc/Nginx/ssl/@H_403_62@
[root@gitlabgitlab]@H_403_62@ #opensslreq-new-x509-nodes-days3560-outgitlab.crt-keyoutgitlab.key

启动Nginx服务
@H_403_62@
[root@gitlabgitlab]@H_403_62@ #serviceNginxstart@H_403_62@

十六、Gitlab配置SMTP邮件
cd@H_403_62@ /home/git/gitlab@H_403_62@
[root@gitgitlab]@H_403_62@ #sudo-ugit-Hcpconfig/initializers/smtp_settings.rb.sampleconfig/initializers/smtp_setting.rb@H_403_62@
#修改如下@H_403_62@
[root@gitgitlab]@H_403_62@ #sudo-ugit-Hvimconfig/initializers/smtp_settings.rb@H_403_62@
if@H_403_62@ Rails.@H_403_62@ env@H_403_62@ .production?@H_403_62@
@H_403_62@ Rails.application.config.action_mailer.delivery_method=:smtp@H_403_62@
@H_403_62@ ActionMailer::Base.delivery_method=:smtp@H_403_62@ #使用smtp方法@H_403_62@
@H_403_62@ ActionMailer::Base.smtp_settings={@H_403_62@
@H_403_62@ address:@H_403_62@ "smtp.163.com"@H_403_62@ ,@H_403_62@
@H_403_62@ port:25,@H_403_62@
@H_403_62@ user_name:@H_403_62@ "xxx"@H_403_62@ ,@H_403_62@ #用户名@H_403_62@
@H_403_62@ password:@H_403_62@ "xxxx"@H_403_62@ ,@H_403_62@ #密码@H_403_62@
@H_403_62@ domain:@H_403_62@ "163.com"@H_403_62@ ,@H_403_62@
@H_403_62@ authentication::login,@H_403_62@
@H_403_62@ enable_starttls_auto:@H_403_62@ true@H_403_62@ ,@H_403_62@
@H_403_62@ #openssl_verify_mode:'peer'#SeeActionMailerdocumentationforotherpossibleoptions@H_403_62@
@H_403_62@ }@H_403_62@
end@H_403_62@
#编辑文件@H_403_62@
[root@gitgitlab]@H_403_62@ #sudo-ugit-Hvimconfig/environments/production.rb@H_403_62@
config.action_mailer.delivery_method=:smtp@H_403_62@ #将方法修改成smtp方式@H_403_62@
原文链接:https://www.f2er.com/centos/376543.html

猜你在找的CentOS相关文章