Gitlab on CentOS 7 with Apache instead of Nginx giving a “503 Service Unavailable” message

0

I just tried to install GitLab to my root server.

But hen I access the webpage using Apache for a proxy, I get a “503 Service Unavailable” message.

Here is my Apache VirtualHost configuration file:

<VirtualHost *:80>
  ServerName git.example.at

  DocumentRoot /opt/gitlab/embedded/service/gitlab-rails/public/
  <Directory /opt/gitlab/embedded/service/gitlab-rails/public/>
    Require all granted
  </Directory>

  ProxyPreserveHost On
  AllowEncodedSlashes Off

  <Location />
    Order deny,allow
    Allow from all
    ProxyPassReverse http://127.0.0.1:8080
    ProxyPassReverse http://git.example.at/
  </Location>

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

The full gitlab.rb configuration file can be found here on Pastebin.

David Nagl

Posted 2017-03-09T17:10:19.413

Reputation: 1

Answers

0

In your Apache VirtualHost configuration, both lines read ProxyPassReverse:

<Location />
  Order deny,allow
  Allow from all
  ProxyPassReverse http://127.0.0.1:8080
  ProxyPassReverse http://git.example.at/
</Location>

I think it should be:

<Location />
  Order deny,allow
  Allow from all
  ProxyPass / http://127.0.0.1:8080
  ProxyPassReverse http://git.example.at/
</Location>

Rik Tytgat

Posted 2017-03-09T17:10:19.413

Reputation: 1

now i get the Message "ProxyPass|ProxyPassMatch can not have a path when defined in a location." – David Nagl – 2017-03-09T18:06:01.083

Ok, that's because of the / in the ProxyPass line. Please remove it. – Rik Tytgat – 2017-03-09T21:29:22.927