通过Apache反向代理运行gitlab和tomcat

自从两天以来,我一直在尝试使tomcat和gitlab在同一个顶级域上工作。 我的tomcat运行在8080端口,我的gitlab运行在8081 。 当我键入mywebsite.com:8081我成功地redirect到gitlab,当我键入mywebsite.com:8080我成功地redirect到我的tomcat实例。 现在我安装了apache 2 ,让它运行在80端口,并尝试使用它作为反向代理,但每次我键入http://www.mywebsite.com/gitlab我得到一个404。

我正在使用Debian,因此不得不编辑/etc/apache2/sites-available/000-default.conf现在在这个configuration里面:

 NameVirtualHost *:80 <VirtualHost *:80> Servername www.mywebsite.com <Proxy *> Order deny, allow Allow from all </Proxy> ProxyPreserveHost On ProxyPass /gitlab http://www.mywebsite.com:8081 ProxyPassReverse /gitlab http://www.mywebsite.com:8081 

这是不正确的? 我错过了致命的东西吗? 已经通过几个指导指南,但我仍然无法弄清楚如何使其工作

编辑://

Apache 2Access日志是空的…

Apache 2错误日志:

 [Fri Mar 03 08:40:32.654879 2017] [mpm_event:notice] [pid 985:tid 140413383284608] AH00489: Apache/2.4.10 (Debian) configured -- resuming normal operations [Fri Mar 03 08:40:32.712726 2017] [core:notice] [pid 985:tid 140413383284608] AH00094: Command line: '/usr/sbin/apache2' [Fri Mar 03 08:40:56.608184 2017] [mpm_event:notice] [pid 985:tid 140413383284608] AH00491: caught SIGTERM, shutting down [Fri Mar 03 09:55:19.844429 2017] [mpm_event:notice] [pid 7370:tid 140501655910272] AH00489: Apache/2.4.10 (Debian) configured -- resuming normal operations [Fri Mar 03 09:55:19.852533 2017] [core:notice] [pid 7370:tid 140501655910272] AH00094: Command line: '/usr/sbin/apache2' [Fri Mar 03 10:03:28.220153 2017] [mpm_event:notice] [pid 7370:tid 140501655910272] AH00491: caught SIGTERM, shutting down [Fri Mar 03 10:42:06.430282 2017] [mpm_event:notice] [pid 14147:tid 140077848672128] AH00489: Apache/2.4.10 (Debian) configured -- resuming normal operations [Fri Mar 03 10:42:06.433243 2017] [core:notice] [pid 14147:tid 140077848672128] AH00094: Command line: '/usr/sbin/apache2' [Fri Mar 03 11:04:47.177689 2017] [mpm_event:notice] [pid 14147:tid 140077848672128] AH00491: caught SIGTERM, shutting down [Fri Mar 03 11:04:48.289315 2017] [mpm_event:notice] [pid 15822:tid 139992495703936] AH00489: Apache/2.4.10 (Debian) configured -- resuming normal operations [Fri Mar 03 11:04:48.289386 2017] [core:notice] [pid 15822:tid 139992495703936] AH00094: Command line: '/usr/sbin/apache2' [Fri Mar 03 11:07:07.000803 2017] [mpm_event:notice] [pid 15822:tid 139992495703936] AH00491: caught SIGTERM, shutting down [Fri Mar 03 11:07:08.155106 2017] [mpm_event:notice] [pid 16111:tid 139796633421696] AH00489: Apache/2.4.10 (Debian) configured -- resuming normal operations [Fri Mar 03 11:07:08.155170 2017] [core:notice] [pid 16111:tid 139796633421696] AH00094: Command line: '/usr/sbin/apache2' [Fri Mar 03 11:18:54.854977 2017] [mpm_event:notice] [pid 16111:tid 139796633421696] AH00491: caught SIGTERM, shutting down [Fri Mar 03 11:18:56.001210 2017] [mpm_event:notice] [pid 17055:tid 139735864428416] AH00489: Apache/2.4.10 (Debian) configured -- resuming normal operations [Fri Mar 03 11:18:56.001277 2017] [core:notice] [pid 17055:tid 139735864428416] AH00094: Command line: '/usr/sbin/apache2' [Fri Mar 03 11:19:40.649005 2017] [mpm_event:notice] [pid 17055:tid 139735864428416] AH00491: caught SIGTERM, shutting down [Fri Mar 03 11:19:41.757264 2017] [mpm_event:notice] [pid 17230:tid 140277624301440] AH00489: Apache/2.4.10 (Debian) configured -- resuming normal operations [Fri Mar 03 11:19:41.757327 2017] [core:notice] [pid 17230:tid 140277624301440] AH00094: Command line: '/usr/sbin/apache2' [Fri Mar 03 11:34:57.313779 2017] [mpm_event:notice] [pid 17230:tid 140277624301440] AH00491: caught SIGTERM, shutting down [Fri Mar 03 11:35:50.648583 2017] [mpm_event:notice] [pid 963:tid 140495805245312] AH00489: Apache/2.4.10 (Debian) configured -- resuming normal operations [Fri Mar 03 11:35:50.708563 2017] [core:notice] [pid 963:tid 140495805245312] AH00094: Command line: '/usr/sbin/apache2' [Fri Mar 03 11:41:29.786364 2017] [mpm_event:notice] [pid 963:tid 140495805245312] AH00491: caught SIGTERM, shutting down [Fri Mar 03 11:41:30.892008 2017] [mpm_event:notice] [pid 1854:tid 140138175350656] AH00489: Apache/2.4.10 (Debian) configured -- resuming normal operations [Fri Mar 03 11:41:30.892054 2017] [core:notice] [pid 1854:tid 140138175350656] AH00094: Command line: '/usr/sbin/apache2' [Fri Mar 03 11:43:54.349607 2017] [mpm_event:notice] [pid 1854:tid 140138175350656] AH00491: caught SIGTERM, shutting down [Fri Mar 03 11:43:55.462423 2017] [mpm_event:notice] [pid 2137:tid 139958606403456] AH00489: Apache/2.4.10 (Debian) configured -- resuming normal operations [Fri Mar 03 11:43:55.462478 2017] [core:notice] [pid 2137:tid 139958606403456] AH00094: Command line: '/usr/sbin/apache2' [Fri Mar 03 11:44:44.826290 2017] [mpm_event:notice] [pid 2137:tid 139958606403456] AH00491: caught SIGTERM, shutting down [Fri Mar 03 11:50:24.895545 2017] [mpm_event:notice] [pid 989:tid 140278705215360] AH00489: Apache/2.4.10 (Debian) configured -- resuming normal operations [Fri Mar 03 11:50:24.935196 2017] [core:notice] [pid 989:tid 140278705215360] AH00094: Command line: '/usr/sbin/apache2' [Fri Mar 03 11:53:08.091834 2017] [mpm_event:notice] [pid 989:tid 140278705215360] AH00491: caught SIGTERM, shutting down [Fri Mar 03 11:53:09.210269 2017] [mpm_event:notice] [pid 1566:tid 140261252605824] AH00489: Apache/2.4.10 (Debian) configured -- resuming normal operations [Fri Mar 03 11:53:09.210324 2017] [core:notice] [pid 1566:tid 140261252605824] AH00094: Command line: '/usr/sbin/apache2' [Fri Mar 03 12:08:22.544593 2017] [mpm_event:notice] [pid 1566:tid 140261252605824] AH00491: caught SIGTERM, shutting down [Fri Mar 03 12:08:23.651021 2017] [mpm_event:notice] [pid 2818:tid 140229764982656] AH00489: Apache/2.4.10 (Debian) configured -- resuming normal operations [Fri Mar 03 12:08:23.651070 2017] [core:notice] [pid 2818:tid 140229764982656] AH00094: Command line: '/usr/sbin/apache2' [Fri Mar 03 12:17:44.795400 2017] [mpm_event:notice] [pid 2818:tid 140229764982656] AH00491: caught SIGTERM, shutting down [Fri Mar 03 12:17:45.967588 2017] [mpm_event:notice] [pid 3611:tid 139673959495552] AH00489: Apache/2.4.10 (Debian) configured -- resuming normal operations [Fri Mar 03 12:17:45.967642 2017] [core:notice] [pid 3611:tid 139673959495552] AH00094: Command line: '/usr/sbin/apache2' [Fri Mar 03 12:33:17.478860 2017] [mpm_event:notice] [pid 3611:tid 139673959495552] AH00491: caught SIGTERM, shutting down [Fri Mar 03 12:33:50.519860 2017] [mpm_event:notice] [pid 979:tid 139745101391744] AH00489: Apache/2.4.10 (Debian) configured -- resuming normal operations [Fri Mar 03 12:33:50.563235 2017] [core:notice] [pid 979:tid 139745101391744] AH00094: Command line: '/usr/sbin/apache2' [Fri Mar 03 12:35:44.783856 2017] [mpm_event:notice] [pid 979:tid 139745101391744] AH00491: caught SIGTERM, shutting down [Fri Mar 03 12:35:47.063628 2017] [auth_digest:notice] [pid 1875:tid 140058368026496] AH01757: generating secret for digest authentication ... [Fri Mar 03 12:35:47.064726 2017] [lbmethod_heartbeat:notice] [pid 1875:tid 140058368026496] AH02282: No slotmem from mod_heartmonitor [Fri Mar 03 12:35:48.194526 2017] [mpm_event:notice] [pid 1875:tid 140058368026496] AH00489: Apache/2.4.10 (Debian) OpenSSL/1.0.1t configured -- resuming normal operations [Fri Mar 03 12:35:48.194669 2017] [core:notice] [pid 1875:tid 140058368026496] AH00094: Command line: '/usr/sbin/apache2' 

根据你的标签,你使用的是Apache 2.4。 为此,权限语法已更改 。

新的语法将是

 Require all granted 

但我不认为这个<Proxy>块将在目前的forms无论如何。