我刚刚通过omnibus在运行Ubuntu 14.0.4 LTS的VPS上安装了GitLab CE,对/etc/gitlab/gitlab.rb进行了以下更改并重新运行了sudo gitlab-ctl reconfigure :
gitlab_workhorse['listen_network'] = "tcp" gitlab_workhorse['listen_addr'] = "127.0.0.1:8181" external_url 'https://gitlab.myserver.com/' gitlab_rails['gitlab_shell_ssh_port'] = 2222 web_server['external_users'] = ['www-data'] nginx['enable'] = false
我的Apache VirtualHostconfiguration正在工作,我可以访问https://gitlab.myserver.com/上的Web界面,在那里我添加了我的SSH密钥,但是当克隆/推送/ etc到/从ssh://[email protected]:2222/mygroup/myproject.git / / ssh://[email protected]:2222/mygroup/myproject.git我收到
ssh: connect to host gitlab.haggi.me port 2222: Connection refused fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
$ ssh -vvv -T -p 2222 gitlab.myserver.com :
OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014 debug1: Reading configuration data /home/me/.ssh/config debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 19: Applying options for * debug2: ssh_connect: needpriv 0 debug1: Connecting to gitlab.myserver.com [12.34.56.78] port 2222. debug1: connect to address 12.34.56.78 port 2222: Connection refused ssh: connect to host gitlab.myserver.com port 2222: Connection refused
$ netstat -tlpn没有列出在端口2222上侦听的任何进程
$ sudo gitlab-rake gitlab:check不会产生任何错误或警告( http://pastebin.com/ThCJ0nU7 )
端口2222 / TCP允许在ufw
您需要根据运行sshd服务器的端口来设置选项gitlab_rails['gitlab_shell_ssh_port'] = 2222 。
如果我是正确的,Gitlab不运行单独的SSH服务器。 如果你在标准端口上运行sshd ,只需交换到22 ,重新启动gitlab和sshd ,然后在标准端口上再次尝试。
如果你坚持在不同的端口上运行,你还需要修改你的VPS上的sshd_config和潜在的其他东西。