Solved

A proxy question

Posted on 2002-07-01
3
230 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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

680 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