在 CentOS 上部署 GitLab(通常指 Omnibus 包安装的 GitLab)时,常见端口如下:
⚠️ 如果 CentOS 本身已用 22 做 SSH 登录,GitLab 可改端口(如 2222)
external_url 'http://gitlab.example.com'
# 修改 SSH 端口
gitlab_rails['gitlab_shell_ssh_port'] = 2222
# 修改 Nginx 端口
nginx['listen_port'] = 8081
修改后执行:
gitlab-ctl reconfigure
如果你是用 Docker 版 GitLab 或 源码安装,端口会不一样,可以告诉我你用的是哪种方式。