Apache als Proxy ohne Forward-Info

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

Apache als Proxy ohne Forward-Info

Postby tenaya » 16. July 2005 00:05

Hallo zusammen,

ich plage mich seit einiger Zeit mit folgendem Problem:

In einem kleinen Intranet befinden sich drei Server A, B und C. Server A ist der Host für eine Web-Site und "hängt" am Internet.
Weiter stellt Server A die Verbindung zum Internet für die beiden anderen Server (B und C) her und fungiert als Proxy.
Konkret werden Zugriffe in definierte Verzeichnisse von A auf die beiden Server weitergeleitet,
allerdings so, dass der anfragende Client oder Browser davon nichts merkt.

Ansätze mit ProxyPass und ProxyPassReverse haben nicht zu dem gewünschten Ergebnis geführt.
Daher ist jetzt alles mit Rewrite-Direktiven in einer .htaccess-Datei realisiert:

RewriteEngine On

RewriteRule ^project/classic/001/cgi-bin/(.+) http://192.168.1.11/cgi-bin/$1 [P,L]
RewriteRule ^project/classic/002/cgi-bin/(.+) http://192.168.1.11/cgi-bin/$1 [P,L]

RewriteRule ^project/xx7/001/cgi-bin/(.+) http://192.168.1.12/cgi-bin/$1 [P,L]
RewriteRule ^project/xx7/002/cgi-bin/(.+) http://192.168.1.12/cgi-bin/$1 [P,L]

Das Ganze funktioniert auch an sich recht gut.
Allerdings kommt es bei bestimmten Telegrammen vor, dass Apache das ursprüngliche Telegramm um "Forward"-Informationen erweitert.
Ich habe alles mit Ethereal aufgezeichnet.

Hier das Telegramm wie es von Apache empfangen wird:
No. Time Source Destination Protocol Info
704 24.153998 217.17.41.72 192.168.1.2 HTTP GET /project/classic/009/cgi-bin/OrderValues.exe?Kardex+dummy+1000+PDP,,&manual_OnOff_3,B+PDP,,&Article_Nr_3,D+PDP,,&Description_1_g,S+PDP,,&fieldbus_2,B+PDP,,&Stock_2,D+PDP,,&time_delay_3,D+PDP,,&Running3,B+PDP,,&manual_OnOff_2,B+PDP,,&position_3,D+PDP,,&Article_Nr_2,D+PDP,,&Stock_1,D+PDP,,&fieldbus_1,B+PDP,,&time_delay_2,D+PDP,,&heightmeas_3,B+PDP,,&Running2,B+PDP,,&manual_OnOff_1,B+PDP,,&position_2,D+PDP,,&Article_Nr_1,D+PDP,,&Description_1_e,S+PDP,,&time_delay_1,D+PDP,,&Running1,B+PDP,,&heightmeas_2,B+PDP,,&position_1,D+PDP,,&frequency_3,B+PDP,,&heightmeas_1,B+PDP,,&lightsensor_3,B+PDP,,&Date_Last_Service_3,D+PDP,,&frequency_2,B+PDP,,&security_3,B+PDP,,&lightsensor_2,B+PDP,,&Date_Last_Service_2,D+PDP,,&frequency_1,B+PDP,,&remove_article1,B+PDP,,&service_OnOff_3,B+PDP,,&security_2,B+PDP,,&Description_3_e,S+PDP,,&Description_2_g,S+PDP,,&Date_Last_Service_1,D+PDP,,&lightsensor_1,B+PDP,,&service_OnOff_2,B+PDP,,&security_1,B+PDP,,&service_OnOff_1,B+PDP,,&fieldbus_3,B+PDP,,&Stock_3,D+PDP,,&Description_2_e,S HTTP/1.1

