GitLabredirect与Apache

我正努力在RHEL 7上用Apache 2.4configurationGitLab 8。

到目前为止,我有两个选项都不令人满意:或者我使用下面的Apacheconfiguration文件,让GitLab工作顺利,但其他所有应用程序都无法访问:

<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> 

或者我尝试以下,其他一切正常,我可以访问GitLablogin页面(通过http://server_name/gitlab/users/sign_in ),但是它会尝试连接到http://server_name/[stuff] ,没有/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> 

我远不是Apache的专家,所以我可能错过了一些显而易见的东西,但是我不能指出这里有什么问题。

任何帮助将不胜感激!

编辑:

我改变了我的Apacheconfigurationredirect8088端口的东西:

 <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> 

我还在SELinux中启用了8088端口。

其他应用程序工作正常,但我仍然无法访问GitLab,我的浏览器出现“无法连接”错误。

我试图用telnet连接,只是看到:

 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. 

所以这是一种工作,这个问题似乎是在这第一步之后。 我试图用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. 

有些东西是法文的,对不起,但至less最重要的东西显然是清楚的: ERREUR 502: Proxy Error.

我检查, mod_proxy已安装并启用,所以我不知道下一步该怎么做。

我build议你为GitLab使用一个单独的VHost。

如果您不能使用子域名或其他IP地址,请为gitlab使用不同的端口。

我并不是说不能按照你的要求正确configuration,但是通过networking和git客户端访问会带来很多问题。