**
(certos7) 搭建GitLab服务器
**
在linux上有两种方式部署git服务器
1 使用名为 GitLab 的 GUI 工具
2 运行一个纯 Git 服务器
安装之前,请确保你的服务器是否安装了
ssh rpm -qa|grep -E “openssh”
防火墙 rpm -qa|grep -E “iptables”
wget rpm -qa|grep -E “wget”
1 安装 GitLab 之前,需要配置 SMTP 电子邮件服务器,以便 GitLab 可以在需要时随时推送电子邮件。官方推荐使用 Postfix。先在你的服务器上安装 Postfix
详见搭建搭建 postfix邮件传输代理
2添加GitLab镜像源,其他镜像下载地址:https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/
wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-10.0.0-ce.0.el7.x86_64.rpm
3 安装gitlab
rpm -i gitlab-ce-10.0.0-ce.0.el7.x86_64.rpm
4 修改gitlab配置文件指定服务器ip和自定义端口
vim /etc/gitlab/gitlab.rb (有时候文件找不到,可以去文件目录下找看看 external_url 开始位置 unicorn[‘port’ L34%左右)
external_url `http://192.168.1.149:8900` 服务器ip和未被占用的端口
unicorn[‘port’] = 8899 默认8080,设置未被占用端口
5 重置gitlab配置文件
gitlab-ctl reconfigure
6 重启gitlab
gitlab-ctl restart
7 访问gitlab,直接输入上面配置的ip加端口访问即可
初始账户: root 密码:5iveL!fe