GitLab和ISPConfig 3问题

时间:2016-09-21 16:40:53

标签: apache gitlab ispconfig

我在运行Debian 8和Apache的VPS上有一个使用ISPConfig 3管理的网站。 该网站可以通过domain.ee访问,但我想在git.domain.ee上运行我的GitLab(同时)

但是当我安装GitLab并运行它时,他淹没了ISPConfig并开始运行git.domain.ee和domain.ee(以及所有其他地址指向我的VPS)

这是我的gitlab.rb配置:

external_url 'http://git.domain.ee'
unicorn['port'] = 8080
web_server['external_users'] = ['www-data']

这是我用apache运行的gitlab.conf:

<VirtualHost *:80>
    ServerName git.domain.ee
    ServerSignature Off
    ProxyPreserveHost On

    <Location />
        Order deny,allow
        Allow from all

        ProxyPassReverse http://127.0.0.1:8080
        ProxyPassReverse http://git.domain.ee/
    </Location>

    RewriteEngine on
    RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
    RewriteRule .* http://127.0.0.1:8080%{REQUEST_URI} [P,QSA]

    DocumentRoot /opt/gitlab/embedded/service/gitlab-rails/public

</VirtualHost>

显然domain.ee被我的真实域名取代。

1 个答案:

答案 0 :(得分:0)

让git在localhost:8080上运行,并将apache配置为反向代理  像这样:

<VirtualHost *:80>
  ProxyPreserveHost On
  ProxyRequests Off
  ProxyVia Off

  <Proxy *>
     Require all granted
  </Proxy>

  ProxyPass / http://127.0.0.1:8080
  ProxyPassReverse / http://127.0.0.1:8080
</VirtualHost>

您可以根据需要添加其他规则