...making Linux just a little more fun!
Britto I [britto_can at yahoo.com]
Folks:
I would like to have some configuration advice from you guys for apache.
I have Apache 2.2.8 running in RHEL box.
I have multiple webapps running in tomcat and connected through apache via ajp proxy.
Now we have the Rewrite rules..like
RewriteRule ^/Context1$ /Context1/ [R] RewriteRule ^/Context2$ /Context2/ [R] RewriteRule ^/$ /DefaultContext/ [R]
Here Context1,Context2, DefaultContext all are different webapps hosted by tomcat.
When somebody calls for www.mysite.com it goes to www.mysite.com/DefaultContext/ now.
How can I disable or hide the Defaultcontext being displayed in the URL.
So that if there is some hit at www.mysite.com/DefaultContext/DoAction it should display the user www.mysite.com/DoAction
Any advice guys ..
Thanks & regards, Britto
Anderson Silva [afsilva at gmail.com]
I think to do that you will need to use apache's mod_proxy, or change your DocumentRoot on the apache config.
AS
Britto I [britto_can at yahoo.com]
Thanks Anderson.
I am already using mod_proxy.
I have some static images which is currently being severed under Docroot.
and additions to that is it possible to do like..
RewriteRule ^/Context$ /Context/ ProxyPass /Context ajp://localhost:8009/Context/ DocumentRoot /Context
I was assuming that document root can point only to the directories.
-- Britto
Anderson Silva [afsilva at gmail.com]
try:
ProxyPass / ajp://localhost:8009/Context/
Britto I [britto_can at yahoo.com]
Sure Anderson.
I will try and let you know.
-- Britto
Britto I [britto_can at yahoo.com]
Not sure why...
But mounting DefaultContext to / produces slowness in the server ...
Now reverted back the changes..
Any other proposed method.. to solve this problem ..
-- Britto
Anderson Silva [afsilva at gmail.com]
On Wed, Sep 9, 2009 at 9:56 AM, Britto I<britto_can@yahoo.com> wrote:
> Not sure why.. > > But mounting DefaultContext to / produces slowness in the server ... > > Now reverted back the changes.. > > Any other proposed method.. to solve this problem ..
here's another idea, with mod_rewrite:
RewriteRule ^/$ https://something/DefaultContext/ [P,L]
the option P makes it force a proxy
You may have to adjust your regexp above, this is just a simple example.
-- https://www.the-silvas.com