/ / Umleiten einer Web-App von localhost: 8080 / my-webapp zu localhost mit Apache - Apache, Tomcat

Umleiten einer Web-App von localhost: 8080 / my-webapp zu localhost mit Apache - Apache, Tomcat

Ich habe eine Web-App von Tomcat gehostet, die ich sehen kann localhost:8080/my-webapp/. Ich möchte es umleiten localhost mit Apache, aber ich bin dazu nicht in der Lage.

Hier ist meine Konfigurationsdatei für Apache:

LoadModule proxy_module modules/mod_proxy.so
LoadModule deflate_module modules/mod_deflate.so
LoadModule proxy_html_module modules/mod_proxy_html.so

<VirtualHost localhost:80>
ProxyPass / http://localhost:8080/my-webapp/
ProxyPassReverse / http://localhost:8080/my-webapp/
</VirtualHost>

Apache funktioniert, aber wenn ich gehe localhost Ich bekomme den Standard "es funktioniert" HTML-Datei (nicht meine Web-App) - Ich habe Apache mehrmals neu gestartet.

Gibt es eine Standardmethode für die Umleitung?

Hinweis: Ich verwende Apache 2.2.22 unter Debian.

BEARBEITEN: tail -f /var/log/apache/error.log nachdem ich Apache neu gestartet habe:

[Thu Oct 09 09:52:33 2014] [warn] module proxy_module is already loaded, skipping
[Thu Oct 09 09:52:33 2014] [warn] module deflate_module is already loaded, skipping
[Thu Oct 09 09:52:33 2014] [warn] module proxy_html_module is already loaded, skipping
[Thu Oct 09 09:52:33 2014] [notice] Apache/2.2.22 (Debian) mod_jk/1.2.37       proxy_html/3.0.1 configured -- resuming normal operations

Antworten:

1 für die Antwort № 1

Mit Bezug auf die Kommentare: Zuerst die ersten drei Zeilen ausrangieren. Dann versuche folgendes:

<VirtualHost localhost:80>
ServerName localhost

ProxyRequests Off
ProxyPreserveHost On
ProxyPass / http://localhost:8080/my-webapp/
ProxyPassReverse / http://localhost:8080/my-webapp/

LogLevel debug
CustomLog /var/log/apache/localhost.proxy.access.log combined
ErrorLog /var/log/apache/localhost.proxy.error.log
</VirtualHost>

Dann überprüfen Sie die Konfiguration mit apache2ctl -t und laden Sie Apache neu, wenn alles in Ordnung ist.

Falls apache immer noch die Standard-Website bedient, verwenden Sie apache2ctl -Sum eine Liste aller geladenen VirtualHosts zu sehen. Fügen Sie außerdem den Inhalt der neu erstellten Datei localhost.proxy.error / access.log in den Post ein.