1. 背景
因某种原因需要重新搭建GitLab服务,因此整理gitLab搭建步骤。
2. 步骤
2.1 按照依赖
yum install -y curl policycoreutils-python openssh-server
2.2 下载软件包
wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-10.2.2-ce.0.el7.x86_64.rpm
2.3 安装
rpm -ivh gitlab-ce-10.2.2-ce.0.el7.x86_64.rpm
2.4 编辑配置文件
vim /etc/gitlab/gitlab.rb
2.5 更改为自己的IP-内网(建议)/外网
# 配置访问地址
external_url 'http://192.xxx.x.xx' #改为自己的IP地址
# 安全防护-更改默认端口由80改为82
01.配置文件(请先备份):/etc/gitlab/gitlab.rb
## Advanced settings ##
unicorn['listen'] = '127.0.0.1'
unicorn['port'] = 8082
## Gitlab Nginx ##
nginx['listen_addresses'] = ['*']
nginx['listen_port'] = 82
02.配置文件(请先备份):/var/opt/gitlab/gitlab-rails/etc/unicorn.rb
listen "127.0.0.1:8082", :tcp_nopush => true
03.配置文件(请先备份):/var/opt/gitlab/nginx/conf/gitlab-http.conf
server {
listen *:82;
......
}
2.6 重载配置文件
#重新加载配置文件
gitlab-ctl reconfigure
2.7 浏览器检测访问是否正常