Reverse Proxy einrichten

Alles, was den Apache betrifft, kann hier besprochen werden.

Reverse Proxy einrichten

Postby Roeni » 15. July 2008 20:18

Hallo,

ich möchte einen ReverseProxy einrichten.

hier die Zeilen der httpd.conf die ich geändert habe:
Code: Select all
LoadModule deflate_module modules/mod_deflate.so
LoadModule headers_module modules/mod_headers.so
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_html_module modules/mod_proxy_html/mod_proxy_html.so

Include conf/proxy_html.conf

ProxyPass /xxx/ http://localhost:8080/
<Location /xxx/>
     ProxyPassReverse /
     ProxyHTMLURLMap / /xxx/
     ProxyHTMLURLMap /xxx /xxx
</Location>
ProxyPassReverseCookieDomain localhost:8080 revProxy


Ich will also das wenn ich http://localhost/xxx/ eingebe die seite kommt, die der webserver auf port 8080 ausspruckt.
Das er sich "etwas" von 8080 holt klappt schonmal... Siehe Bild:
Image

Allerdings klappt die sache mit dem umschreiben der URLs wohl noch nich so ganz
wenn ich mir die url der bilder ansehe steht da:
http://localhost/images/head_wiips.gif
sollte aber sein:
http://localhost/xxx/images/head_wiips.gif

wenn ich http://localhost/xxx/images/head_wiips.gif direkt eingebe, zeigt er mir das bild problemlos an (zumindest im IE, firefox hat so seine probleme damit)

für das url umschreiben sollte ja dieser teil zuständig sein:
Code: Select all
 ProxyHTMLURLMap / /xxx/
     ProxyHTMLURLMap /xxx /xxx


Fehlt da irgendwas? oder was is da falsch?
Ich stehe irgendwie aufm schlauch.

danke schonmal für eure hilfe

mfg
roeni
Roeni
 
Posts: 8
Joined: 21. April 2007 15:59

Postby Roeni » 16. July 2008 19:13

Update:

mittlerweile schaut meine httpd.conf so aus:
Code: Select all
ProxyPass /xxx/ http://localhost:8080/
<Location /xxx/>
     ProxyPassReverse /
     ProxyHTMLURLMap / /xxx/
     ProxyHTMLURLMap /xxx /xxx
</Location>
ProxyPassReverseCookieDomain localhost:8080 revProxy
ProxyPassReverseCookiePath / /xxx
SetOutputFilter INFLATE;proxy-html;DEFLATE
RequestHeader unset Accept-Encoding


und die website die angezeigt wird so:
Image

wenn ich ein bild direkt aufrufe sieht das so aus:
Image

das kann doch nur noch eine kleinigkeit sein?

Edit:
OS: Windows Xp Prof SP3
Apache: Apache2.2
Roeni
 
Posts: 8
Joined: 21. April 2007 15:59

Reverse Proxy Config

Postby TW » 17. July 2008 08:20

Hallo Roeni!
Mein System laüft auf einem Win2003 Server.
Ich weiß nicht ob es hilft aber bei meinem RP fehlten noch drei Module bis er funktionierte:
LoadFile modules/libxml2.dll
LoadFile modules/iconv.dll
LoadFile modules/zlib1.dll
Wo ich die gefunden habe weiß ich z. Zt. nicht mehr. Ich hab die auch nur über Google gefunden.

Schau auch mal hier:
www.apachetutor.org/admin/reverseproxies
gruß
thorsten
TW
 
Posts: 2
Joined: 16. July 2008 10:20

Postby Roeni » 17. July 2008 17:35

Danke,
habe mir die DLLs mal besorgt (http://zlatkovic.com/) aber es funktioniert immer noch nicht ganz

meine httpd.conf:
Code: Select all
Include modules/mod_proxy_html/proxy_html.conf
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule deflate_module modules/mod_deflate.so
LoadModule headers_module modules/mod_headers.so

ProxyPass /xxx/ http://localhost:8080/
<Location /xxx/>
     ProxyPassReverse /
     ProxyHTMLURLMap / /xxx/
     ProxyHTMLURLMap /xxx//xxx/
</Location>
#ProxyPassReverseCookieDomain localhost:8080 revProxy
#ProxyPassReverseCookiePath / /xxx
SetOutputFilter INFLATE;proxy-html;DEFLATE


meine modules/mod_proxy_html/proxy_html.conf:
Code: Select all
LoadFile   modules/mod_proxy_html/zlib.dll
 LoadFile   modules/mod_proxy_html/iconv.dll
 LoadFile   modules/mod_proxy_html/libxml2.dll
 LoadModule   proxy_html_module   modules/mod_proxy_html/mod_proxy_html.so


(das sind jeweils die Zeilen die ich geändert habe)

in meiner error.log erhalte ich folgende meldungen:
Code: Select all
[Thu Jul 17 18:31:05 2008] [error] [client 10.1.1.44] File does not exist: C:/Programme/Apache Software Foundation/Apache2.2/htdocs/images, referer: http://10.1.1.2/xxx/
[Thu Jul 17 18:31:05 2008] [warn] [client 10.1.1.44] No usable charset information; using configuration default, referer: http://10.1.1.2/xxx/
[Thu Jul 17 18:31:05 2008] [warn] [client 10.1.1.44] No usable charset information; using configuration default, referer: http://10.1.1.2/xxx/
[Thu Jul 17 18:31:05 2008] [warn] [client 10.1.1.44] No usable charset information; using configuration default, referer: http://10.1.1.2/xxx/
[Thu Jul 17 18:31:05 2008] [warn] [client 10.1.1.44] No usable charset information; using configuration default, referer: http://10.1.1.2/xxx/
[Thu Jul 17 18:31:05 2008] [warn] [client 10.1.1.44] No usable charset information; using configuration default, referer: http://10.1.1.2/xxx/
[Thu Jul 17 18:31:05 2008] [warn] [client 10.1.1.44] No usable charset information; using configuration default, referer: http://10.1.1.2/xxx/
[Thu Jul 17 18:31:05 2008] [warn] [client 10.1.1.44] No usable charset information; using configuration default, referer: http://10.1.1.2/xxx/


Nachtrag:

wenn ich eine website wie www.kwick.de einbinde, dann klappt das mit den bildern.
nur die lokale webseite auf dem port 8080 scheint probleme mit den bildern zu haben.
kann das irgendwie daran liegen, dass diese nicht irgendwelchen standards entspricht?

Nochmal Nachtrag:
habe jetzt ein wenig rumprobiert und glaube das es an dem WebServer liegt den meine anwendung zur verfügung stellt und werde mal dort im forum fragen
Roeni
 
Posts: 8
Joined: 21. April 2007 15:59


Return to Apache

Who is online

Users browsing this forum: No registered users and 12 guests