Solved

A proxy question

Posted on 2002-07-01
3
194 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
  • 2
3 Comments
 
LVL 15

Accepted Solution

by:
samri earned 200 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction As you’re probably aware the HTTP protocol offers basic / weak authentication, which in combination with the relevant configuration on your web server, provides the ability to password protect all or part of your host.  If you were not…
Over the last year I have answered a couple of basic URL rewriting questions several times so I thought I might as well have a stab at: explaining the basics, providing a few useful links and consolidating some of the most common queries into a sing…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

747 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

13 Experts available now in Live!

Get 1:1 Help Now