1、服务器要求,8G内存以上,4核心cpu以上
2、 新建 /etc/yum.repos.d/gitlab_gitlab-ce.repo ,内容:
[gitlab-ce]
name=Gitlab CE Repository
baseurl=https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el$releasever/
gpgcheck=0
enabled=1
3、安装依赖
sudo yum install curl openssh-server openssh-clients postfix cronie
sudo service postfix start
sudo chkconfig postfix on
#这句是用来做防火墙的,避免用户通过ssh方式和http来访问。
sudo lokkit -s http -s ssh
4、再安装
sudo yum makecache
sudo yum install gitlab-ce
sudo gitlab-ctl reconfigure #Configure and start GitLab
5、配置域名: vim /var/opt/gitlab/nginx/conf/gitlab-http.conf
# 外网访问的端口,如果服务器已经有服务器占用了80,那么这里可以改成其它
listen *:8888;
server_name gitlab.test.domain.com;
set $http_host_with_default "gitlab.test.domain.com:8888";
补充说明:因为编译gitlab的配置 /etc/gitlab/gitlab.rb 时会重新生成这个自定义nginx 配置,所以只要 gitlab 的配置配得好,上面的nginx其实不需要自定义的。
配置clone地址git@git.example.com:
这里我们需要改成我们自己的域名:
1)打开配置文件:
vi /opt/gitlab/embedded/service/gitlab-rails/config/gitlab.yml
2)修改host为自己的域名:
gitlab:
## Web server settings (note: host is the FQDN, do no