Apache server configuration

I  have a Box with  Apache 2.2   with <IP1>

two web apps  are  hosted in other box with <IP2>


http://<ip2>:8080/myapps1   .....(1)
http://<ip2>:8082/myapps2 .......(2)

What do I write in httpd config  to redirect and reverse proxy ?


I want my user to type  in browser  http://<IP1>/myapps1   --- to open (1)
and type in browser   http://<IP1>/myapps2   --- to open (2)
cofactorAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

gheistCommented:
<Location /myapps1>
   ProxyPass http://<ip2>:8080/myapps1
   ProxyPassReverse http://<ip2>:8080/myapps1
</Location>

for AJP ProxyPassReverse is not needed.
cofactorAuthor Commented:
I think you made typo in putting urls   .  
which file in apache 2.2 you want to edit ?  name of file ?


also do I need to put a similar <Location>  tag there for  myapps2 ?

Could you please read my query  again and  check your response again .

Thanks
gheistCommented:
Apache configuration file? Typically called httpd.conf?
Since you are silent about what distribution you use past "BOX" I cannot help you to locate those files.
And dont type in bold, that scares me away.
Acronis True Image 2019 just released!

Create a reliable backup. Make sure you always have dependable copies of your data so you can restore your entire system or individual files.

cofactorAuthor Commented:
Apache configuration file? Typically called httpd.conf?
Since you are silent about what distribution you use past "BOX" I cannot help you to locate those files.

Thanks . ..its httpd config ..... Yes I know the path ...no problem.


Could you please check if this is the correct snippet ...


<Location /myapps1>
   ProxyPass http://<ip2>:8080/myapps1
   ProxyPassReverse http://<ip2>:8080/myapps1
</Location>

<Location /myapps2>
   ProxyPass http://<ip2>:8080/myapps2
   ProxyPassReverse http://<ip2>:8080/myapps2
</Location>

Open in new window



Now you also made this comment..
for AJP ProxyPassReverse is not needed.

Is there anything to install  for this AJP stuff ?  Please note I am using APache 2.2
gheistCommented:
Code snipplet is correct. (apachectl configtest may disagree- check while it is warm) ajp is abbreviated protocol apache can talk to tomcat:8009. Since I proposedto add ProxyPassReverse, I also warned about dangers future holds.
samriCommented:
Hi cofactor,


http://httpd.apache.org/docs/2.4/mod/mod_proxy.html



On the primary server (with ip1);

ProxyPass "/myapp1" "http://ip2:8080/myapp1/"
ProxyPassReverse "/myapp1" "http://ip2:8080/myapp1/"

ProxyPass "/myapp2" "http://ip2:8082/myapp12"
ProxyPassReverse "/myapp2" "http://ip2:8082/myapp2/"

This should do the work.
gheistCommented:
I put location tag because it is only place one can do rewrites and access controls on reverse proxy. All directory etc tags will not work at all.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JSP

From novice to tech pro — start learning today.