我用LAMP在Ubuntu14.04服务器上安装了GitLab。我知道GitLab被设计用来处理基于nginx的服务器,但是这个服务器有安装在apache2上的web应用程序,我需要它们。
我试着在GitLab之后安装本教程。我使用了gitlab_7.7.1-Ombus.5.4.1.ci-1_amd64.deb包。
最后,我遇到了与一些评论者相同的问题(错误502)。我试着跟踪此链接的评论,看看是否能找到任何相关的信息,但它似乎与我的情况无关。
我一直在寻找通过apache2配置nginx的替代方法,但我什么也找不到。
下面是我在/var/log/gitlab/nginx/gitlab_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 status输出:
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混淆的可能性)。
问题:
编辑:检查本文件我决定检查Omnibus是否安装了ruby -v,我注意到ruby -v根本没有安装。因此,我决定按照文档的说明编译并安装它:
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并不是非常有效的。当我尝试sudo gem install bundler --no-ri --no-rdoc时,下面的错误是ocurr:
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:,编译和安装似乎是完全必要的。环顾周围的配置文件,我发现Omnibus在/opt/gitlab/embedded/目录中安装了大量依赖项(Ruby就是其中之一)。-S
发布于 2017-01-16 09:06:02
是否必须安装nginx才能运行gitlab?如果是这样的话,它能与apache共存吗?
Gitlab与nginx捆绑在一起,但您可以在Apache服务器上使用它。
通过apache代理GitLab是否是我正在寻找的一个很好的方法?
您可以在Gitlab配置中禁用nginx,并将Apache配置为转发到Gitlab。
我对独角兽不太了解。我在里面发现了这个问题。这是否意味着Unicorn处理GitLab中的上游套接字?
Unicorn是Ruby的HTTP服务器。您可以将请求转发到Gitlab Unicorn服务器或gitlab-工作马。
下面是与Apache一起使用的基本/etc/gitlab/gitlab.rb配置,其他行注释如下:
external_url 'https://my.example.com/gitlab‘gitlab_workhorse’‘enable’= true gitlab_workhorse‘’listen_network‘= "tcp“ gitlab_workhorse‘’listen_addr‘= "127.0.0.1:9191“独角兽’听‘= '127.0.0.1’ 独角兽端口= 9099 web_server外部_user= 'www-data‘ web_server‘’username‘= 'apache’#'gitlab-www‘ web_server‘’group‘= 'apache’#'gitlab-www‘nginx’‘enable’= false
并使proxyPass在/etc/apache2/apache2.conf中运行到gitlab--运行在9191上的工作马:
ProxyPass /gitlab http://127.0.0.1:9191/gitlab RequestHeader添加X转发-Proto "https“ RequestHeader集X转发-Ssl on
https://stackoverflow.com/questions/28243357
复制相似问题