Solved

redirect and mask of dynamic webpage (apache -> tomcat)

Posted on 2006-10-31
4
391 Views
Last Modified: 2008-02-01
Hi,

I have an apache-server running with a virtual host. (i.e. www.myserver.com)

I need to use some pages from a tomcat server on a different machine. I would like to mask these pages so that a call to www.myserver.com/jsp/do_stuff.jsp will redirect to my tomcat server, run the script (http://12.34.56.78/jsp/do_stuff.jsp) and then return the resulting page as if it came from www.myserver.com.

I've tried a few things with Rewrite and proxy in the httpd.conf, but only been able to redirect the call, not mask it.

Please give me some suggestions, and I will try them.

--
tekniskma
0
Comment
Question by:tekniskma
  • 2
  • 2
4 Comments
 
LVL 19

Accepted Solution

by:
ramazanyich earned 250 total points
ID: 17853886
You can use mod_jk to communicate from Apache web server with Tomcat server.
There is a nice HOWTO on apache.org site how to install and configure communication between apache and tomcat:
http://tomcat.apache.org/connectors-doc/howto/apache.html
0
 

Author Comment

by:tekniskma
ID: 17858834
I tried this, but the tomcat server used so much time responding that all my threads in apache (set by MaxClients in httpd.conf) were stuck pointing to the tomcat-server and no one could get in to the apache-server.

There might be mod_jk settings I don't know of, but this is why I wanted to redirect the call. So that apache let go of the threads.
0
 
LVL 19

Expert Comment

by:ramazanyich
ID: 17859008
But it will not solve a problem. As request which comes to Apache will wait until your tomcat server makes a response. So apache thread still will be active.
So better check your application in Tomcat to avoid long waiting times.
0
 

Author Comment

by:tekniskma
ID: 17866162
This works for redirecting, but the answer is from http://12.34.56.78:8080 unfortunately.

        RewriteEngine On
        RewriteRule /jsp/(.*) http://12.34.56.78:8080/jsp/$1 [R,NE]

I guess I can't return the result through the apache without keeping the thread open from the apache.

Thanks anyway
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

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 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). #…
This video discusses moving either the default database or any database to a new volume.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

746 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

10 Experts available now in Live!

Get 1:1 Help Now