Solved

Apache 2.0 Mod_Rewrite without Redirect

Posted on 2003-12-11
6
1,182 Views
Last Modified: 2007-12-19
Hello Experts,
   We have the following setup in one of our production system.

External world -->  HardWare LoadBalancer --> Apache 2.0 --> Weblogic 7.0

Apache 2.0 and Weblogic talk to each other using the standard plugin provided by BEA. We are using one more protocol called Webdav (Which is nothing but a wrapper around http protocol). This protocol is not understandable by apache-weblogic plugin. So we are running into problems.

The only way to circumvent this problem is to bypass apache and directly contact weblogic. Please note that we can't change the URL of the external world at any cost. So we thought of using mod_rewrite in apache. The basic idea is simple as follows.

for ex : http://myserver.com/PF.jsp will get translated to http://myserver.com:7001/PF.jsp.

The problem with this approach is that, it will do a redirect. And this will be a problem if we use loadbalancer. All the machines are within  (demilitarized zone and all start with 10.x ip which is not exposed to external world). Even the apache machine will receive 10.x.x.x.

So the question is ...Is it possible to have mod_rewrite without external redirect??? Can apache rewrite the url, get the response from weblogic and send it back to the client??

Please let me know in case I need to explain this better. Any thoughts on this will be of great help.

regards
Rajesh.B




0
Comment
Question by:rajesh_bala
  • 3
  • 3
6 Comments
 
LVL 27

Expert Comment

by:BigRat
ID: 9927458
I depends on the rewrite rule which you use. The [R] flag will do a redirect, the [P] flag will do an internal proxy forward. Can you post your rewrite rules here?
0
 
LVL 10

Author Comment

by:rajesh_bala
ID: 9927498
Hi BigRat,
   Thankx for the comments. We have not yet set the rewrite rules as of now. Before writing the rewrite rule, we had a concern that apache will do an external redirect for "rewrite rules" (that is if u manipulate the URL, apache will do an external redirect).

  What I am looking for is something like what you have mentioned as internal proxy forward. Please correct me if I am wrong.

1. Original URL : http://myserver.com/PF.jsp
2. After rewrite by apache : http://myserver.com:7001/PF.jsp
3. If I use [P] flag in rewrite rule, apache will internally get the response from 7001 port and give the reply to the client.

regards
Rajesh.B
0
 
LVL 27

Expert Comment

by:BigRat
ID: 9927693
Correct.

RewriteRule ^(.*)$    http://myserver.com:7001/$1 [P,L]

OK?
0
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
LVL 10

Author Comment

by:rajesh_bala
ID: 9927765
Hello BigRat,
  One more question on this regard. I already mentioned that webdav is a protocol on top of http. Now you have mentioned that apache will do a internal proxy forward to 7001.

But will the headers be preserved by apache??.. Or will it truncate some of the headers and send it to 7001??.

~Rajesh.B
0
 
LVL 27

Accepted Solution

by:
BigRat earned 250 total points
ID: 9937451
>>But will the headers be preserved by apache??..

Basically no.  I have not studied the code, but I know that the basic authentication header will get dropped, since it is only valid for this site. You might find that the extra DAV headers get copied forward. Headers returned usually get sent on unmodified. The exception is Location, to which the proxyPassreverse directive applies.

There are mod_proxy substitutes available - some commerical. Try Google to find them.  You'll probably have to try it to find out.
0
 
LVL 10

Author Comment

by:rajesh_bala
ID: 9954926
Thankx BigRat
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
PHP Curl Multi-exec 13 67
RewriteRule to Include HTML, but Not Affect Images 4 71
Website being blocked? 3 122
apache and php 3 99
As Wikipedia explains 'robots.txt' as -- the robot exclusion standard, also known as the Robots Exclusion Protocol or robots.txt protocol, is a convention to prevent cooperating web spiders and other web robots from accessing all or part of a websit…
If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now