您的位置:首页 > 运维架构 > Linux

centos安装gitlab

2017-08-31 15:46 441 查看
原文地址:https://segmentfault.com/a/1190000002722631

centosx64安装使用rpm包方式安装gitlab
1.安装依赖软件
yum -y install policycoreutils openssh-server openssh-clients postfix

2.启动服务
service postfix start

3.下载yum源并安装
centos6:https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el6/
centos7:https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/
wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el6/gitlab-ce-9.2.2-ce.0.el6.x86_64.rpm
rpm -i gitlab-ce-9.2.2-ce.0.el6.x86_64.rpm

4.修改gitlab配置文件指定服务器ip和自定义端口(也可以不修改):
vim /etc/gitlab/gitlab.rb
修改external_url 'http://git.exp.com' 为external_url 'http://本机ip:端口'

5.重置并启动GitLab
gitlab-ctl reconfigure
gitlab-ctl restart

6.访问http://git.exp.com
(第一次登录修改密码)初始账户: root 密码: 5iveL!fe
1、关闭firewall:
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动

注意事项:
管理员用户:创建项目,添加成员,普通程序员:编写代码并pull,push
1.在安装gitlab的过程中,gitlab会自动创建一个git用户(若存在则删除重新创建)

2.gitlab存储的实际目录/var/opt/gitlab/git-data/repositories

3.gitlab克隆代码的地址
管理员:git@192.168.100.70:gitrep/ssp-parent.git
普通用户:http://192.168.100.70:9999/gitrep/ssp-parent.git
gitlab集成安装了nginx并监听80重定向到9999端口(/var/opt/gitlab/git-data/repositories)
gitrep在gitlab中叫做group或者命名空间,在linux中对应gitrep目录
ssp-parent是gitlab组中具体某个项目名字,在linux中对应ssp-parent.git目录


4.gitlab管理员创建的用户账号密码是用来访问gitlab网页的,唯一性全靠邮箱

5.使用root用户手动创建
cd /var/opt/gitlab/git-data/repositories
mkdir -p gitrep/ssp-parent.git
chown -hR git:git gitrep //修改目录的权限为git组git用户所有
cd gitrep/ssp-parent.git
git init --bare
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: