using Apache server as proxy.

using Apache server as proxy.

am 04.03.2007 15:36:06 von Rostislav Khaskin

--0-1411165042-1173018966=:16997
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

Good day to all. I have minimal experience with Apache, please help me=
out here.=0AI am running Windows XP. My web apps are deployed on JBOSS ser=
ver. Because I host multiple apps on multiple servers=0AI have Apache serve=
r listening on port 80 and redirecting to a corresponding jboss instance an=
d webapp.=0AHere is how I have it in httpd-vhosts.conf: :80>=0A ProxyPreserveHost On=0A ServerName floridamakler.no-ip.info=0A P=
roxyPass / http://192.168.2.100:7070/ =0A ProxyPassReverse / http://192.=
168.2.100:7070/=0A
Everything works, except when I try t=
o read remotehost address in my app, I get 92.168.2.100. How can I mak=
e it keep the original address? Thank you. =0A =0A___=
____________________________________________________________ _______________=
______=0AFinding fabulous fares is fun. =0ALet Yahoo! FareChase search you=
r favorite travel sites to find flight and hotel bargains.=0Ahttp://farecha=
se.yahoo.com/promo-generic-14795097
--0-1411165042-1173018966=:16997
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

ad>

font-size:12pt">
Good day to all.

I have minimal experience with=
Apache, please help me out here.
I am running Windows XP. My web apps a=
re deployed on JBOSS server. Because I host multiple apps on multiple serve=
rs
I have Apache server listening on port 80 and redirecting to a corres=
ponding jboss instance and webapp.
Here is how I have it in httpd-vhosts=
..conf:

<VirtualHost *:80>
  ProxyPreserveHost On
&n=
bsp; ServerName floridamakler.no-ip.info
  ProxyPass  / =
http://192.168.2.1=
00:7070/

  ProxyPassReverse  / _blank" href=3D"http://192.168.2.100:7070/">http://192.168.2.100:707 0/<=
/span>
</VirtualHost>

Everything works, except when I try t=
o read remotehost address
in my app, I get 92.168.2.100.

How can I make it keep the original =
address?

Thank you.




No=
need to miss a message. p://mobile.yahoo.com/mail=0A">Get email on-the-go
with Yahoo! Mail =
for Mobile. hoo.com/mail=0A">Get started.
--0-1411165042-1173018966=:16997--

Re: using Apache server as proxy.

am 04.03.2007 16:05:16 von Sander Temme

--Apple-Mail-4--707494605
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
charset=US-ASCII;
delsp=yes;
format=flowed


On Mar 4, 2007, at 6:36 AM, Rostislav Khaskin wrote:

> Everything works, except when I try to read remotehost address in
> my app, I get 92.168.2.100.
>
> How can I make it keep the original address?

The proxy server stores it in the X-Forwarded-For header. Your app
should have access to that.

S.

--
sctemme@apache.org http://www.temme.net/sander/
PGP FP: 51B4 8727 466A 0BC3 69F4 B7B8 B2BE BC40 1529 24AF



