Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

A proxy question

Posted on 2002-07-01
3
Medium Priority
?
250 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 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

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

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

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…
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…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses
Course of the Month13 days, 13 hours left to enroll

963 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