[clug-talk] Apache and mod_rewrite tips?

Michael Gale michael.gale at bluesuperman.com
Mon Mar 14 22:07:43 PST 2005


Hello,

	You would have to use an application that allow filtering and control 
over http content. This would usually fall under a http content filter.

It might be easier to assign your internal server and 
hostname.domainname that exist both out side and internally. This would 
make it so internal DNS lookups resolve a internal IP and a external DNS 
lookup resolves a external IP. Then the Apache mod_rewrite would work.

The only HTTP content filter that I know of that allows modification of 
the actual page that is being served is using the following:

squid (Linux http cache application with ACL's)
then plugin dansguardian (dansguardian.org) which I believe will allow 
you to alter the content of the data being passed.

I am not 100% sure on this ... so you should double check the squid 
mailing list or dansguardian mailing list.

Michael.

Shawn wrote:
> Thanks for the response Dave.
> 
> What you say kinda makes sense, except I've seen reference to using 
> mod_rewrite like this.  It could be that I was misreading the pages I found, 
> but I understood that ProxyPass/ProxyPassReverse only affected the HTTP 
> headers, whereas mod_rewrite could be used to modify the contents of a page.
> 
> I did find a page referring to mod_proxy_html (not mod_proxy_http) that 
> suggested the module was nothing more than a wrapper for the appropriate 
> rewrite statements.
> 
> So, I guess my question is how do you do this then, if mod_rewrite isn't the 
> correct option?  I do have the ability to change the server and directory for 
> the entire application (we built it to be portable - er, be able to move to a 
> new server relatively easily), but there are some application server specific 
> issues that come into play here.  (CFMX 6.1 server, and the app uses a CFC 
> directory located under the server root, but not under the application root).  
> This could be a major thing to change our application structure - something 
> we simply wouldn't do for the sake of a proxy server.  It'd be much 
> easier/cheaper just to redirect port 80 directly at the IIS server and let it 
> handle the other vhosts we need.
> 
> hmmm... a thought occured to me while I was typing up that last paragraph...  
> could the problem simply be that I have a circular IP reference??  The Apache 
> server has a HOSTS entry pointing myapp.myorg.com to the internal IP of the 
> IIS server (say 192.168.0.5).  The IIS server knows that myapp.myorg.com 
> points to the apache server (via internal DNS).  So if I change the server 
> name for the application to by myapp.myorg.com, then the internal server 
> points to the apache server which  points to the internal server, which.... 
> etc.  If I were to simply add a hosts entry on the IIS server pointing 
> myapp.myorg.com to 127.0.0.1, would that take care of the problem??  If so, 
> then I shouldn't need mod_rewrite at all, and ProxyPass should do the 
> trick...
> 
> Thanks again for the feedback.  My apollogies for thinking out loud.. so to 
> speak...
> 
> Shawn
> 
> On Monday 14 March 2005 21:13, Dave Lee wrote:
> 
>>Shawn <sgrover at open2space.com> wrote:
>>
>>>Thus far, I've yet to see an anchor tag's HREF change.
>>
>>mod_rewrite doesn't rewrite urls in html, it only rewrites request
>>urls that make it to the server.  that is, if the html isn't pointing
>>to the right server, and you can't change the dns, mod_rewrite can't
>>solve the problem.
>>
>>Dave
> 
> 
> _______________________________________________
> clug-talk mailing list
> clug-talk at clug.ca
> http://clug.ca/mailman/listinfo/clug-talk_clug.ca
> Mailing List Guidelines (http://clug.ca/ml_guidelines.php)
> **Please remove these lines when replying



More information about the clug-talk mailing list