【问题标题】:gitlab with apache connection refused带有apache连接的gitlab被拒绝
【发布时间】:2017-04-18 15:07:41
【问题描述】:

我无法让 gitlab 在我的服务器上运行。
环境是:
Ubuntu 16.04.1 LTS
阿帕奇 2.4

我通过综合脚本安装了 gitlab,编辑了 gitlab.rb 以使其与 apache 一起工作,制作了一个专用的虚拟主机,在 SSL 证书方面有点挣扎,让它工作,但我遇到了一个错误,我无法解决。

当我转到https://gitlab.mydomain.com/users/sign_in 时,我有一个不错的 503。 错误日志说:

[Tue Apr 18 16:58:56.556702 2017] [proxy:error] [pid 31966] (111)Connection refused: AH00957: HTTPS: attempt to connect to 127.0.0.1:8181 (*) failed
[Tue Apr 18 16:58:56.556722 2017] [proxy_http:error] [pid 31966] [client 93.182.244.38:60339] AH01114: HTTP: failed to make connection to backend: 127.0.0.1, referer: https://gitlab.mydomain.com/users/sign_in

这是使用的虚拟主机:

<VirtualHost *:443>
  ServerName gitlab.mydomain.com
  ServerSignature Off
  SSLEngine on
  SSLCertificateFile /etc/letsencrypt/live/mydomain.com/fullchain.pem
  SSLCertificateKeyFile /etc/letsencrypt/live/mydomain.com/privkey.pem

  ProxyPreserveHost On

  # Ensure that encoded slashes are not decoded but left in their encoded state.
  # http://doc.gitlab.com/ce/api/projects.html#get-single-project
  AllowEncodedSlashes NoDecode

  <Location />
    # New authorization commands for apache 2.4 and up
    # http://httpd.apache.org/docs/2.4/upgrading.html#access
    Require all granted

    #Allow forwarding to gitlab-workhorse
    ProxyPassReverse https://127.0.0.1:8181
    ProxyPassReverse https://gitlab.mydomain.com/
  </Location>

  # Apache equivalent of nginx try files
  # http://serverfault.com/questions/290784/what-is-apaches-equivalent-of-nginxs-try-files
  # http://stackoverflow.com/questions/10954516/apache2-proxypass-for-rails-app-gitlab
  RewriteEngine on

  #Forward all requests to gitlab-workhorse
  RewriteRule .* https://127.0.0.1:8181%{REQUEST_URI} [P,QSA]

  # needed for downloading attachments
  DocumentRoot /opt/gitlab/embedded/service/gitlab-rails/public

  #Set up apache error documents, if back end goes down (i.e. 503 error) then a maintenance/deploy page is thrown up.
  ErrorDocument 404 /404.html
  ErrorDocument 422 /422.html
  ErrorDocument 500 /500.html
  ErrorDocument 503 /deploy.html

  # It is assumed that the log directory is in /var/log/httpd.
  # For Debian distributions you might want to change this to
  # /var/log/apache2.
  LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b" common_forwarded
  ErrorLog ${APACHE_LOG_DIR}/gitlab_error.log
  CustomLog ${APACHE_LOG_DIR}/gitlab_forwarded.log common_forwarded
  CustomLog ${APACHE_LOG_DIR}/gitlab_access.log combined env=!dontlog
  CustomLog ${APACHE_LOG_DIR}/gitlab.log combined
</VirtualHost>

我做错了什么?

感谢您的帮助。

【问题讨论】:

    标签: ssl gitlab


    【解决方案1】:

    gitlab-workhorsedoesn't support SSL connections

    Workhorse 可以在完全不涉及 Rails 的情况下处理一些请求: 例如,直接提供 Javascript 文件和 CSS 文件 从磁盘。

    Workhorse 可以修改 Rails 发送的响应:例如,如果您使用 在 Rails 中发送文件,然后 gitlab-workhorse 将打开文件 磁盘并将其内容作为响应正文发送给客户端。

    在获得 Rails 的许可后,Workhorse 可以接管请求。 示例:处理 git clone。

    Workhorse 可以在将请求传递给 Rails 之前对其进行修改。例子: 在处理 Git LFS 上传时,Workhorse 首先请求来自 Rails,然后它将请求正文存储在临时文件中,然后发送 包含 Rails 的临时文件路径的修改请求。

    Workhorse 可以管理 Rails 的长期 WebSocket 连接。 示例:处理环境的终端 websocket。

    Workhorse 不连接到 Postgres,只连接到 Rails 和(可选)Redis。

    我们假设到达 Workhorse 的所有请求都通过 首先是上游代理,例如 NGINX 或 Apache。

    Workhorse 不接受 HTTPS 连接。

    Workhorse 不会清理空闲的客户端连接。

    我们假设所有对 Rails 的请求都通过 Workhorse。

    【讨论】:

      猜你喜欢
      • 2017-09-01
      • 2018-02-11
      • 2011-08-07
      • 2020-10-01
      • 2016-11-11
      • 2021-09-15
      • 1970-01-01
      • 1970-01-01
      • 2017-08-08
      相关资源
      最近更新 更多