Centos7本地安装gitlab
1.下载好 gitlab 的rpm 包,我下载的是gitlab-ce-11.6.0-ce.0.el7.x86_64.rpm
https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/
2.安装 gitlab 的依赖包
yum install curl openssh-server openssh-clients postfix cronie policycoreutils-python –y
yuminstall -y patch
3.启动 postfix,并且设置为开机启动
systemctl start postfix
systemctl enable postfix
4.设置防火墙
firewall-cmd --add-service=http --permanent
firewall-cmd --reload
5.安装刚下载好 gitlab 的rpm 包
rpm -ivh gitlab-ce-11.6.0-ce.0.el7.x86_64.rpm
6.继续安装提示执行配置 gitlab 的命令
gitlab-ctl reconfigure
7.修改 gitlab 的配置文件
vim /etc/gitlab/gitlab.rb
修改下面配置
external_url 'http://10.14.32.252:8070'
因为修改了配置文件,所以重新加载配置文件
gitlab-ctl reconfigure
如果访问页面访问报错502,请检查如下问题
a)权限问题:Gitlab文件需要给予读写的权限
chmod -R 755 /var/log/gitlab
b)端口问题:Gitlab的默认启动端口是80,8080,所以有肯能会与其他的端口产生冲突,需要修改端口号
c)内存不足的问题:安装gitlab的时候,已经说明你的空余内存需要有4G左右的内存,所以在安装gitlab的时候,请给足内存,在安装。
修改访问端口号:
更改端口
vim /etc/gitlab/gitlab.rb
修改配置
external_url 'http://10.14.32.252:8070' nginx['listen_port'] = 8070 nginx['listen_https'] = false unicorn['port'] = 8001
改nginx端口
vim /var/opt/gitlab/nginx/conf/gitlab-http.conf
server { listen *:8070; server_name 47.92.82.152 if ($http_host = "") { set $http_host_with_default "47.92.82.152:8070"; } }

3)修改完成后执行
gitlab-ctl reconfigure #重新加载配置
gitlab-ctl restart #重启
打开浏览器,输入"http://10.14.32.252:8070/",进入登录页面
完成!
浙公网安备 33010602011771号