I am struggling to configure GitLab 8 with Apache 2.4 on RHEL 7.
So far, I have two options that are both unsatisfying: either I use the following Apache configuration file and have GitLab working smoothly, but every other apps unreachable:
<VirtualHost *:80>
ServerName server_name
DocumentRoot /opt/gitlab/embedded/service/gitlab-rails/public
ProxyPass / http://localhost:8080/
ProxyPassReverse / http://localhost:8080/
ProxyPassReverse / http://localhost:8081/
<Location />
Require all granted
</Location>
# Custom log file locations
ErrorLog /var/log/httpd/gitlab_error.log
CustomLog /var/log/httpd/gitlab_access.log combined
</VirtualHost>
Either I try the following, and everything else is working, I can access GitLab login page (through http://server_name/gitlab/users/sign_in
) but it then fails as it tries to connect to http://server_name/[stuff]
, without /gitlab
:
<VirtualHost *:80>
ServerName server_name
DocumentRoot /opt/gitlab/embedded/service/gitlab-rails/public
ProxyPass /gitlab http://localhost:8080/
ProxyPassReverse /gitlab http://localhost:8080/
ProxyPassReverse /gitlab http://localhost:8081/
<Location /gitlab>
Require all granted
</Location>
# Custom log file locations
ErrorLog /var/log/httpd/gitlab_error.log
CustomLog /var/log/httpd/gitlab_access.log combined
</VirtualHost>
I am far from being an expert with Apache, so I'm probably missing something obvious, but I can't pin down what is wrong here.
Any help would be greatly appreciated!
Edit:
I changed my Apache configuration to redirect the thing on 8088
port:
<VirtualHost *:8088>
ServerName localhost
ServerAlias server-rd
DocumentRoot /opt/gitlab/embedded/service/gitlab-rails/public
ProxyPass / http://localhost:8080
ProxyPassReverse / http://localhost:8080
ProxyPassReverse / http://localhost:8081
<Location />
Require all granted
</Location>
# Custom log file locations
ErrorLog /var/log/httpd/gitlab_error.log
CustomLog /var/log/httpd/gitlab_access.log combined
</VirtualHost>
I also enabled 8088
port in SELinux.
Other apps work well, but I still can't access GitLab, I get an "Unable to connect" error with my browser.
I tried to connect with telnet
, just to see:
telnet localhost 8088
Trying ::1...
Connected to localhost.
Escape character is '^]'.
GET /
<html><body>You are being <a href="http://localhost:8080/users/sign_in">redirected</a>.</body></html>Connection closed by foreign host.
So it's kind of working, the problem seems to be after this first step. I tried to get the webpage with wget
:
wget http://localhost:8088
--2015-11-06 16:16:58-- http://localhost:8088/
Résolution de localhost (localhost)... ::1, 127.0.0.1
Connexion vers localhost (localhost)|::1|:8088...connecté.
requête HTTP transmise, en attente de la réponse...302 Found
Emplacement: http://localhost:8088/users/sign_in [suivant]
--2015-11-06 16:16:58-- http://localhost:8088/users/sign_in
Reusing existing connection to [localhost]:8088.
requête HTTP transmise, en attente de la réponse...502 Proxy Error
2015-11-06 16:16:58 ERREUR 502: Proxy Error.
Some things are in French, sorry, but at least the most important stuff appears clearly: ERREUR 502: Proxy Error.
I checked, mod_proxy
is installed and enabled, so I don't know what to do next.