Ruby 使用apache2(或nginx&x2B;apache2)配置gitlab

Ruby 使用apache2(或nginx&x2B;apache2)配置gitlab,ruby,apache2,gitlab,Ruby,Apache2,Gitlab,我已经在带有LAMP的Ubuntu14.04服务器中安装了GitLab。我知道GitLab设计用于基于nginx的服务器,但该服务器上安装了通过apache2安装的web应用程序,我需要它们 我试着安装GitLab。我使用了gitlab_7.7.1-omnibus.5.4.1.ci-1_amd64.deb包 最后,我遇到了与一些发表评论的人相同的问题(错误502)。我试着从评论中找出相关信息,但似乎与我的案例无关 我一直在寻找通过apache2配置nginx的替代方法,但没有找到任何东西 下面是

我已经在带有LAMP的Ubuntu14.04服务器中安装了GitLab。我知道GitLab设计用于基于nginx的服务器,但该服务器上安装了通过apache2安装的web应用程序,我需要它们

我试着安装GitLab。我使用了gitlab_7.7.1-omnibus.5.4.1.ci-1_amd64.deb包

最后,我遇到了与一些发表评论的人相同的问题(错误502)。我试着从评论中找出相关信息,但似乎与我的案例无关

我一直在寻找通过apache2配置nginx的替代方法,但没有找到任何东西

下面是我在
/var/log/gitlab/nginx/gitlab\u error.log中找到的一个日志条目:

2015/01/30 19:32:27 [error] 995#0: *3 connect() to unix:/var/opt/gitlab
/gitlab-rails/sockets/gitlab.socket failed (111: Connection refused)
while connecting to upstream, client: 127.0.0.1, server: mygitlab.com,
request: "GET / HTTP/1.1", upstream: "http://unix:/var/opt/gitlab/gitlab-
rails/sockets/gitlab.socket:/", host: "localhost:8080"
这似乎是上游套接字配置的问题

gitlab ctl状态
输出:

run: logrotate: (pid 4465) 1488s; run: log: (pid 826) 5087s
run: nginx: (pid 837) 5087s; run: log: (pid 825) 5087s
run: postgresql: (pid 827) 5087s; run: log: (pid 817) 5087s
run: redis: (pid 828) 5087s; run: log: (pid 818) 5087s
run: sidekiq: (pid 839) 5087s; run: log: (pid 824) 5087s
run: unicorn: (pid 5861) 0s; run: log: (pid 823) 5087s
无论如何,似乎Omnibus根本没有安装nginx(或者我猜是这样,在
/etc/init.d/
中没有名为“nginx”的服务。我不排除日志生成器将apache2与nginx混淆的可能性)

问题:

  • 是否必须安装nginx才能运行gitlab?如果是这样,它能与apache正确共存吗

  • 通过apache代理GitLab是实现我所寻找的目标的好方法吗

  • 我对独角兽了解不多。我发现里面有这么多。这是否意味着Unicorn在GitLab中处理上游套接字

编辑:检查我决定检查Omnibus是否使用
Ruby-v安装了Ruby,我注意到Ruby根本没有安装。因此,我决定按照文档的说明编译并安装它:

mkdir /tmp/ruby && cd /tmp/ruby
curl -L --progress http://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.5.tar.gz | tar xz
cd ruby-2.1.5
./configure --disable-install-rdoc
make
sudo make install
不管怎么说,似乎有些依赖项失败了,ruby并没有充分发挥作用。当我尝试
sudogem安装bundler--no ri--no rdoc
时,出现以下错误:

ERROR:  Loading command: install (LoadError)
    cannot load such file -- zlib
ERROR:  While executing gem ... (NoMethodError)
    undefined method `invoke_with_build_args' for nil:NilClass
make
操作期间,发生了以下错误:

Failed to configure -test-/win32/dln. It will not be installed.
Failed to configure -test-/win32/dln/empty. It will not be installed.
Failed to configure -test-/win32/fd_setsize. It will not be installed.
Failed to configure dbm. It will not be installed.
Failed to configure fiddle. It will not be installed.
Failed to configure gdbm. It will not be installed.
Failed to configure openssl. It will not be installed.
Failed to configure readline. It will not be installed.
Failed to configure tk. It will not be installed.
Failed to configure tk/tkutil. It will not be installed.
Failed to configure win32. It will not be installed.
Failed to configure win32ole. It will not be installed.
Failed to configure zlib. It will not be installed.
EDIT2:编译和安装Ruby似乎完全是必要的。在查找配置文件时,我看到Omnibus在
/opt/gitlab/embedded/
目录中安装了许多依赖项(其中包括Ruby):-

是否必须安装nginx才能运行gitlab?若然,可否共存 正确使用apache

Gitlab与nginx捆绑在一起,但您可以将其与ApacheHTTP服务器一起使用

通过apache代理GitLab是实现我所期望的目标的好方法吗 为了什么

您可以在Gitlab config中禁用nginx,并将Apache配置为转发到Gitlab

我对独角兽了解不多。我发现这个问题很难回答。做 这意味着Unicorn在GitLab中处理上游套接字

Unicorn是Ruby的HTTP服务器。您可以将请求转发到Gitlab Unicorn服务器或Gitlab workhorse

下面是Apache使用的基本
/etc/gitlab/gitlab.rb
配置,其他行已注释:

外部url“”

gitlab_workhorse['enable']=true
gitlab_主力['listen_network']=“tcp”
gitlab_workhorse['listen_addr']=“127.0.0.1:9191”

独角兽['listen']='127.0.0.1'
独角兽['port']=9099

web_服务器['external_users']=['www-data']
web_服务器['username']=“apache”#“gitlab-www”
web_服务器['group']=“apache”#“gitlab-www”

nginx['enable']=false

并在
/etc/apache2/apache2.conf
中将
proxyPass
传递给运行在9191上的gitlab workhorse:

ProxyPass/gitlab
RequestHeader添加X-Forwarded-Proto“https”
RequestHeader在上设置X-Forwarded-Ssl