GitLab搭建502问题总结
GitLab搭建502问题总结
参考至:https://blog.csdn.net/jacka654321/article/details/80629824
因8080端口被占用,导致unicorn服务无法启动,从而出现502错误,要更改unicorn端口
vim打开gitlab.rb
vim /etc/gitlab/gitlab.rb
命令状态输入/unicorn[‘port’],按Enter进入查找状态,按n往下查找,直到看到unicorn[‘port’] =8080,修改端口,删除#号,解除注释状态,将该端口修改为未占用端口
unicorn['port'] = 9090
借原文图:
然后用gitlab-ctl reconfigure 重启配置,sudo gitlab-ctl stop停掉服务,gitlab-ctl start直接启动服务即可访问。
官方建议
sudo gitlab-ctl restart sidekiq
sudo gitlab-ctl hup unicorn
#############################################################################
GitLab修改默认端口
打开配置目录,用vim修改:
cd /var/opt/gitlab/nginx/conf
vim gitlab-http.conf
#本例把80端口修改为8040
server {
listen *:8084; --修改端口
server_name localhost;
补充
当liunx系统中有两个一样的gitlab-workhorse的进程的解决办法
有两个gitlab-workhorse的进程且含有8080端口,不就是我们开始改之前unicorn使用的端口嘛。先停到gitlab服务,kill掉gitlab-workhorse的进程
我们再检查下gitlab的配置文件(/etc/gitlab/gitlab.rb ),找到8080端口有关的配置,并将8080端口修改为unicorn相同的端口
将
gitlab_workhorse['auth_backend'] = "http://localhost:8080"
修改为
gitlab_workhorse['auth_backend'] = "http://localhost:9090"
然后用gitlab-ctl reconfigure 重启配置,sudo gitlab-ctl stop停掉服务,gitlab-ctl start直接启动服务即可访问。
在此特别感谢jacka654321,weinichendian两位提供的文档