--Apple-Mail-4--707494605
Content-Transfer-Encoding: base64
Content-Type: application/pkcs7-signature;
name=smime.p7s
Content-Disposition: attachment;
filename=smime.p7s

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEH AQAAoIIGPDCCAvUw
ggJeoAMCAQICEAIyF6zjtP6rQ//mXTcll14wDQYJKoZIhvcNAQEEBQAwYjEL MAkGA1UEBhMCWkEx
JTAjBgNVBAoTHFRoYXd0ZSBDb25zdWx0aW5nIChQdHkpIEx0ZC4xLDAqBgNV BAMTI1RoYXd0ZSBQ
ZXJzb25hbCBGcmVlbWFpbCBJc3N1aW5nIENBMB4XDTA2MDYxODE3MDYyMFoX DTA3MDYxODE3MDYy
MFowWzEOMAwGA1UEBBMFVGVtbWUxDzANBgNVBCoTBlNhbmRlcjEVMBMGA1UE AxMMU2FuZGVyIFRl
bW1lMSEwHwYJKoZIhvcNAQkBFhJzY3RlbW1lQGFwYWNoZS5vcmcwggEiMA0G CSqGSIb3DQEBAQUA
A4IBDwAwggEKAoIBAQDJaqOD1gZ1Z4GW7jzLg192RRTnScJOrHlsHu0z4/Bj Tf+Zq4ziF8p0RZlJ
vi8V8Dx4Xwl7osFrI081IuoZQnvbLZXIYsjPTFvg/yjEpp02QLTDpSAKxBni auQGIJPgEutDmb2u
7EAm9nHPKyeJ33PbmDYKQzjujnLW1Qx77GnyocKTqrZCcpaOCH08Vn7DZnYP 8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SUwIwYDVQQKExxUaGF3dGUgQ29uc3VsdGluZyAoUHR5KSBMdGQu MSwwKgYDVQQDEyNU
aGF3dGUgUGVyc29uYWwgRnJlZW1haWwgSXNzdWluZyBDQQIQAjIXrOO0/qtD /+ZdNyWXXjANBgkq
hkiG9w0BAQEFAASCAQBxZWAM/bKmxaOO9MFRWvmqAIfPH516skARBkjtgwPf CDEai/KYZaWoqXXh
kc7pWdog+z7+ltZyAzMSMXj+E7cqB48qC++5EQgUCxIF60uCJOuf936KeJ3B eWSn+bzv1Sdbf2ZU
iPJ7rV0eFkydczVXpIkyrfh/X6CJ+J2PdtKcqvQQEYnUMb0e2wZJq24Yxtw4 atpxJ64Mmdol1njb
u5GcV5WrLwPfUhSNJWFPL7LTfLU9e83QQoQ1sNSNubsAl8Tcc/WrH5Pm1G8Y mPlVE8E9lHA+4Zwd
gKHODuzMhVzlXu234RerrfRBzYXCTV4CFbTkkm3wYZeOqybMXVPP/Mv+AAAA AAAA

--Apple-Mail-4--707494605--

Re: using Apache server as proxy.

am 04.03.2007 16:34:05 von wrowe

Sander Temme wrote:
>
> On Mar 4, 2007, at 6:36 AM, Rostislav Khaskin wrote:
>
>> Everything works, except when I try to read remotehost address in my
>> app, I get 92.168.2.100.
>>
>> How can I make it keep the original address?
>
> The proxy server stores it in the X-Forwarded-For header. Your app
> should have access to that.

What I think is happening is that your app reports it's address at
92.168.2.100 - but you told it to fix ONLY address:7070 - fix that
or fix the ProxyPassReverse statement. And remember it's only fixing
headers - your CONTENT won't be corrected (mod_proxy_html can do that.)

------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org

Re: using Apache server as proxy.

am 05.03.2007 02:27:06 von Rostislav Khaskin

--0-2132443867-1173058026=:85632
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

Thank you for your replies. Sander, X-Forwarded-For will not work for =
me. I need a way to configure apache server to route the request to the jbo=
ss, which should not know nor care how the request is passed to it. =
William, sorry I didn't quite understand how should I fix port and/or Proxy=
PassReverse. The documentation is very confusing and this is my first expos=
ure to apache. If you could give me some instruction here, I would apprecia=
te it. It looks like my initial message went out without the code I ha=
ve in http-vhosts.conf. Here is what I have inside VirtualHost tag:=0A Pro=
xyPreserveHost On=0A ServerName floridamakler.no-ip.info=0A ProxyPass / =
http://192.168.2.100:7070/ =0A ProxyPassReverse / http://192.168.2.100:70=
70/=0AI hope you could tell me an alternate way of creating this configurat=
ion. =0A----- Original Message ----=0AFrom: "William A. R=
owe, Jr." =0ATo: users@httpd.apache.org=0ASent: Sunday=
, March 4, 2007 10:34:05 AM=0ASubject: Re: [users@httpd] using Apache serve=
r as proxy. Sander Temme wrote:=0A> =0A> On Mar 4, 2007, at 6:36 AM, R=
ostislav Khaskin wrote:=0A> =0A>> Everything works, except when I try to re=
ad remotehost address in my=0A>> app, I get 92.168.2.100.=0A>>=0A>> How can=
I make it keep the original address?=0A> =0A> The proxy server stores it i=
n the X-Forwarded-For header. Your app=0A> should have access to that.=0A=
=0AWhat I think is happening is that your app reports it's address at=0A92.=
168.2.100 - but you told it to fix ONLY address:7070 - fix that=0Aor fix th=
e ProxyPassReverse statement. And remember it's only fixing=0Aheaders - yo=
ur CONTENT won't be corrected (mod_proxy_html can do that.) ----------=
-----------------------------------------------------------= 0AThe official =
User-To-User support forum of the Apache HTTP Server Project.=0ASee tp://httpd.apache.org/userslist.html> for more info.=0ATo unsubscribe, e-ma=
il: users-unsubscribe@httpd.apache.org=0A " from the digest: users-dige=
st-unsubscribe@httpd.apache.org=0AFor additional commands, e-mail: users-he=
lp@httpd.apache.org =0A =0A_________________________=
___________________________________________________________= 0ADo you Yahoo!=
?=0AEveryone is raving about the all-new Yahoo! Mail beta.=0Ahttp://new.mai=
l.yahoo.com
--0-2132443867-1173058026=:85632
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

