Solved

A proxy question

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Laravel Forge - What is it? (But in non-developer language:) ) 3 75
Guacamole and browser performance 1 62
PHP Error Settings 12 78
instanceof  operator in java 26 85
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…
It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.
A company’s greatest vulnerability is their email. CEO fraud, ransomware and spear phishing attacks are the no1 threat to a company’s security. Cybercrime is responsible for the largest loss of money to companies today with losses projected to r…

929 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