1

У меня установлен gitlab на порт 8088 поверх существующего apache на CentOS 6.5 и я использовал это руководство https://about.gitlab.com/downloads/#centos6

Поскольку я также использую apache на этом сервере, я изменил файл apache vhost, чтобы получить следующее

<VirtualHost *:80>
  ServerName git.server.net
  DocumentRoot /opt/gitlab/embedded/service/gitlab-rails/public

  ProxyPreserveHost On
  AllowEncodedSlashes Off

  <Location />
    Order deny,allow
    Allow from all
    ProxyPassReverse http://127.0.0.1:8088
    ProxyPassReverse http://git.server.net/
  </Location>

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

и изменил /etc/gitlab/gitlab.rb на это:

external_url 'http://git.server.net:8088'

# service httpd restart работает нормально, но когда я # gitlab-ctl reconfigure он выдает много предупреждений (но все работает) за исключением того, что отсутствует каждая таблица стилей gitlab или js include, поэтому она выглядит так:

отказ CSS

в html-источнике, если я захожу в файл css или js, он выдает следующую ошибку

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>500 Internal Server Error</title>
</head><body>
<h1>Internal Server Error</h1>
<p>The server encountered an internal error or
misconfiguration and was unable to complete
your request.</p>
<p>Please contact the server administrator,
 root@localhost and inform them of the time the error occurred,
and anything you might have done that may have
caused the error.</p>
<p>More information about this error may be available
in the server error log.</p>
<hr>
<address>Apache/2.2.15 (CentOS) Server at git.server.net Port 80</address>
</body></html>

очевидно, что nginx должен parse эти расширения файлов, а apache не предназначен для: существует ли в любом случае ссылка на эту внутреннюю относительную ссылку

EDIT Этот относительный URL переформатировать делает работу , но если я иду туда как URL Мануалы это работает: как я могу получить gitlab приобщить: 8088 относительному URL? - http://git.server.net:8088/assets/application-2684b1e4bc7f333c28c683e130ee05f0.css

1 ответ1

1

Я исправил это, изменив конфигурацию vhost так:

<VirtualHost *:80>
  ServerName git.server.net
  DocumentRoot /opt/gitlab/embedded/service/gitlab-rails/public

  ProxyRequests off
  ProxyPass / http://git.server.net:8088/
  ProxyPassReverse / http://git.server.net:8088/
</VirtualHost>

Я оставлю это для тех, кто имеет эту проблему в будущем

Всё ещё ищете ответ? Посмотрите другие вопросы с метками .