ad>

font-size:12pt">
erif; font-size: 12pt;">Thank you for your replies.

Sander, X-Forwar=
ded-For will not work for me. I need a way to configure apache server to ro=
ute the request to the jboss, which  should not know nor care how the =
request is passed to it.

William, sorry I didn't quite understand h=
ow should I fix port and/or ProxyPassReverse. The documentation is very con=
fusing and this is my first exposure to apache. If you could give me some i=
nstruction here, I would appreciate it.

It looks like my initial mes=
sage went out without the code I have in http-vhosts.conf. Here is what I h=
ave inside VirtualHost tag:
  ProxyPreserveHost On
  Server=
Name floridamakler.no-ip.info
  ProxyPass  / =3D"_blank"
href=3D"http://192.168.2.100:7070/">http://192.168.2.100:707 0/
=

  ProxyPassReverse  / ://192.168.2.100:7070/">http://192.168.2.100:7070/
I hope you=
could tell me an alternate way of creating this configuration.

>



serif; font-size: 12pt;">----- Original Message ----
From: "William A. R=
owe, Jr." <wrowe@rowe-clan.net>
To: users@httpd.apache.org
Sent=
: Sunday, March 4, 2007 10:34:05 AM
Subject: Re: [users@httpd] using Apa=
che server as proxy.

Sander Temme wrote:
>
> On Ma=
r 4, 2007, at 6:36 AM, Rostislav Khaskin wrote:
>
>> Everyt=
hing works, except when I try to read remotehost address in my
>> =
app, I get 92.168.2.100.
>>
>> How can I make it keep the=
original address?
>
> The proxy server stores it in the X-For=
warded-For header.
Your app
> should have access to that.

What I think is happen=
ing is that your app reports it's address at
92.168.2.100 - but you told=
it to fix ONLY address:7070 - fix that
or fix the ProxyPassReverse stat=
ement.  And remember it's only fixing
headers - your CONTENT w=
on't be corrected (mod_proxy_html can do that.)

--------------------=
-------------------------------------------------
The official User-To-U=
ser support forum of the Apache HTTP Server Project.
See <URL: et=3D"_blank" href=3D"http://httpd.apache.org/userslist.html">http://httpd .=
apache.org/userslist.html
> for more info.
To unsubscribe, e-mail:=
users-unsubscribe@httpd.apache.org
   "   from the =
digest: users-digest-unsubscribe@httpd.apache.org
For additional command=
s, e-mail: users-help@httpd.apache.org


<=
br>
p://advision.webevents.yahoo.com/mailbeta/features_spam.html ">Sucker-punch =
spam
with award-winning protection.
Try the ..rd.yahoo.com/evt=3D49981/*http://advision.webevents.yahoo. com/mailbeta/fea=
tures_spam.html">free Yahoo! Mail Beta.

--0-2132443867-1173058026=:85632--