根据此说明下载并配置 GitLab https://about.gitlab.com/downloads/#centos6
/etc/gitlab/gitlab.rb
进行了以下更改:
#external_url 'http://gitlab.example.com'
external_url 'http://123.456.789.012'
但是当你去这个地址的时候,并没有显示主页面,而是出现了来自nginx的欢迎页面(奇怪的是只说了Debian,而是CentOS系统本身):
欢迎使用 Debian 上的 nginx!
如果您看到此页面,则 nginx Web 服务器已成功安装并可在 Debian 上运行。需要进一步配置。
# gitlab-ctl status
run: gitlab-workhorse: (pid 18016) 4466s; run: log: (pid 16399) 5362s
run: logrotate: (pid 21962) 866s; run: log: (pid 16466) 5356s
run: nginx: (pid 18030) 4465s; run: log: (pid 16398) 5362s
run: postgresql: (pid 18038) 4465s; run: log: (pid 16171) 5410s
run: redis: (pid 18040) 4464s; run: log: (pid 16092) 5416s
run: sidekiq: (pid 18052) 4463s; run: log: (pid 16349) 5368s
run: unicorn: (pid 18069) 4462s; run: log: (pid 16304) 5374s
没有系统nginx,在/etc/nginx
. 客户端通过 Internet 连接到服务器,而不是通过 VirtualBox 等。
如何正确设置gitlab的外部地址?
更新
当尝试从外部网络的客户端连接时,将端口添加到 external_url 后:
$ lynx http://88.88.88.88:9009/
Looking up 88.88.88.88:9009
Making HTTP connection to 88.88.88.88:9009
Alert!: Unable to connect to remote host.
尝试从服务器连接到自身时:
$ lynx 127.0.0.1:9009
Looking up 127.0.0.1 first
Looking up 127.0.0.1:9009
Making HTTP connection to 127.0.0.1:9009
Sending HTTP request.
HTTP request sent; waiting for response.
HTTP/1.1 302 Found
Allowing this cookie.
Data transfer complete
HTTP/1.1 302 Found
Using http://88.88.88.88:9009/users/sign_in
Looking up 88.88.88.88:9009
Making HTTP connection to 88.88.88.88:9009
Alert!: Unable to connect to remote host.
lynx: Can't access startfile http://127.0.0.1:9009/
尝试将端口更改为
external_url 'http://123.456.789.012:9009'
,不要忘记运行gitlab-ctl reconfigure
问题是另一个nginx在80端口上运行,去网站的时候就显示出来了。可能的解决方案:
external_url 'http://123.456.789.012'
为指示不同端口的变体external_url 'http://123.456.789.012:8888'
。