1、Centos上使用源码安装gitlab,问题太多。建议使用rpm包安装
系统:centos 6.5 x86_64 gitlab版本:7.13.5
下载gitlab 下载地址:https://packages.gitlab.com/gitlab/gitlab-ce 最好用工具下载,官方安装文档是linux下直接下载,速度很慢
# yum install curl openssh-server postfix cronie
# service postfix start
# chkconfig postfix on
# modprobe bridge 不清楚什么原因,不执行这个,执行gitlab-ctl reconfigure 会出现下面错误
error: "net.bridge.bridge-nf-call-ip6tables" is an unknown key
error: "net.bridge.bridge-nf-call-iptables" is an unknown key
error: "net.bridge.bridge-nf-call-arptables" is an unknown key
# lsmod |grep bridge
# service iptables stop 我这里停掉了iptables
# chkconfig iptables off
2、安装gitlab
# cd /usr/local/src/
# yum -y localinstall gitlab-ce-7.13.5-ce.0.el6.x86_64.rpm
# cp /etc/gitlab/gitlab.rb /etc/gitlab/gitlab.rb.bak 这个是配置文件,如果要修改相关设置,修改这里的内容,然后运行 gitlab-ctl reconfigure 才会生效
# vim /etc/gitlab/gitlab.rb
external_url 'http://192.168.1.221'
gitlab_rails['gitlab_email_enabled'] = true
gitlab_rails['gitlab_email_from'] = 'gitlab@gitlab.com' 邮箱地址自己设置,如果不设置,发送邮件地址显示为@ip
gitlab_rails['gitlab_email_display_name'] = 'GitLab'
3、初始配置
# gitlab-ctl reconfigure
4、用浏览器登录
用户名:root
密码:5iveL!fe
登录会重新设置密码
5、一些帮助
进程说明: unicorn 作为内部的 app server Sidekiq 高效的消息队列系统
gitlab-rake gitlab:check SANITIZE=true 检查配置是否正确
gitlab-rake gitlab:env:info 查看软件安装信息
gitlab-ctl tail 查看日志
默认安装位置 /opt/gitlab
一些配置文件 /var/opt/gitlab
禁止用户自己注册:root登录,右上角 Admin area ---------Settings-------Sign-in Restrictions,把Sign-up enabled的勾去掉保存
备份恢复:http://segmentfault.com/a/1190000002439923
TortoiseGit客户端使用: http://segmentfault.com/a/1190000002877617
官方安装帮助 https://about.gitlab.com/downloads/
官方配置说明 https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md