You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by James Godrej <ja...@yahoo.in> on 2011/02/24 08:39:21 UTC

[users@httpd] how to configure ProxyPass for tomcat for app which generates url at root /

I basically  have 2 applications
http://sakai.openitup.in
http://olat.openitup.in
we  wanted both of these to be accessible as
http://research.openitup.in/sakai
http://research.openitup.in/olat
and a website http://reserach.openitup.in which is separate from both of these
but what I found was if I proxy root of these apps (sakai and olat)
using a  URL for these apps only (i.e. sakai.openitup.in and olat.openitup.in)
then things work.
i.e.
vhost for sakai.openitup.in
<VirtualHost *:80 >

        ServerName sakai.openitup.in
        ProxyPass / ajp://192.168.1.14:8009/
        ProxyPassReverse / ajp://192.168.1.14:8009/

</VirtualHost>

and for olat another vhost 

<VirtualHost *:80 >

        ServerName olat.openitup.in
        ProxyPass / ajp://192.168.1.15:8009/
        ProxyPassReverse / ajp://192.168.1.15:8009/

</VirtualHost>

then things work.
But if I use in the vhost research.openitup.in

<VirtualHost *:80 >
        ServerName research.openitup.in

ProxyPass /sakai ajp://192.168.1.14:8009/
ProxyPassReverse /sakai ajp://192.168.1.14:8009/

ProxyPass /olat ajp://192.168.1.15:8009/
ProxyPassReverse /olat ajp://192.168.1.15:8009/


ProxyPass / http://192.168.1.14               
ProxyPassReverse  / http://192.168.1.14 
</VirtualHost>

in the vhost of research.openitup.in then 
http://research.openitup.in/sakai
http://research.openitup.in/olat
are not accessible.

If you notice I have forwarded root of research.openitup.in to an internal 
machine.
Which is where it actually is so ProxyPass / for research.openitup.in is needed.

So in this situation what can be a possible solution for me so that I can access 
http://research.openitup.in/sakai
and not http://sakai.openitup.in and same for olat

http://research.openitup.in/olat

and not http://olat.openitup.in

Let me know if some one has some suggestion for this part.




---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] how to configure ProxyPass for tomcat for app which generates url at root /

Posted by "Mark H. Wood" <mw...@IUPUI.Edu>.
On Fri, Feb 25, 2011 at 12:57:28PM +0100, Krist van Besien wrote:
> On Thu, Feb 24, 2011 at 8:39 AM, James Godrej <ja...@yahoo.in> wrote:
> 
> > Let me know if some one has some suggestion for this part.
> 
> Firstly: Have you correctly configured mod_jk? Do you have a mod_jk
> log file? What is in it? What is in your error log?

If he's using ProxyPass for this, then mod_jk is irrelevant; this is
using mod_proxy and mod_proxy_ajp.

-- 
Mark H. Wood, Lead System Programmer   mwood@IUPUI.Edu
Asking whether markets are efficient is like asking whether people are smart.

Re: [users@httpd] how to configure ProxyPass for tomcat for app which generates url at root /

Posted by Krist van Besien <kr...@gmail.com>.
On Thu, Feb 24, 2011 at 8:39 AM, James Godrej <ja...@yahoo.in> wrote:

> Let me know if some one has some suggestion for this part.

Firstly: Have you correctly configured mod_jk? Do you have a mod_jk
log file? What is in it? What is in your error log?

Secondlyl: If in ProxyPass the LHS ends in a / the RHS must end in a
slash too. But better not use slash at all:
ProxyPass /sakai ajp://192.168.1.14:8009

And have a look at what links your application generates. ProxyPass
and ProxyPassReverse do not change anything in the content of the html
returned by the app. You can use mod_proxyhtml to mangle the html for
you, but a better solution is to make your application aware of the
fact that it is behind a proxy.
Look at the documentation of the application and see if there is a
configuration setting to define the base URL, and set that to
http://research.openitup.in/sakai

Krist

-- 
krist.vanbesien@gmail.com
krist@vanbesien.org
Bremgarten b. Bern, Switzerland
--
A: It reverses the normal flow of conversation.
Q: What's wrong with top-posting?
A: Top-posting.
Q: What's the biggest scourge on plain text email discussions?

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org