Frame 704 (1486 bytes on wire, 1486 bytes captured)
Ethernet II, Src: 00:a0:c5:f2:d2:14, Dst: 00:e0:7d:e4:9f:bf
Destination: 00:e0:7d:e4:9f:bf (oem_log.sequoia.homeip.net)
Source: 00:a0:c5:f2:d2:14 (192.168.1.1)
Type: IP (0x0800)
Internet Protocol, Src Addr: 217.17.41.72 (217.17.41.72), Dst Addr: 192.168.1.2 (192.168.1.2)
Version: 4
Header length: 20 bytes
Differentiated Services Field: 0x00 (DSCP 0x00: Default; ECN: 0x00)
Total Length: 1472
Identification: 0x7ac0 (31424)
Flags: 0x04 (Don't Fragment)
Fragment offset: 0
Time to live: 55
Protocol: TCP (0x06)
Header checksum: 0xff73 (correct)
Source: 217.17.41.72 (217.17.41.72)
Destination: 192.168.1.2 (192.168.1.2)
Transmission Control Protocol, Src Port: 55376 (55376), Dst Port: http (80), Seq: 1743, Ack: 14749, Len: 1420
Source port: 55376 (55376)
Destination port: http (80)
Sequence number: 1743 (relative sequence number)
Next sequence number: 3163 (relative sequence number)
Acknowledgement number: 14749 (relative ack number)
Header length: 32 bytes
Flags: 0x0018 (PSH, ACK)
Window size: 31680
Checksum: 0x4889 (correct)
Options: (12 bytes)
Hypertext Transfer Protocol
GET /project/classic/009/cgi-bin/OrderValues.exe?Kardex+dummy+1000+PDP,,&manual_OnOff_3,B+PDP,,&Article_Nr_3,D+PDP,,&Description_1_g,S+PDP,,&fieldbus_2,B+PDP,,&Stock_2,D+PDP,,&time_delay_3,D+PDP,,&Running3,B+PDP,,&manual_OnOff_2,B+PDP,,&po
Request Method: GET
User-Agent: Mozilla/4.0 (Windows XP 5.1) Java/1.5.0_02\r\n
Host: server.java-test.dyndns.org\r\n
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2\r\n
Authorization: Basic cGV0ZXIuc3RlaWI6U2FpYV9QQ0Q=\r\n
Content-type: application/x-www-form-urlencoded\r\n
Cookie: phpbb2mysql_data=a%3A0%3A%7B%7D; phpbb2mysql_sid=dda0df14837ff1ce90dd3a3fb8a92469\r\n
Via: E250.Interpl\r\n
Connection: Keep-Alive\r\n
\r\n

Das gibt dann der Apache weiter (man beachte die Continuation-Pakete):
No. Time Source Destination Protocol Info
708 24.191546 192.168.1.2 192.168.1.11 HTTP GET /cgi-bin/OrderValues.exe?Kardex+dummy+1000+PDP,,&manual_OnOff_3,B+PDP,,&Article_Nr_3,D+PDP,,&Description_1_g,S+PDP,,&fieldbus_2,B+PDP,,&Stock_2,D+PDP,,&time_delay_3,D+PDP,,&Running3,B+PDP,,&manual_OnOff_2,B+PDP,,&position_3,D+PDP,,&Article_Nr_2,D+PDP,,&Stock_1,D+PDP,,&fieldbus_1,B+PDP,,&time_delay_2,D+PDP,,&heightmeas_3,B+PDP,,&Running2,B+PDP,,&manual_OnOff_1,B+PDP,,&position_2,D+PDP,,&Article_Nr_1,D+PDP,,&Description_1_e,S+PDP,,&time_delay_1,D+PDP,,&Running1,B+PDP,,&heightmeas_2,B+PDP,,&position_1,D+PDP,,&frequency_3,B+PDP,,&heightmeas_1,B+PDP,,&lightsensor_3,B+PDP,,&Date_Last_Service_3,D+PDP,,&frequency_2,B+PDP,,&security_3,B+PDP,,&lightsensor_2,B+PDP,,&Date_Last_Service_2,D+PDP,,&frequency_1,B+PDP,,&remove_article1,B+PDP,,&service_OnOff_3,B+PDP,,&security_2,B+PDP,,&Description_3_e,S+PDP,,&Description_2_g,S+PDP,,&Date_Last_Service_1,D+PDP,,&lightsensor_1,B+PDP,,&service_OnOff_2,B+PDP,,&security_1,B+PDP,,&service_OnOff_1,B+PDP,,&fieldbus_3,B+PDP,,&Stock_3,D+PDP,,&Description_2_e,S HTTP/1.1[Unreassembled Packet]

Frame 708 (1514 bytes on wire, 1514 bytes captured)
Ethernet II, Src: 00:e0:7d:e4:9f:bf, Dst: 00:50:c2:31:3d:7a
Destination: 00:50:c2:31:3d:7a (192.168.1.11)
Source: 00:e0:7d:e4:9f:bf (oem_log.sequoia.homeip.net)
Type: IP (0x0800)
Internet Protocol, Src Addr: 192.168.1.2 (192.168.1.2), Dst Addr: 192.168.1.11 (192.168.1.11)
Version: 4
Header length: 20 bytes
Differentiated Services Field: 0x00 (DSCP 0x00: Default; ECN: 0x00)
Total Length: 1500
Identification: 0x727a (29306)
Flags: 0x04 (Don't Fragment)
Fragment offset: 0
Time to live: 128
Protocol: TCP (0x06)
Header checksum: 0xff43 (correct)
Source: 192.168.1.2 (192.168.1.2)
Destination: 192.168.1.11 (192.168.1.11)
Transmission Control Protocol, Src Port: 1107 (1107), Dst Port: http (80), Seq: 1, Ack: 1, Len: 1460
Source port: 1107 (1107)
Destination port: http (80)
Sequence number: 1 (relative sequence number)
Next sequence number: 1461 (relative sequence number)
Acknowledgement number: 1 (relative ack number)
Header length: 20 bytes
Flags: 0x0010 (ACK)
Window size: 17520
Checksum: 0x10a7 (correct)
Hypertext Transfer Protocol
GET /cgi-bin/OrderValues.exe?Kardex+dummy+1000+PDP,,&manual_OnOff_3,B+PDP,,&Article_Nr_3,D+PDP,,&Description_1_g,S+PDP,,&fieldbus_2,B+PDP,,&Stock_2,D+PDP,,&time_delay_3,D+PDP,,&Running3,B+PDP,,&manual_OnOff_2,B+PDP,,&position_3,D+PDP,,&Art
Request Method: GET
Host: server.java-test.dyndns.org\r\n
User-Agent: Mozilla/4.0 (Windows XP 5.1) Java/1.5.0_02\r\n
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2\r\n
Authorization: Basic cGV0ZXIuc3RlaWI6U2FpYV9QQ0Q=\r\n
Content-type: application/x-www-form-urlencoded\r\n
Cookie: phpbb2mysql_data=a%3A0%3A%7B%7D; phpbb2mysql_sid=dda0df14837ff1ce90dd3a3fb8a92469\r\n
Max-Forwards: 10\r\n
X-Forwarded-For: 217.17.41.72\r\n
X-Forwarded-Host: server.java-test.dyndns.org\r\n
[Unreassembled Packet: HTTP]

No. Time Source Destination Protocol Info
709 24.191685 192.168.1.2 192.168.1.11 HTTP Continuation or non-HTTP traffic[Unreassembled Packet]

Frame 709 (1514 bytes on wire, 1514 bytes captured)
Ethernet II, Src: 00:e0:7d:e4:9f:bf, Dst: 00:50:c2:31:3d:7a
Destination: 00:50:c2:31:3d:7a (192.168.1.11)
Source: 00:e0:7d:e4:9f:bf (oem_log.sequoia.homeip.net)
Type: IP (0x0800)
Internet Protocol, Src Addr: 192.168.1.2 (192.168.1.2), Dst Addr: 192.168.1.11 (192.168.1.11)
Version: 4
Header length: 20 bytes
Differentiated Services Field: 0x00 (DSCP 0x00: Default; ECN: 0x00)
Total Length: 1500
Identification: 0x727b (29307)
Flags: 0x04 (Don't Fragment)
Fragment offset: 0
Time to live: 128
Protocol: TCP (0x06)
Header checksum: 0xff42 (correct)
Source: 192.168.1.2 (192.168.1.2)
Destination: 192.168.1.11 (192.168.1.11)
Transmission Control Protocol, Src Port: 1107 (1107), Dst Port: http (80), Seq: 1461, Ack: 1, Len: 1460
Source port: 1107 (1107)
Destination port: http (80)
Sequence number: 1461 (relative sequence number)
Next sequence number: 2921 (relative sequence number)
Acknowledgement number: 1 (relative ack number)
Header length: 20 bytes
Flags: 0x0010 (ACK)
Window size: 17520
Checksum: 0x29c1 (correct)
Hypertext Transfer Protocol
ed-Server: server.java-test.dyndns.org\r\n
GET /cgi-bin/OrderValues.exe?Kardex+dummy+1000+PDP,,&manual_OnOff_3,B+PDP,,&Article_Nr_3,D+PDP,,&Description_1_g,S+PDP,,&fieldbus_2,B+PDP,,&Stock_2,D+PDP,,&time_delay_3,D+PDP,,&Running3,B+PDP,,&manual_OnOff_2,B+PDP,,&position_3,D+PDP,,&Art
Request Method: ed-
Host: server.java-test.dyndns.org\r\n
User-Agent: Mozilla/4.0 (Windows XP 5.1) Java/1.5.0_02\r\n
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2\r\n
Authorization: Basic cGV0ZXIuc3RlaWI6U2FpYV9QQ0Q=\r\n
Content-type: application/x-www-form-urlencoded\r\n
Cookie: phpbb2mysql_data=a%3A0%3A%7B%7D; phpbb2mysql_sid=dda0df14837ff1ce90dd3a3fb8a92469\r\n
Max-Forwards: 10\r\n
X-Forwarded-For: 217.17.41.72\r\n
[Unreassembled Packet: HTTP]

No. Time Source Destination Protocol Info
711 24.203833 192.168.1.2 192.168.1.11 HTTP Continuation or non-HTTP traffic

Frame 711 (136 bytes on wire, 136 bytes captured)
Ethernet II, Src: 00:e0:7d:e4:9f:bf, Dst: 00:50:c2:31:3d:7a
Destination: 00:50:c2:31:3d:7a (192.168.1.11)
Source: 00:e0:7d:e4:9f:bf (oem_log.sequoia.homeip.net)
Type: IP (0x0800)
Internet Protocol, Src Addr: 192.168.1.2 (192.168.1.2), Dst Addr: 192.168.1.11 (192.168.1.11)
Version: 4
Header length: 20 bytes
Differentiated Services Field: 0x00 (DSCP 0x00: Default; ECN: 0x00)
Total Length: 122
Identification: 0x727c (29308)
Flags: 0x04 (Don't Fragment)
Fragment offset: 0
Time to live: 128
Protocol: TCP (0x06)
Header checksum: 0x04a4 (correct)
Source: 192.168.1.2 (192.168.1.2)
Destination: 192.168.1.11 (192.168.1.11)
Transmission Control Protocol, Src Port: 1107 (1107), Dst Port: http (80), Seq: 2921, Ack: 1, Len: 82
Source port: 1107 (1107)
Destination port: http (80)
Sequence number: 2921 (relative sequence number)
Next sequence number: 3003 (relative sequence number)
Acknowledgement number: 1 (relative ack number)
Header length: 20 bytes
Flags: 0x0018 (PSH, ACK)
Window size: 17520
Checksum: 0x8bbf (correct)
Hypertext Transfer Protocol
: server.java-test.dyndns.org\r\n
X-Forwarded-Server: server.java-test.dyndns.org\r\n
\r\n

Gibt es eine Option oder einen Weg, dem Apache das 2-malige Senden
der ursprünglichen Information (den "Forward"-Teil) abzugewöhnen?

Wer weiss was?

P.S.:
Ich verwende Apache 2.053 auf Windows 2000.
tenaya
 
Posts: 1
Joined: 15. July 2005 23:57

Return to Apache

Who is online

Users browsing this forum: No registered users and 2 guests