Gitlab web interface is not working with apache2 on CentOS 7.2

I re-installed my web-server to run GitLab-CI on CentOS 7.2. I was able to get it installed and have apache2 setup. I’m not sure what I did wrong. Here are the configs for both apache and gitlab.

[andrew.meyer@asm-web01 ~] sudo cat /etc/gitlab/gitlab.rb | grep -v '^|^\s*#’
external_url ‘http://gitlab.borg.local
gitlab_rails[‘time_zone’] = ‘CST’
gitlab_rails[‘db_adapter’] = “postgresql”
gitlab_rails[‘db_encoding’] = “utf8”
gitlab_rails[‘db_collation’] = ‘unicode’
gitlab_rails[‘db_database’] = “gitlabhq_production”
gitlab_rails[‘db_username’] = “gitlab”
gitlab_rails[‘db_password’] = “Infotech5!”
gitlab_rails[‘db_host’] = “10.150.1.80”
gitlab_rails[‘db_port’] = “5432”
unicorn[‘port’] = 8081
postgresql[‘enable’] = false
web_server[‘username’] = ‘gitlab-www’
web_server[‘group’] = ‘gitlab-www’
nginx[‘enable’] = false
ci_nginx[‘enable’] = false
[andrew.meyer@asm-web01 ~]$

[andrew.meyer@asm-web01 ~]$ sudo cat /etc/httpd/conf.d/gitlab.conf

This configuration has been tested on GitLab 8.2

Note this config assumes unicorn is listening on default port 8080 and

gitlab-workhorse is listening on port 8181. To allow gitlab-workhorse to

listen on port 8181, edit or create /etc/default/gitlab and change or add the following:

gitlab_workhorse_options="-listenUmask 0 -listenNetwork tcp -listenAddr 127.0.0.1:8181 -authBackend http://127.0.0.1:8080"

#Module dependencies

mod_rewrite

mod_proxy

mod_proxy_http

<VirtualHost 10.150.1.65:80>
ServerName gitlab.borg.local
ServerSignature Off
HostnameLookups Off
ProxyPreserveHost On
Options +Multiviews +FollowSymLinks
DocumentRoot /opt/gitlab/embedded/service/gitlab-rails/public

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

# 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
ProxyPass http://gitlab.borg.local:8081
ProxyPassReverse http://gitlab.borg.local:8081

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
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f

#Forward all requests to gitlab-workhorse
RewriteRule .* http://gitlab.borg.local:8081%{REQUEST_URI} [P,QSA,NE]

Require ip 127.0.0.1 10.0.0.0/8 192.168.0.0/16 172.16.0.0/12

needed for downloading attachments

#DocumentRoot /home/git/gitlab/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 /var/log/httpd/gitlab.borg.local_error.log
CustomLog /var/log/httpd/gitlab.borg.local_forwarded.log common_forwarded
CustomLog /var/log/httpd/gitlab.borg.local_access.log combined env=!dontlog
CustomLog /var/log/httpd/gitlab.borg.local.log combined

[andrew.meyer@asm-web01 ~]$