Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

A proxy question

Posted on 2002-07-01
3
Medium Priority
?
245 Views
Last Modified: 2010-03-04
Hello

I have my users connecting to a machine running Apache, and I want to forward the users to different instances of tomcat running on other machines based on the url the user requested.
That is, if a user requests e.g. :

http://myapachemachine/url_one 

I want to forward him to

http://myfirsttomcatmachine

and

http://myapachemachine/url_two 

must be forwarded to

http://mysecondtomcatmachine

But, it is not enough to do simple forwarding and let the user get his response from the tomcat machines. I need to get the answer to go through apache to the user.

Is this at alle possible, and is it mod_proxy i need to look at??

Please help if you have any suggestions that might be useful.

Thanks in advance.

/Lars Hammer

0
Comment
Question by:bettemissen
[X]
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
  • 2
3 Comments
 
LVL 15

Accepted Solution

by:
samri earned 800 total points
ID: 7122249
Lars Hammer,

Yes it can be done via mod_proxy.

Check out Apache mod_proxy documentation.
http://httpd.apache.org/docs/mod/mod_proxy.html

Specificall, jump to ProxyPass, and ProxyPassReverse
http://httpd.apache.org/docs/mod/mod_proxy.html#proxypass
http://httpd.apache.org/docs/mod/mod_proxy.html#proxypassreverse

You might want to try the following config section.
Make sure you adjust the Allow to suit your network.
----
<IfModule mod_proxy.c>
    ProxyRequests On
#    ProxyRemote * http://yourremote.proxy:8080

    <Directory proxy:*>
        Order deny,allow
        Deny from all
        Allow from 127.0.0. 192.168.0
    </Directory>

    #
    # Enable/disable the handling of HTTP/1.1 "Via:" headers.
    # ("Full" adds the server version; "Block" removes all outgoing Via: headers)
    # Set to one of: Off | On | Full | Block
    #
    ProxyVia On

    #
    # To enable the cache as well, edit and uncomment the following lines:
    # (no cacheing without CacheRoot)
    #
    CacheRoot "C:/Program Files/Apache Group/Apache/proxy"
    CacheSize 10240
    CacheGcInterval 4
    CacheMaxExpire 24
    CacheLastModifiedFactor 0.1
    CacheDefaultExpire 1
#    NoCache a_domain.com another_domain.edu joes.garage_sale.com

   ProxyPass         /url_one/           http://myfirsttomcatmachine/
   ProxyPassReverse  /url_one/           http://myfirsttomcatmachine/
   ProxyPass         /url_two/           http://mysecondtomcatmachine/
   ProxyPassReverse  /url_two/           http://mysecondtomcatmachine/

</IfModule>
0
 

Author Comment

by:bettemissen
ID: 7123994
Thanks!

That was exactly what i needed.

/Lars Hammer
0
 
LVL 15

Expert Comment

by:samri
ID: 7130919
Lars,

you have been a while with EE.

If the proposed solution works, you might need to cloe the Question.  Just click on the button "Accept Comment as Answer".

Should you require further assistance, please as, or open another Q.

Cheers.
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

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 …
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

704 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