我已经设法在一个Linux CentOS服务器上使用Apache,Git,PHP,PostGreSQL和MySQL 部分设置Gitlab.我正在运行Chef Cookbook版本.我从这里得到了转速.我想用它来更好地和更直观地管理我的Git repo,这似乎是一个不错的选择.但是现在我遇到了让它发挥作用的问题.
只是为了让它真正起作用并更新所有文件我决定使用重新运行配置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,发现了这个链接.我也读过:
Unicorn是Rack应用程序的HTTP服务器,旨在为低延迟,高带宽连接的快速客户端提供服务,并利用Unix/Unix类内核中的功能.慢客户端只应通过放置一个能够完全缓冲Unicorn和慢客户端之间的请求和响应的反向代理来提供服务.
当我检查文件时,/var/opt/gitlab/gitlab-rails/etc/unicorn.rb
我确实看到它使用8080.问题是,似乎Unicorn应该与NGINX一起工作,所以也许我不应该改变端口.
我应该采取什么步骤来使Gitlab工作?Gitlab可以在没有Unicorn的情况下工作吗?我想不会.我应该为它选择另一个端口,还是为NGINX选择?
您应该覆盖端口/etc/gitlab/gitlab.rb
.请勿乱用,/var/opt/gitlab/...
因为重新配置后任何手动配置都将丢失.特别请阅读设置NGINX监听端口.在下载页面中有一句话:有关故障排除和配置选项,请参阅Omnibus GitLab自述文件.我不知道人们是否看不到这种情况:/如果不是,我们应该更清楚.
添加到Axil的评论.我不得不在/var/opt/gitlab/gitlab-rails/etc/unicorn.rb文件中更改它.在那之后重新开始工作,我没有失去我的配置.即使多次重启,unicorn master也没有从/etc/gitlab/gitlab.rb文件中选择我的更改.