为了使它真正起作用并更新所有文件,我决定使用gitlab-ctl reconfigure重新运行配置.第二次运行确实有效:
Chef Client finished,4 resources updated gitlab Reconfigured!
主机已经把Nginx放在了8080而没有进入与在80端口运行的Apache的争论,我们在那里运行了一个LAMP项目.但现在Ruby的Unicorn Web Server似乎与Nginx相冲突.我和Nginx合作了一点点,并不多,这是我第一次尝试Gitlab.无论如何,这是我在我的主人的帮助下想出来的.
当我登录testserver.domain.net并传递以下命令时:
netstat -ln | grep 8080我明白了
tcp 0 0 127.0.0.1:8080 0.0.0.0:* LISTEN
所以有些东西在8080上运行
根据我的主机,它应该在0.0.0.0:8080运行.当我们检查那个端口上运行的是什么时,我们看到了
netstat -tupln |grep 8080 tcp 0 0 127.0.0.1:8080 0.0.0.0:* LISTEN 21627/unicorn maste
当我们检查进程ID 21627时,我们看到了
cat /proc/21627/cmdline unicorn master -E production -c /var/opt/gitlab/gitlab-rails/etc/unicorn.rb /opt/gitlab/embedded/service/gitlab-rails/config.ru
这是一个Ruby流程,而不是Nginx流程.
所以Nginx似乎与Unicorn相冲突.
当我们检查Nginx的日志时,我们发现Nginx无法正常运行,因为:
tail -f /var/log/gitlab/Nginx/error.log 2014/07/28 09:43:10 [emerg] 23122#0: bind() to 0.0.0.0:8080 Failed (98: Address already in use) 2014/07/28 09:43:10 [emerg] 23122#0: still could not bind() 2014/07/28 09:43:12 [emerg] 23123#0: bind() to 0.0.0.0:8080 Failed (98: Address already in use) 2014/07/28 09:43:12 [emerg] 23123#0: bind() to 0.0.0.0:8080 Failed (98: Address already in use) 2014/07/28 09:43:12 [emerg] 23123#0: bind() to 0.0.0.0:8080 Failed (98: Address already in use) 2014/07/28 09:43:12 [emerg] 23123#0: bind() to 0.0.0.0:8080 Failed (98: Address already in use) 2014/07/28 09:43:12 [emerg] 23123#0: bind() to 0.0.0.0:8080 Failed (98: Address already in use) 2014/07/28 09:43:12 [emerg] 23123#0: still could not bind()
我用Google搜索了Unicorn.rb并找到了这个link.我还读到了:
Unicorn is an HTTP server for Rack applications designed to only serve
fast clients on low-latency,high-bandwidth connections and take
advantage of features in Unix/Unix-like kernels. Slow clients should
only be served by placing a reverse proxy capable of fully buffering
both the the request and response in between Unicorn and slow clients.
当我检查文件/var/opt/gitlab/gitlab-rails/etc/unicorn.rb时,我确实看到它使用8080.问题是,似乎Unicorn应该与Nginx一起工作,所以也许我不应该改变端口.
我应该采取什么步骤来使Gitlab工作? Gitlab可以在没有Unicorn的情况下工作吗?我想不会.我应该为它选择另一个端口,还是为Nginx选择?