Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Apache 2.0 Mod_Rewrite without Redirect

Posted on 2003-12-11
6
1,190 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
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

 
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

If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

791 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