gitlab的一键安装以及https配置

简明安装攻略

https://segmentfault.com/a/1190000002722631

国内清华源

https://mirror.tuna.tsinghua.edu.cn/help/gitlab-ce/

中文半官方说明

https://www.gitlab.cc/downloads/#centos6

官方说明

https://about.gitlab.com/downloads/#centos6

 

按照官方说明,基本上一键安装,但是国内服务器上不了amazon的s3

只能换成清华的源,261M的安装包

 

装好后 

修改下面这个文件的external_url,如果需要改端口,直接在url后跟上端口号就可以

 

/etc/gitlab/gitlab.rb

 

 

 然后运行一下命令就自动配置

gitlab-ctl reconfigure

 

然后打开网站就可以了

默认root用户,默认密码

5iveL!fe

修改后进入。

 

 

添加https支持

 

制作key和crt http://nassir.iteye.com/blog/1983613

具体流程与这个url有出入http://www.2cto.com/net/201605/511846.html

 

在/etc/gitlab下新建ssl文件夹,把key和crt放入

然后修改/etc/gitlab/gitlab.rb,

然后修改4项

 

external_url"https://www.abc.com"
nginx['redirect_http_to_https']=true
nginx['ssl_certificate']="/etc/gitlab/ssl/luck.crt"
nginx['ssl_certificate_key']="/etc/gitlab/ssl/luck.key"

 

 

然后运行

gitlab-ctl reconfigure

 

与参照的url流程有出入,在完成以上流程后

/var/opt/gitlab/nginx/conf/gitlab-http.conf

这个文件里就会增加443的设置,然后直接打开就可以了

 

20161101补足

 

忘了说了

git在本地的设置

如果因为ssl不是经过认证的证书

要修改这个文件

 

C:\Users\xxxxx\.gitconfig

 

 

然后添加

[http] sslVerify = false

 

 

而且,有一个比较怪的问题,第一次是自动设置,第二次不能自动了,比对了一下才找到

就是如何设置用户名和密码

手动添加

[credential]

helper = !\"D:\\Program Files (x86)\\GitExtensions\\GitCredentialWinStore\\git-credential-winstore.exe\"

 

 

猜你喜欢

转载自fighter1945.iteye.com/blog/2302505