Re: Regarding Tomcat url redirection

2024-05-22 Thread lavanya tech
o webapps/ with no 
> elements in server.xml and let them deploy. Use the correct URLs to
> access them. It's obviously some internal thing to your company because
> nobody is going to use :8443 in the real world.
>
> I'm sorry, but it seems like you are being given arbitrary and weird
> requirements almost as a game.
>
> I'm not sure I can help you any further at this point.
>
> -chris
>
> > On Wed, May 15, 2024 at 2:16 PM Christopher Schultz <
> > ch...@christopherschultz.net> wrote:
> >
> >> Lavanya,
> >>
> >> On 5/15/24 04:43, lavanya tech wrote:
> >>> Though to write you privately, regaridng the tomcat url redirection as
> >>> the mail chain is getting more big big
> >>
> >> It's better to post to the list, so anyone in your situation can learn
> >> from it.
> >>
> >>> Let me know if its fine for you and here is what I did.
> >>>
> >>> 1)   >>> autoDeploy="true">
> >>> 
> >>
> >> Don't do this. Just put towl.war into webapps/ and let it auto-deploy.
> >> What you are doing here is double-deploying your "towl" application:
> >> once as "" (ROOT) and once as "/towl". Remove this from server.xml.
> >>
> >>> 
> >>>  >>> className="org.apache.catalina.valves.rewrite.RewriteValve" />
> >>
> >> Okay.
> >>
> >>> 2) I have towl application and towl.war under webapps directory
> >>> 3) added  proxy port and proxyname to connector
> >>>
> >>>>>> protocol="org.apache.coyote.http11.Http11NioProtocol"
> >>>  maxThreads="150" SSLEnabled="true">
> >>>  proxyPort="8443" proxyName="server.lbg.com
> >>> <http://server.lbg.com>">
> >>>>>> className="org.apache.coyote.http2.Http2Protocol" />
> >>>   
> >>>>>>certificateKeystorePassword="pass"
> >>>type="RSA" />
> >>>   
> >>>   
> >>
> >> Okay.
> >>
> >>> 4) added rewrite.config under conf directory
> >>>   > # Redirect everything that is not server.lbg.com
> >>> <http://server.lbg.com> to
> >>>   > # server.lbg.com <http://server.lbg.com>. Don't worry about /towl
> >> yet.
> >>>   > RewriteCond %{HTTP_HOST} !^server\.lbg\.com$
> >>>   > RewriteRule ^/(.*) https://server.lbg.com:8443/$1
> >>> <https://server.lbg.com:8443/$1> [L]
> >>>   >
> >>>   > # Redirect anything that isn't already going to /towl
> >>>   > # to go to /towl
> >>>   > RewriteCond %{REQUEST_URI} !^/towl
> >>>   > RewriteRule ^/(.*) https://server.lbg.com:8443/towl/$1
> >>> <https://server.lbg.com:8443/towl/$1> [L]
> >>>
> >>> 5) restarted tomcat
> >>> 6) can access all the urls https://server.lbg.com:8443
> >>> <https://server.lbg.com:8443>, https://server.lbg.com
> >>> <https://server.lbg.com>, https://server.lbg.com:8443/towl
> >>> <https://server.lbg.com:8443/towl>, https://server.lbg.com/towl
> >>> <https://server.lbg.com/towl>
> >>> https://example.lbg.com:8443 <https://example.lbg.com:8443>,
> >>> https://example.lbg.com <https://example.lbg.com>,
> >>> https://example.lbg.com:8443/towl <https://example.lbg.com:8443/towl>,
> >>> https://example.lbg.com/towl <https://example.lbg.com/towl>
> >>>
> >>> Unfortunately aliasing still doesnot work https://example.lbg.com
> >>> <https://example.lbg.com> --> https://server.lbg.com:8443/towl
> >>> <https://server.lbg.com:8443/towl> and many urls works
> >>
> >> The "aliasing" will always be weird. IMO it's better to redirect. If you
> >> change to redirect, does everything *work*, even if you don't like how
> >> the browser's URL bar displays?
> >>
> >> -chris
> >>
> >>> On Tue, May 14, 2024 at 11:38 PM Christopher Schultz
> >>> mailto:ch...@christopherschultz.net>>
> >> wrote:
> >>>
> >>>  Lavanya,
> >>>
> >>

Re: Regarding Tomcat url redirection

2024-05-16 Thread Christopher Schultz

Lavanya,

On 5/15/24 09:09, lavanya tech wrote:

Hi Chris,





If i remove this from server.xml file i have the below error.

Message java.lang.NoClassDefFoundError: org/towl/indexer/web/Prefix

Description The server encountered an unexpected condition that prevented
it from fulfilling the request.

Exception

jakarta.servlet.ServletException: java.lang.NoClassDefFoundError:
org/towl/indexer/web/Prefix
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:333)
jakarta.servlet.http.HttpServlet.service(HttpServlet.java:658)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)


That smells like a CLASSPATH problem where your application is not 
actually packaged properly. It could be something else, but it looks 
suspicious.



The "aliasing" will always be weird. IMO it's better to redirect. If you
change to redirect, does everything *work*, even if you don't like how
the browser's URL bar displays?
   --> I tried but it didnot work
ok apart from this tpic , we have one more issue found.


Actually application team, they are deploying two applications one with
towl (which you are already aware) the other one is (towl-app) they have
defined seperate server.xml for both.


Separate server.xml files means that you have to have two separate 
Tomcat processes.



Name:server.lbg.com
Address:  192.168.200.120
Aliases:  example.lbg.com


Name:server.lbg.com
Address:  192.168.200.120
Aliases:  example-app.lbg.com

which means we have two aliases for server.lbg.com , earlier we were
concentrating only on one example.lbg.com , now i wanted to somehow enable
access as the same for the other one also
https://example-app.lbg.com --> https://server.lbg.com:8444/towl-app

So i created iptable rule in the sameway as before redirect 443 to 8444 and
i have the urls working same as example.lbg.com

Both the server.xml files are here

/git/towl/apachetomcat/conf/server.xml
/git/towl-app/apachetomcat/conf/server.xml --> I changed the port of
connectors and everything

But now when i try to access https://example.lbg.com --> I get webpage of
https://example-app.lbg.com and sometimes i get webpage of
https://example.lbg.com after refresh itself which is wierd

May i know why this is happening. If we fix this then I am thinking to
disable the unwated urls leaving the required ones. for example the below
ones. I think that would be easier ? rather than redirecting or aliasing-->
Because we noticed that towl application is already pointing with
https://example.lbg.com

https://server.lbg.com:8443
   https://example-lbg.com:8443
   <https://example.lbg.com/towl>
<https://server.lbg.com/towl>
https://server.lbg.com:8444
   https://example-lbg.com:8444
   <https://example.lbg.com/towl-app>
<https://server.lbg.com/towl-app>

kindly suggest us a fix.


The best fix is to deploy the two applications normally without any 
funny business. Put both applications into webapps/ with no  
elements in server.xml and let them deploy. Use the correct URLs to 
access them. It's obviously some internal thing to your company because 
nobody is going to use :8443 in the real world.


I'm sorry, but it seems like you are being given arbitrary and weird 
requirements almost as a game.


I'm not sure I can help you any further at this point.

-chris


On Wed, May 15, 2024 at 2:16 PM Christopher Schultz <
ch...@christopherschultz.net> wrote:


Lavanya,

On 5/15/24 04:43, lavanya tech wrote:

Though to write you privately, regaridng the tomcat url redirection as
the mail chain is getting more big big


It's better to post to the list, so anyone in your situation can learn
from it.


Let me know if its fine for you and here is what I did.

1)  



Don't do this. Just put towl.war into webapps/ and let it auto-deploy.
What you are doing here is double-deploying your "towl" application:
once as "" (ROOT) and once as "/towl". Remove this from server.xml.






Okay.


2) I have towl application and towl.war under webapps directory
3) added  proxy port and proxyname to connector

  
 proxyPort="8443" proxyName="server.lbg.com
<http://server.lbg.com>">
  
  
  
  
  


Okay.


4) added rewrite.config under conf directory
  > # Redirect everything that is not server.lbg.com
<http://server.lbg.com> to
  > # server.lbg.com <http://server.lbg.com>. Don't worry about /towl

yet.

  > RewriteCond %{HTTP_HOST} !^server\.lbg\.com$
  > RewriteRule ^/(.*) https://server.lbg.com:8443/$1
<https://server.lbg.com:8443/$1> [L]
  >
  > # Redirect anything that isn't already going to /towl
  > # to go to /towl
  > RewriteCond %{REQUEST_URI} !^/towl
  > RewriteRule ^/(.*) https://server.lbg.com:8443/towl/$1
<https://server.lbg.com:8443/towl

Re: Regarding Tomcat url redirection

2024-05-16 Thread Christopher Schultz

Lavanya,

On 5/15/24 09:09, lavanya tech wrote:

Hi Chris,





If i remove this from server.xml file i have the below error.

Message java.lang.NoClassDefFoundError: org/towl/indexer/web/Prefix

Description The server encountered an unexpected condition that prevented
it from fulfilling the request.

Exception

jakarta.servlet.ServletException: java.lang.NoClassDefFoundError:
org/towl/indexer/web/Prefix
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:333)
jakarta.servlet.http.HttpServlet.service(HttpServlet.java:658)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)


That smells like a CLASSPATH problem where your application is not 
actually packaged properly. It could be something else, but it looks 
suspicious.



The "aliasing" will always be weird. IMO it's better to redirect. If you
change to redirect, does everything *work*, even if you don't like how
the browser's URL bar displays?
   --> I tried but it didnot work
ok apart from this tpic , we have one more issue found.


Actually application team, they are deploying two applications one with
towl (which you are already aware) the other one is (towl-app) they have
defined seperate server.xml for both.


Separate server.xml files means that you have to have two separate 
Tomcat processes.



Name:server.lbg.com
Address:  192.168.200.120
Aliases:  example.lbg.com


Name:server.lbg.com
Address:  192.168.200.120
Aliases:  example-app.lbg.com

which means we have two aliases for server.lbg.com , earlier we were
concentrating only on one example.lbg.com , now i wanted to somehow enable
access as the same for the other one also
https://example-app.lbg.com --> https://server.lbg.com:8444/towl-app

So i created iptable rule in the sameway as before redirect 443 to 8444 and
i have the urls working same as example.lbg.com

Both the server.xml files are here

/git/towl/apachetomcat/conf/server.xml
/git/towl-app/apachetomcat/conf/server.xml --> I changed the port of
connectors and everything

But now when i try to access https://example.lbg.com --> I get webpage of
https://example-app.lbg.com and sometimes i get webpage of
https://example.lbg.com after refresh itself which is wierd

May i know why this is happening. If we fix this then I am thinking to
disable the unwated urls leaving the required ones. for example the below
ones. I think that would be easier ? rather than redirecting or aliasing-->
Because we noticed that towl application is already pointing with
https://example.lbg.com

https://server.lbg.com:8443
   https://example-lbg.com:8443
   <https://example.lbg.com/towl>
<https://server.lbg.com/towl>
https://server.lbg.com:8444
   https://example-lbg.com:8444
   <https://example.lbg.com/towl-app>
<https://server.lbg.com/towl-app>

kindly suggest us a fix.


The best fix is to deploy the two applications normally without any 
funny business. Put both applications into webapps/ with no  
elements in server.xml and let them deploy. Use the correct URLs to 
access them. It's obviously some internal thing to your company because 
nobody is going to use :8443 in the real world.


I'm sorry, but it seems like you are being given arbitrary and weird 
requirements almost as a game.


I'm not sure I can help you any further at this point.

-chris


On Wed, May 15, 2024 at 2:16 PM Christopher Schultz <
ch...@christopherschultz.net> wrote:


Lavanya,

On 5/15/24 04:43, lavanya tech wrote:

Though to write you privately, regaridng the tomcat url redirection as
the mail chain is getting more big big


It's better to post to the list, so anyone in your situation can learn
from it.


Let me know if its fine for you and here is what I did.

1)  



Don't do this. Just put towl.war into webapps/ and let it auto-deploy.
What you are doing here is double-deploying your "towl" application:
once as "" (ROOT) and once as "/towl". Remove this from server.xml.






Okay.


2) I have towl application and towl.war under webapps directory
3) added  proxy port and proxyname to connector

  
 proxyPort="8443" proxyName="server.lbg.com
<http://server.lbg.com>">
  
  
  
  
  


Okay.


4) added rewrite.config under conf directory
  > # Redirect everything that is not server.lbg.com
<http://server.lbg.com> to
  > # server.lbg.com <http://server.lbg.com>. Don't worry about /towl

yet.

  > RewriteCond %{HTTP_HOST} !^server\.lbg\.com$
  > RewriteRule ^/(.*) https://server.lbg.com:8443/$1
<https://server.lbg.com:8443/$1> [L]
  >
  > # Redirect anything that isn't already going to /towl
  > # to go to /towl
  > RewriteCond %{REQUEST_URI} !^/towl
  > RewriteRule ^/(.*) https://server.lbg.com:8443/towl/$1
<https://server.lbg.com:8443/towl

Re: Regarding Tomcat url redirection

2024-05-15 Thread lavanya tech
Hi Chris,

>

If i remove this from server.xml file i have the below error.

Message java.lang.NoClassDefFoundError: org/towl/indexer/web/Prefix

Description The server encountered an unexpected condition that prevented
it from fulfilling the request.

Exception

jakarta.servlet.ServletException: java.lang.NoClassDefFoundError:
org/towl/indexer/web/Prefix
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:333)
jakarta.servlet.http.HttpServlet.service(HttpServlet.java:658)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)

The "aliasing" will always be weird. IMO it's better to redirect. If you
change to redirect, does everything *work*, even if you don't like how
the browser's URL bar displays?
  --> I tried but it didnot work
ok apart from this tpic , we have one more issue found.


Actually application team, they are deploying two applications one with
towl (which you are already aware) the other one is (towl-app) they have
defined seperate server.xml for both.

Name:server.lbg.com
Address:  192.168.200.120
Aliases:  example.lbg.com


Name:server.lbg.com
Address:  192.168.200.120
Aliases:  example-app.lbg.com

which means we have two aliases for server.lbg.com , earlier we were
concentrating only on one example.lbg.com , now i wanted to somehow enable
access as the same for the other one also
https://example-app.lbg.com --> https://server.lbg.com:8444/towl-app

So i created iptable rule in the sameway as before redirect 443 to 8444 and
i have the urls working same as example.lbg.com

Both the server.xml files are here

/git/towl/apachetomcat/conf/server.xml
/git/towl-app/apachetomcat/conf/server.xml --> I changed the port of
connectors and everything

But now when i try to access https://example.lbg.com --> I get webpage of
https://example-app.lbg.com and sometimes i get webpage of
https://example.lbg.com after refresh itself which is wierd

May i know why this is happening. If we fix this then I am thinking to
disable the unwated urls leaving the required ones. for example the below
ones. I think that would be easier ? rather than redirecting or aliasing-->
Because we noticed that towl application is already pointing with
https://example.lbg.com

   https://server.lbg.com:8443
  https://example-lbg.com:8443
  <https://example.lbg.com/towl>
<https://server.lbg.com/towl>
   https://server.lbg.com:8444
  https://example-lbg.com:8444
  <https://example.lbg.com/towl-app>
<https://server.lbg.com/towl-app>

kindly suggest us a fix.

Thanks once again for your time

Regards,
Lavanya




On Wed, May 15, 2024 at 2:16 PM Christopher Schultz <
ch...@christopherschultz.net> wrote:

> Lavanya,
>
> On 5/15/24 04:43, lavanya tech wrote:
> > Though to write you privately, regaridng the tomcat url redirection as
> > the mail chain is getting more big big
>
> It's better to post to the list, so anyone in your situation can learn
> from it.
>
> > Let me know if its fine for you and here is what I did.
> >
> > 1)   > autoDeploy="true">
> >
>
> Don't do this. Just put towl.war into webapps/ and let it auto-deploy.
> What you are doing here is double-deploying your "towl" application:
> once as "" (ROOT) and once as "/towl". Remove this from server.xml.
>
> >
> > > className="org.apache.catalina.valves.rewrite.RewriteValve" />
>
> Okay.
>
> > 2) I have towl application and towl.war under webapps directory
> > 3) added  proxy port and proxyname to connector
> >
> >   > protocol="org.apache.coyote.http11.Http11NioProtocol"
> > maxThreads="150" SSLEnabled="true">
> > proxyPort="8443" proxyName="server.lbg.com
> > <http://server.lbg.com>">
> >   > className="org.apache.coyote.http2.Http2Protocol" />
> >  
> >   >   certificateKeystorePassword="pass"
> >   type="RSA" />
> >  
> >  
>
> Okay.
>
> > 4) added rewrite.config under conf directory
> >  > # Redirect everything that is not server.lbg.com
> > <http://server.lbg.com> to
> >  > # server.lbg.com <http://server.lbg.com>. Don't worry about /towl
> yet.
> >  > RewriteCond %{HTTP_HOST} !^server\.lbg\.com$
> >  > RewriteRule ^/(.*) https://server.lbg.com:8443/$1
> > <https://server.lbg.com:8443/$1> [L]
> >  >
> >  > # Redirect anything that isn't already going to /towl
> >  > # to go to /towl
> >  > RewriteCond %{REQUEST_URI} !^/towl

Re: Regarding Tomcat url redirection

2024-05-15 Thread Christopher Schultz

Lavanya,

On 5/15/24 04:43, lavanya tech wrote:
Though to write you privately, regaridng the tomcat url redirection as 
the mail chain is getting more big big


It's better to post to the list, so anyone in your situation can learn 
from it.



Let me know if its fine for you and here is what I did.

1)      autoDeploy="true">

           


Don't do this. Just put towl.war into webapps/ and let it auto-deploy. 
What you are doing here is double-deploying your "towl" application: 
once as "" (ROOT) and once as "/towl". Remove this from server.xml.



           
           className="org.apache.catalina.valves.rewrite.RewriteValve" />


Okay.


2) I have towl application and towl.war under webapps directory
3) added  proxy port and proxyname to connector

     protocol="org.apache.coyote.http11.Http11NioProtocol"

                maxThreads="150" SSLEnabled="true">
                proxyPort="8443" proxyName="server.lbg.com 
<http://server.lbg.com>">
         className="org.apache.coyote.http2.Http2Protocol" />

         
             
         
     


Okay.


4) added rewrite.config under conf directory
 > # Redirect everything that is not server.lbg.com 
<http://server.lbg.com> to

 > # server.lbg.com <http://server.lbg.com>. Don't worry about /towl yet.
 > RewriteCond %{HTTP_HOST} !^server\.lbg\.com$
 > RewriteRule ^/(.*) https://server.lbg.com:8443/$1 
<https://server.lbg.com:8443/$1> [L]

 >
 > # Redirect anything that isn't already going to /towl
 > # to go to /towl
 > RewriteCond %{REQUEST_URI} !^/towl
 > RewriteRule ^/(.*) https://server.lbg.com:8443/towl/$1 
<https://server.lbg.com:8443/towl/$1> [L]


5) restarted tomcat
6) can access all the urls https://server.lbg.com:8443 
<https://server.lbg.com:8443>, https://server.lbg.com 
<https://server.lbg.com>, https://server.lbg.com:8443/towl 
<https://server.lbg.com:8443/towl>, https://server.lbg.com/towl 
<https://server.lbg.com/towl>
https://example.lbg.com:8443 <https://example.lbg.com:8443>, 
https://example.lbg.com <https://example.lbg.com>, 
https://example.lbg.com:8443/towl <https://example.lbg.com:8443/towl>, 
https://example.lbg.com/towl <https://example.lbg.com/towl>


Unfortunately aliasing still doesnot work https://example.lbg.com 
<https://example.lbg.com> --> https://server.lbg.com:8443/towl 
<https://server.lbg.com:8443/towl> and many urls works


The "aliasing" will always be weird. IMO it's better to redirect. If you 
change to redirect, does everything *work*, even if you don't like how 
the browser's URL bar displays?


-chris

On Tue, May 14, 2024 at 11:38 PM Christopher Schultz 
mailto:ch...@christopherschultz.net>> wrote:


Lavanya,

On 5/14/24 15:11, lavanya tech wrote:
 > You are right. We need aliasing here which means the URL in the
browser
 > does not change.
 > May I know where should I put the below rewrite files ?
 >
 > # Redirect everything that is not server.lbg.com
<http://server.lbg.com> to
 > # server.lbg.com <http://server.lbg.com>. Don't worry about /towl
yet.
 > RewriteCond %{HTTP_HOST} !^server\.lbg\.com$
 > RewriteRule ^/(.*) https://server.lbg.com:8443/$1
<https://server.lbg.com:8443/$1> [R=301,L]
 >
 > # Redirect anything that isn't already going to /towl
 > # to go to /towl
 > RewriteCond %{REQUEST_URI} !^/towl
 > RewriteRule ^/(.*) https://server.lbg.com:8443/towl/$1
<https://server.lbg.com:8443/towl/$1> [R=301,L]

AIUI, you can put all of the above in conf/rewrite.config and configure
the  under your  just as you had it before.

If you want aliasing and not redirection, then you don't want the [R]
flag. IMO, you should really do a redirect. If you don't, then the
application and the browser disagree about the base URL and all
kinds of
things like that.

-chris

 > On Tuesday, May 14, 2024, Christopher Schultz
mailto:ch...@christopherschultz.net>>
 > wrote:
 >
 >> Lavanya,
 >>
 >> On 5/14/24 09:12, lavanya tech wrote:
 >>
 >>> IMHO removing the port number is always the preferred solution
— I never
 >>>> did it
 >>>>
 >>>>
 >>>>> can we achieve this with tomcat or we need to setup an
reverse proxy
 >>>>> here.
 >>>>>
 >>>>>
 >>>> Your application uses whatever internal URLs it wants. Are you
building
 >>>> those yourself, or are you asking Tomcat for the e.g.
hostname, etc.? If
 >>>> it's Tomca

Re: Regarding Tomcat url redirection

2024-05-14 Thread Christopher Schultz

Lavanya,

On 5/14/24 15:11, lavanya tech wrote:

You are right. We need aliasing here which means the URL in the browser
does not change.
May I know where should I put the below rewrite files ?

# Redirect everything that is not server.lbg.com to
# server.lbg.com. Don't worry about /towl yet.
RewriteCond %{HTTP_HOST} !^server\.lbg\.com$
RewriteRule ^/(.*) https://server.lbg.com:8443/$1 [R=301,L]

# Redirect anything that isn't already going to /towl
# to go to /towl
RewriteCond %{REQUEST_URI} !^/towl
RewriteRule ^/(.*) https://server.lbg.com:8443/towl/$1 [R=301,L]


AIUI, you can put all of the above in conf/rewrite.config and configure 
the  under your  just as you had it before.


If you want aliasing and not redirection, then you don't want the [R] 
flag. IMO, you should really do a redirect. If you don't, then the 
application and the browser disagree about the base URL and all kinds of 
things like that.


-chris


On Tuesday, May 14, 2024, Christopher Schultz 
wrote:


Lavanya,

On 5/14/24 09:12, lavanya tech wrote:


IMHO removing the port number is always the preferred solution — I never

did it



can we achieve this with tomcat or we need to setup an reverse proxy
here.



Your application uses whatever internal URLs it wants. Are you building
those yourself, or are you asking Tomcat for the e.g. hostname, etc.? If
it's Tomcat, this is where the proxyName and proxyPort come in.



   - Yes, I have not built these UrLs before. It’s was working from the
very
beginning. As. I mentioned we are not able to reach goal or whatever.

Rather than saying redirection, I would say it’s aliasing.



Please be specific. "Aliasing" (to me) means "the URL does to the right
place but doesn't change in the browser's URL" and "redirection" (to
everybody) means "HTTP 301 or 302 response to a new URL".

Instead of moving applications or changing tomcat configuration it’s easier

to achieve with reverse proxy ?

https://example.lbg.com/ to https://server.lbg.com:8443/towl



This will be a nightmare. Do not try to rewrite URLs using a reverse
proxy. You should redirect users to the right place if necessary. You can
use a reverse-proxy if you want, but it won't be any less complicated than
having Tomcat do it.

I think your rewrite.config file just needs a few tweaks:

# Redirect everything that is not server.lbg.com to
# server.lbg.com. Don't worry about /towl yet.
RewriteCond %{HTTP_HOST} !^server\.lbg\.com$
RewriteRule ^/(.*) https://server.lbg.com:8443/$1 [R=301,L]

# Redirect anything that isn't already going to /towl
# to go to /towl
RewriteCond %{REQUEST_URI} !^/towl
RewriteRule ^/(.*) https://server.lbg.com:8443/towl/$1 [R=301,L]

The application should be deployed as towl.war (or towl/ directory). You
should listen on ports 80, 443, and 8443, and you should always end up at
the right place. You should have proxyPort="8443" and proxyName="
server.lbg.com" in your .

You will not need a ROOT context, since the rewrite will take care of that
for you.

-chris

On Mon, May 13, 2024 at 10:17 PM lavanya tech 

wrote:

Hi Chris,

Sorry, If I did confuse. It’s important that
https://server.lbg.com:8443/towl is always working. Goal is not to
disable /towl, but just redirect or aliasing

https//example.lbg.com/ to https://server.lbg.com:8443/towl




Thanks,
Lavanya

On Monday, May 13, 2024, Christopher Schultz <
ch...@christopherschultz.net



wrote:


Lavanya,

On 5/13/24 05:57, lavanya tech wrote:

Somehow made it work now i can only access urls as you mentioned before
https://example.lbg.com and https://server.lbg.com with port 8443 and
with
out

 https://example.lbg.com/towl and https://server.lbg.com/towl --> I
have an
error now File not found.

So i think we need to make work https://example.lbg.com/ to
https://server.lbg.com/towl


I'm sorry, I'm still confused as to which way you want things.

Do you want to redirect /towl -> / or do you want to redirect / - >
/towl?

Or does it depend upon the hostname? It would really be better if you
could settle on one specific beahvior.

-chris

On Mon, May 13, 2024 at 9:41 AM lavanya tech 

wrote:

Hi Chris,


Where are you defining the RewriteValve itself?

Defined rewritevalve here
  

  
 resource="conf/rewrite.config" />

2) reated rewrite.config and added as below under conf/

 RewriteCond %{REQUEST_URI} ^/towl/(.*)
 RewriteRule ^/towl/(.*) https://example.lbg.com/%1 [R]

3) After renaming towl to ROOT -> /webapps/ROOT/WEB-INF/web.xml ( I
already have this mappings /* in web.xml file)

   
  
Logging Area

Authentication for registered users.

/*
/api/v1/search 
/api/v1/suggest/* 
  

LDAP_USER
api



4) Restarted Tomcat, Then I cannot access
https://server.lbg.com:8443/towl
--> Have below error

Message java.nio.file.NoSuchFileException:

Re: Regarding Tomcat url redirection

2024-05-14 Thread lavanya tech
Hi Chris,

You are right. We need aliasing here which means the URL in the browser
does not change.
May I know where should I put the below rewrite files ?

# Redirect everything that is not server.lbg.com to
# server.lbg.com. Don't worry about /towl yet.
RewriteCond %{HTTP_HOST} !^server\.lbg\.com$
RewriteRule ^/(.*) https://server.lbg.com:8443/$1 [R=301,L]

# Redirect anything that isn't already going to /towl
# to go to /towl
RewriteCond %{REQUEST_URI} !^/towl
RewriteRule ^/(.*) https://server.lbg.com:8443/towl/$1 [R=301,L]

Thanks,
Lavanya

On Tuesday, May 14, 2024, Christopher Schultz 
wrote:

> Lavanya,
>
> On 5/14/24 09:12, lavanya tech wrote:
>
>> IMHO removing the port number is always the preferred solution — I never
>>> did it
>>>
>>>
 can we achieve this with tomcat or we need to setup an reverse proxy
 here.


>>> Your application uses whatever internal URLs it wants. Are you building
>>> those yourself, or are you asking Tomcat for the e.g. hostname, etc.? If
>>> it's Tomcat, this is where the proxyName and proxyPort come in.
>>>
>>
>>   - Yes, I have not built these UrLs before. It’s was working from the
>> very
>> beginning. As. I mentioned we are not able to reach goal or whatever.
>>
>> Rather than saying redirection, I would say it’s aliasing.
>>
>
> Please be specific. "Aliasing" (to me) means "the URL does to the right
> place but doesn't change in the browser's URL" and "redirection" (to
> everybody) means "HTTP 301 or 302 response to a new URL".
>
> Instead of moving applications or changing tomcat configuration it’s easier
>> to achieve with reverse proxy ?
>>
>> https://example.lbg.com/ to https://server.lbg.com:8443/towl
>>
>
> This will be a nightmare. Do not try to rewrite URLs using a reverse
> proxy. You should redirect users to the right place if necessary. You can
> use a reverse-proxy if you want, but it won't be any less complicated than
> having Tomcat do it.
>
> I think your rewrite.config file just needs a few tweaks:
>
> # Redirect everything that is not server.lbg.com to
> # server.lbg.com. Don't worry about /towl yet.
> RewriteCond %{HTTP_HOST} !^server\.lbg\.com$
> RewriteRule ^/(.*) https://server.lbg.com:8443/$1 [R=301,L]
>
> # Redirect anything that isn't already going to /towl
> # to go to /towl
> RewriteCond %{REQUEST_URI} !^/towl
> RewriteRule ^/(.*) https://server.lbg.com:8443/towl/$1 [R=301,L]
>
> The application should be deployed as towl.war (or towl/ directory). You
> should listen on ports 80, 443, and 8443, and you should always end up at
> the right place. You should have proxyPort="8443" and proxyName="
> server.lbg.com" in your .
>
> You will not need a ROOT context, since the rewrite will take care of that
> for you.
>
> -chris
>
> On Mon, May 13, 2024 at 10:17 PM lavanya tech 
>>> wrote:
>>>
>>> Hi Chris,
>>>
>>> Sorry, If I did confuse. It’s important that
>>> https://server.lbg.com:8443/towl is always working. Goal is not to
>>> disable /towl, but just redirect or aliasing
>>>
>>> https//example.lbg.com/ to https://server.lbg.com:8443/towl
>>>
>>>
>>>
>>>
>>> Thanks,
>>> Lavanya
>>>
>>> On Monday, May 13, 2024, Christopher Schultz <
>>> ch...@christopherschultz.net
>>>

 wrote:
>>>
>>> Lavanya,
>>>
>>> On 5/13/24 05:57, lavanya tech wrote:
>>>
>>> Somehow made it work now i can only access urls as you mentioned before
>>> https://example.lbg.com and https://server.lbg.com with port 8443 and
>>> with
>>> out
>>>
>>> https://example.lbg.com/towl and https://server.lbg.com/towl --> I
>>> have an
>>> error now File not found.
>>>
>>> So i think we need to make work https://example.lbg.com/ to
>>> https://server.lbg.com/towl
>>>
>>>
>>> I'm sorry, I'm still confused as to which way you want things.
>>>
>>> Do you want to redirect /towl -> / or do you want to redirect / - >
>>> /towl?
>>>
>>> Or does it depend upon the hostname? It would really be better if you
>>> could settle on one specific beahvior.
>>>
>>> -chris
>>>
>>> On Mon, May 13, 2024 at 9:41 AM lavanya tech 
>>>
>>> wrote:
>>>
>>> Hi Chris,
>>>
>>>
>>> Where are you defining the RewriteValve itself?
>>>
>>> Defined rewritevalve here
>>>  >>unpackWARs="true" autoDeploy="true">
>>>
>>>  >> className="org.apache.catalina.valves.rewrite.RewriteValve" />
>>> resource="conf/rewrite.config" />
>>>
>>> 2) reated rewrite.config and added as below under conf/
>>>
>>> RewriteCond %{REQUEST_URI} ^/towl/(.*)
>>> RewriteRule ^/towl/(.*) https://example.lbg.com/%1 [R]
>>>
>>> 3) After renaming towl to ROOT -> /webapps/ROOT/WEB-INF/web.xml ( I
>>> already have this mappings /* in web.xml file)
>>>
>>>   
>>>  
>>>Logging Area
>>>
>>>Authentication for registered users.
>>>
>>>/*
>>>/api/v1/search 
>>>/api/v1/suggest/* 
>>>  
>>>
>>>LDAP_USER
>>>api
>>>
>>>  

Re: Regarding Tomcat url redirection

2024-05-14 Thread Christopher Schultz

Lavanya,

On 5/14/24 09:12, lavanya tech wrote:

IMHO removing the port number is always the preferred solution — I never
did it



can we achieve this with tomcat or we need to setup an reverse proxy here.



Your application uses whatever internal URLs it wants. Are you building
those yourself, or are you asking Tomcat for the e.g. hostname, etc.? If
it's Tomcat, this is where the proxyName and proxyPort come in.


  - Yes, I have not built these UrLs before. It’s was working from the very
beginning. As. I mentioned we are not able to reach goal or whatever.

Rather than saying redirection, I would say it’s aliasing.


Please be specific. "Aliasing" (to me) means "the URL does to the right 
place but doesn't change in the browser's URL" and "redirection" (to 
everybody) means "HTTP 301 or 302 response to a new URL".



Instead of moving applications or changing tomcat configuration it’s easier
to achieve with reverse proxy ?

https://example.lbg.com/ to https://server.lbg.com:8443/towl


This will be a nightmare. Do not try to rewrite URLs using a reverse 
proxy. You should redirect users to the right place if necessary. You 
can use a reverse-proxy if you want, but it won't be any less 
complicated than having Tomcat do it.


I think your rewrite.config file just needs a few tweaks:

# Redirect everything that is not server.lbg.com to
# server.lbg.com. Don't worry about /towl yet.
RewriteCond %{HTTP_HOST} !^server\.lbg\.com$
RewriteRule ^/(.*) https://server.lbg.com:8443/$1 [R=301,L]

# Redirect anything that isn't already going to /towl
# to go to /towl
RewriteCond %{REQUEST_URI} !^/towl
RewriteRule ^/(.*) https://server.lbg.com:8443/towl/$1 [R=301,L]

The application should be deployed as towl.war (or towl/ directory). You 
should listen on ports 80, 443, and 8443, and you should always end up 
at the right place. You should have proxyPort="8443" and 
proxyName="server.lbg.com" in your .


You will not need a ROOT context, since the rewrite will take care of 
that for you.


-chris


On Mon, May 13, 2024 at 10:17 PM lavanya tech 
wrote:

Hi Chris,

Sorry, If I did confuse. It’s important that
https://server.lbg.com:8443/towl is always working. Goal is not to
disable /towl, but just redirect or aliasing

https//example.lbg.com/ to https://server.lbg.com:8443/towl




Thanks,
Lavanya

On Monday, May 13, 2024, Christopher Schultz 


wrote:

Lavanya,

On 5/13/24 05:57, lavanya tech wrote:

Somehow made it work now i can only access urls as you mentioned before
https://example.lbg.com and https://server.lbg.com with port 8443 and
with
out

https://example.lbg.com/towl and https://server.lbg.com/towl --> I
have an
error now File not found.

So i think we need to make work https://example.lbg.com/ to
https://server.lbg.com/towl


I'm sorry, I'm still confused as to which way you want things.

Do you want to redirect /towl -> / or do you want to redirect / - > /towl?

Or does it depend upon the hostname? It would really be better if you
could settle on one specific beahvior.

-chris

On Mon, May 13, 2024 at 9:41 AM lavanya tech 

wrote:

Hi Chris,


Where are you defining the RewriteValve itself?

Defined rewritevalve here
 

 
resource="conf/rewrite.config" />

2) reated rewrite.config and added as below under conf/

RewriteCond %{REQUEST_URI} ^/towl/(.*)
RewriteRule ^/towl/(.*) https://example.lbg.com/%1 [R]

3) After renaming towl to ROOT -> /webapps/ROOT/WEB-INF/web.xml ( I
already have this mappings /* in web.xml file)

  
 
   Logging Area
   
   Authentication for registered users.
   
   /*
   /api/v1/search 
   /api/v1/suggest/* 
 
   
   LDAP_USER
   api
   
   

4) Restarted Tomcat, Then I cannot access
https://server.lbg.com:8443/towl
--> Have below error

Message java.nio.file.NoSuchFileException:
/git/apache-tomcat-10.1.11/webapps/towl/WEB-INF/lib/xss-1.0.8.jar

Description The server encountered an unexpected condition that
prevented
it from fulfilling the request.

5) Also https://example.lbg.com doesnot work anymore

Before you do anything with redirecting, can you just make sure you are
only deploying ROOT.war and nothing else?
   How can I do that. I already changed towl.war to ROOT.war

But still both the urls have error as mentioned above.


Si I revereted back the changes.
That's weird. Try stopping, deleting the work/ directory and restarting.
--> I have this wierd behavior for some reason, thoudh index.jsp is
located
no changes were made to file. After deleting cookies url works

where Am I going wrong.

Thanks,
Lavanya


On Fri, May 10, 2024 at 6:50 PM Christopher Schultz <
ch...@christopherschultz.net> wrote:

Lavanya,


On 5/10/24 04:37, lavanya tech wrote:

I tried the below and have the issues.

1)proxyPort="443" and proxyName="example.lbg.com" to the connector
2) remanmed towl.war to ROOT.war
3) created 

Re: Regarding Tomcat url redirection

2024-05-14 Thread lavanya tech
Hi Chris,

>
> IMHO removing the port number is always the preferred solution — I never
> did it
>
>>
>> can we achieve this with tomcat or we need to setup an reverse proxy here.
>>
>
> Your application uses whatever internal URLs it wants. Are you building
> those yourself, or are you asking Tomcat for the e.g. hostname, etc.? If
> it's Tomcat, this is where the proxyName and proxyPort come in.

 - Yes, I have not built these UrLs before. It’s was working from the very
beginning. As. I mentioned we are not able to reach goal or whatever.

Rather than saying redirection, I would say it’s aliasing.
Instead of moving applications or changing tomcat configuration it’s easier
to achieve with reverse proxy ?

https://example.lbg.com/ to https://server.lbg.com:8443/towl

Kindly let me know what’s the best way.

Thanks,
Ammu




>
> -chris
>
> On Mon, May 13, 2024 at 10:17 PM lavanya tech 
> wrote:
>
> Hi Chris,
>
> Sorry, If I did confuse. It’s important that
> https://server.lbg.com:8443/towl is always working. Goal is not to
> disable /towl, but just redirect or aliasing
>
> https//example.lbg.com/ to https://server.lbg.com:8443/towl
>
>
>
>
> Thanks,
> Lavanya
>
> On Monday, May 13, 2024, Christopher Schultz  >
> wrote:
>
> Lavanya,
>
> On 5/13/24 05:57, lavanya tech wrote:
>
> Somehow made it work now i can only access urls as you mentioned before
> https://example.lbg.com and https://server.lbg.com with port 8443 and
> with
> out
>
>https://example.lbg.com/towl and https://server.lbg.com/towl --> I
> have an
> error now File not found.
>
> So i think we need to make work https://example.lbg.com/ to
> https://server.lbg.com/towl
>
>
> I'm sorry, I'm still confused as to which way you want things.
>
> Do you want to redirect /towl -> / or do you want to redirect / - > /towl?
>
> Or does it depend upon the hostname? It would really be better if you
> could settle on one specific beahvior.
>
> -chris
>
> On Mon, May 13, 2024 at 9:41 AM lavanya tech 
>
> wrote:
>
> Hi Chris,
>
>
> Where are you defining the RewriteValve itself?
>
> Defined rewritevalve here
>unpackWARs="true" autoDeploy="true">
>
>  className="org.apache.catalina.valves.rewrite.RewriteValve" />
>resource="conf/rewrite.config" />
>
> 2) reated rewrite.config and added as below under conf/
>
>RewriteCond %{REQUEST_URI} ^/towl/(.*)
>RewriteRule ^/towl/(.*) https://example.lbg.com/%1 [R]
>
> 3) After renaming towl to ROOT -> /webapps/ROOT/WEB-INF/web.xml ( I
> already have this mappings /* in web.xml file)
>
>  
> 
>   Logging Area
>   
>   Authentication for registered users.
>   
>   /*
>   /api/v1/search 
>   /api/v1/suggest/* 
> 
>   
>   LDAP_USER
>   api
>   
>   
>
> 4) Restarted Tomcat, Then I cannot access
> https://server.lbg.com:8443/towl
> --> Have below error
>
> Message java.nio.file.NoSuchFileException:
> /git/apache-tomcat-10.1.11/webapps/towl/WEB-INF/lib/xss-1.0.8.jar
>
> Description The server encountered an unexpected condition that
> prevented
> it from fulfilling the request.
>
> 5) Also https://example.lbg.com doesnot work anymore
>
> Before you do anything with redirecting, can you just make sure you are
> only deploying ROOT.war and nothing else?
>   How can I do that. I already changed towl.war to ROOT.war
>
> But still both the urls have error as mentioned above.
>
>
> Si I revereted back the changes.
> That's weird. Try stopping, deleting the work/ directory and restarting.
> --> I have this wierd behavior for some reason, thoudh index.jsp is
> located
> no changes were made to file. After deleting cookies url works
>
> where Am I going wrong.
>
> Thanks,
> Lavanya
>
>
> On Fri, May 10, 2024 at 6:50 PM Christopher Schultz <
> ch...@christopherschultz.net> wrote:
>
> Lavanya,
>
>
> On 5/10/24 04:37, lavanya tech wrote:
>
> I tried the below and have the issues.
>
> 1)proxyPort="443" and proxyName="example.lbg.com" to the connector
> 2) remanmed towl.war to ROOT.war
> 3) created rewrite.config and added as below under conf/
>
>
> Where are you defining the RewriteValve itself?
>
> RewriteCond %{REQUEST_URI} ^/towl/(.*)
>
> RewriteRule ^/towl/(.*) https://example.lbg.com/%1 [R]
>
>
> If this is being handled by the ROOT servlet then I think it's right.
>
> 4) added this in web.xml file of /webapps/towl/web.xml/
>
>
>  
>
>
>
>
>
>Restricted Access to
> /towl
>/towl/*
>
>
> No, this is wrong. Since this is the "towl" application and not ROOT,
> you want to map /* and not /towl/* because the application will never
> see the /towl/ as it's an application/context prefix that Tomcat will
> remove.
>
>
>
>
>
>
>
>
> Also I noticed that even if I rename the towl application to ROOT,
> when
>
> i
>
> call the url 

Re: Regarding Tomcat url redirection

2024-05-14 Thread Christopher Schultz

Lavanya,

On 5/14/24 03:47, lavanya tech wrote:

Hi Chris,

Tried the below steps. I have the redirection working. But the URL is not
in the browser anymore.

1)   
   

2) /conf/Catalina/localhost --> I added the below in rewrite.config

RewriteCond %{HTTP_HOST} ^example\.lbg\.com$
RewriteCond %{REQUEST_URI} !^/towl$
RewriteRule ^/(.*) https://server.lbg.com:8443/towl [R=301,L]


The problem with this is that it can redirect forever.

/towl/foo -> /towl/towl/foo -> /towl/towl/towl/foo and so on.

Your "stop criteria" ( !^/towl$ ) needs to be more like !^/towl/ without 
the $.



Then it redirects from https://example.lbg.com -->
https://server.lbg.com:8443/towl but the application team raised a concern
the

- alias https://example.lbg.com/--> url stays in the browser


IMHO removing the port number is always the preferred solution.

If https://example.lbg.com/ isn't returning a 301 response, then 
something is not quite right with your configuration.



- towl indexer uses the internal address https://
server.lbg.com.8443/towl rsp.
localhost:8443/towl

can we achieve this with tomcat or we need to setup an reverse proxy here.


Your application uses whatever internal URLs it wants. Are you building 
those yourself, or are you asking Tomcat for the e.g. hostname, etc.? If 
it's Tomcat, this is where the proxyName and proxyPort come in.


-chris


On Mon, May 13, 2024 at 10:17 PM lavanya tech 
wrote:


Hi Chris,

Sorry, If I did confuse. It’s important that
https://server.lbg.com:8443/towl is always working. Goal is not to
disable /towl, but just redirect or aliasing

https//example.lbg.com/ to https://server.lbg.com:8443/towl




Thanks,
Lavanya

On Monday, May 13, 2024, Christopher Schultz 
wrote:


Lavanya,

On 5/13/24 05:57, lavanya tech wrote:


Somehow made it work now i can only access urls as you mentioned before
https://example.lbg.com and https://server.lbg.com with port 8443 and
with
out

   https://example.lbg.com/towl and https://server.lbg.com/towl --> I
have an
error now File not found.

So i think we need to make work https://example.lbg.com/ to
https://server.lbg.com/towl



I'm sorry, I'm still confused as to which way you want things.

Do you want to redirect /towl -> / or do you want to redirect / - > /towl?

Or does it depend upon the hostname? It would really be better if you
could settle on one specific beahvior.

-chris

On Mon, May 13, 2024 at 9:41 AM lavanya tech 

wrote:

Hi Chris,


Where are you defining the RewriteValve itself?

Defined rewritevalve here



   resource="conf/rewrite.config" />

2) reated rewrite.config and added as below under conf/

   RewriteCond %{REQUEST_URI} ^/towl/(.*)
   RewriteRule ^/towl/(.*) https://example.lbg.com/%1 [R]

3) After renaming towl to ROOT -> /webapps/ROOT/WEB-INF/web.xml ( I
already have this mappings /* in web.xml file)

 

  Logging Area
  
  Authentication for registered users.
  
  /*
  /api/v1/search 
  /api/v1/suggest/* 

  
  LDAP_USER
  api
  
  

4) Restarted Tomcat, Then I cannot access
https://server.lbg.com:8443/towl
--> Have below error

Message java.nio.file.NoSuchFileException:
/git/apache-tomcat-10.1.11/webapps/towl/WEB-INF/lib/xss-1.0.8.jar

Description The server encountered an unexpected condition that
prevented
it from fulfilling the request.

5) Also https://example.lbg.com doesnot work anymore

Before you do anything with redirecting, can you just make sure you are
only deploying ROOT.war and nothing else?
  How can I do that. I already changed towl.war to ROOT.war

But still both the urls have error as mentioned above.


Si I revereted back the changes.
That's weird. Try stopping, deleting the work/ directory and restarting.
--> I have this wierd behavior for some reason, thoudh index.jsp is
located
no changes were made to file. After deleting cookies url works

where Am I going wrong.

Thanks,
Lavanya


On Fri, May 10, 2024 at 6:50 PM Christopher Schultz <
ch...@christopherschultz.net> wrote:

Lavanya,


On 5/10/24 04:37, lavanya tech wrote:


I tried the below and have the issues.

1)proxyPort="443" and proxyName="example.lbg.com" to the connector
2) remanmed towl.war to ROOT.war
3) created rewrite.config and added as below under conf/



Where are you defining the RewriteValve itself?

RewriteCond %{REQUEST_URI} ^/towl/(.*)

RewriteRule ^/towl/(.*) https://example.lbg.com/%1 [R]



If this is being handled by the ROOT servlet then I think it's right.

4) added this in web.xml file of /webapps/towl/web.xml/


 
   

   
   
   
   Restricted Access to
/towl
   /towl/*



No, this is wrong. Since this is the "towl" application and not ROOT,
you want to map /* and not /towl/* because the application will never
see the /towl/ as it's an 

Re: Regarding Tomcat url redirection

2024-05-14 Thread lavanya tech
Hi Chris,

Tried the below steps. I have the redirection working. But the URL is not
in the browser anymore.

1)   
  

2) /conf/Catalina/localhost --> I added the below in rewrite.config

RewriteCond %{HTTP_HOST} ^example\.lbg\.com$
RewriteCond %{REQUEST_URI} !^/towl$
RewriteRule ^/(.*) https://server.lbg.com:8443/towl [R=301,L]

Then it redirects from https://example.lbg.com -->
https://server.lbg.com:8443/towl but the application team raised a concern
the

   - alias https://example.lbg.com/--> url stays in the browser
   - towl indexer uses the internal address https://
   server.lbg.com.8443/towl rsp.
   localhost:8443/towl

can we achieve this with tomcat or we need to setup an reverse proxy here.
Pleaes kindly suggest

Thanks,
Lavanya



On Mon, May 13, 2024 at 10:17 PM lavanya tech 
wrote:

> Hi Chris,
>
> Sorry, If I did confuse. It’s important that
> https://server.lbg.com:8443/towl is always working. Goal is not to
> disable /towl, but just redirect or aliasing
>
> https//example.lbg.com/ to https://server.lbg.com:8443/towl
>
>
>
>
> Thanks,
> Lavanya
>
> On Monday, May 13, 2024, Christopher Schultz 
> wrote:
>
>> Lavanya,
>>
>> On 5/13/24 05:57, lavanya tech wrote:
>>
>>> Somehow made it work now i can only access urls as you mentioned before
>>> https://example.lbg.com and https://server.lbg.com with port 8443 and
>>> with
>>> out
>>>
>>>   https://example.lbg.com/towl and https://server.lbg.com/towl --> I
>>> have an
>>> error now File not found.
>>>
>>> So i think we need to make work https://example.lbg.com/ to
>>> https://server.lbg.com/towl
>>>
>>
>> I'm sorry, I'm still confused as to which way you want things.
>>
>> Do you want to redirect /towl -> / or do you want to redirect / - > /towl?
>>
>> Or does it depend upon the hostname? It would really be better if you
>> could settle on one specific beahvior.
>>
>> -chris
>>
>> On Mon, May 13, 2024 at 9:41 AM lavanya tech 
>>> wrote:
>>>
>>> Hi Chris,

 Where are you defining the RewriteValve itself?

 Defined rewritevalve here
>>>  unpackWARs="true" autoDeploy="true">

>>> className="org.apache.catalina.valves.rewrite.RewriteValve" />
   resource="conf/rewrite.config" />

 2) reated rewrite.config and added as below under conf/

   RewriteCond %{REQUEST_URI} ^/towl/(.*)
   RewriteRule ^/towl/(.*) https://example.lbg.com/%1 [R]

 3) After renaming towl to ROOT -> /webapps/ROOT/WEB-INF/web.xml ( I
 already have this mappings /* in web.xml file)

 

  Logging Area
  
  Authentication for registered users.
  
  /*
  /api/v1/search 
  /api/v1/suggest/* 

  
  LDAP_USER
  api
  
  

 4) Restarted Tomcat, Then I cannot access
 https://server.lbg.com:8443/towl
 --> Have below error

 Message java.nio.file.NoSuchFileException:
 /git/apache-tomcat-10.1.11/webapps/towl/WEB-INF/lib/xss-1.0.8.jar

 Description The server encountered an unexpected condition that
 prevented
 it from fulfilling the request.

 5) Also https://example.lbg.com doesnot work anymore

 Before you do anything with redirecting, can you just make sure you are
 only deploying ROOT.war and nothing else?
  How can I do that. I already changed towl.war to ROOT.war

 But still both the urls have error as mentioned above.


 Si I revereted back the changes.
 That's weird. Try stopping, deleting the work/ directory and restarting.
 --> I have this wierd behavior for some reason, thoudh index.jsp is
 located
 no changes were made to file. After deleting cookies url works

 where Am I going wrong.

 Thanks,
 Lavanya


 On Fri, May 10, 2024 at 6:50 PM Christopher Schultz <
 ch...@christopherschultz.net> wrote:

 Lavanya,
>
> On 5/10/24 04:37, lavanya tech wrote:
>
>> I tried the below and have the issues.
>>
>> 1)proxyPort="443" and proxyName="example.lbg.com" to the connector
>> 2) remanmed towl.war to ROOT.war
>> 3) created rewrite.config and added as below under conf/
>>
>
> Where are you defining the RewriteValve itself?
>
> RewriteCond %{REQUEST_URI} ^/towl/(.*)
>> RewriteRule ^/towl/(.*) https://example.lbg.com/%1 [R]
>>
>
> If this is being handled by the ROOT servlet then I think it's right.
>
> 4) added this in web.xml file of /webapps/towl/web.xml/
>>
>> 
>>   
>>
>>   
>>   
>>   
>>   Restricted Access to
>> /towl
>>   /towl/*
>>
>
> No, this is wrong. Since this is the "towl" application and not ROOT,
> 

Re: Regarding Tomcat url redirection

2024-05-13 Thread lavanya tech
Hi Chris,

Sorry, If I did confuse. It’s important that
https://server.lbg.com:8443/towl is always working. Goal is not to disable
/towl, but just redirect or aliasing

https//example.lbg.com/ to https://server.lbg.com:8443/towl




Thanks,
Lavanya

On Monday, May 13, 2024, Christopher Schultz 
wrote:

> Lavanya,
>
> On 5/13/24 05:57, lavanya tech wrote:
>
>> Somehow made it work now i can only access urls as you mentioned before
>> https://example.lbg.com and https://server.lbg.com with port 8443 and
>> with
>> out
>>
>>   https://example.lbg.com/towl and https://server.lbg.com/towl --> I
>> have an
>> error now File not found.
>>
>> So i think we need to make work https://example.lbg.com/ to
>> https://server.lbg.com/towl
>>
>
> I'm sorry, I'm still confused as to which way you want things.
>
> Do you want to redirect /towl -> / or do you want to redirect / - > /towl?
>
> Or does it depend upon the hostname? It would really be better if you
> could settle on one specific beahvior.
>
> -chris
>
> On Mon, May 13, 2024 at 9:41 AM lavanya tech 
>> wrote:
>>
>> Hi Chris,
>>>
>>> Where are you defining the RewriteValve itself?
>>>
>>> Defined rewritevalve here
>>>>>  unpackWARs="true" autoDeploy="true">
>>>
>>>>> className="org.apache.catalina.valves.rewrite.RewriteValve" />
>>>   resource="conf/rewrite.config" />
>>>
>>> 2) reated rewrite.config and added as below under conf/
>>>
>>>   RewriteCond %{REQUEST_URI} ^/towl/(.*)
>>>   RewriteRule ^/towl/(.*) https://example.lbg.com/%1 [R]
>>>
>>> 3) After renaming towl to ROOT -> /webapps/ROOT/WEB-INF/web.xml ( I
>>> already have this mappings /* in web.xml file)
>>>
>>> 
>>>
>>>  Logging Area
>>>  
>>>  Authentication for registered users.
>>>  
>>>  /*
>>>  /api/v1/search 
>>>  /api/v1/suggest/* 
>>>
>>>  
>>>  LDAP_USER
>>>  api
>>>  
>>>  
>>>
>>> 4) Restarted Tomcat, Then I cannot access https://server.lbg.com:8443/to
>>> wl
>>> --> Have below error
>>>
>>> Message java.nio.file.NoSuchFileException:
>>> /git/apache-tomcat-10.1.11/webapps/towl/WEB-INF/lib/xss-1.0.8.jar
>>>
>>> Description The server encountered an unexpected condition that prevented
>>> it from fulfilling the request.
>>>
>>> 5) Also https://example.lbg.com doesnot work anymore
>>>
>>> Before you do anything with redirecting, can you just make sure you are
>>> only deploying ROOT.war and nothing else?
>>>  How can I do that. I already changed towl.war to ROOT.war
>>>
>>> But still both the urls have error as mentioned above.
>>>
>>>
>>> Si I revereted back the changes.
>>> That's weird. Try stopping, deleting the work/ directory and restarting.
>>> --> I have this wierd behavior for some reason, thoudh index.jsp is
>>> located
>>> no changes were made to file. After deleting cookies url works
>>>
>>> where Am I going wrong.
>>>
>>> Thanks,
>>> Lavanya
>>>
>>>
>>> On Fri, May 10, 2024 at 6:50 PM Christopher Schultz <
>>> ch...@christopherschultz.net> wrote:
>>>
>>> Lavanya,

 On 5/10/24 04:37, lavanya tech wrote:

> I tried the below and have the issues.
>
> 1)proxyPort="443" and proxyName="example.lbg.com" to the connector
> 2) remanmed towl.war to ROOT.war
> 3) created rewrite.config and added as below under conf/
>

 Where are you defining the RewriteValve itself?

 RewriteCond %{REQUEST_URI} ^/towl/(.*)
> RewriteRule ^/towl/(.*) https://example.lbg.com/%1 [R]
>

 If this is being handled by the ROOT servlet then I think it's right.

 4) added this in web.xml file of /webapps/towl/web.xml/
>
> 
>   
>
>   
>   
>   
>   Restricted Access to
> /towl
>   /towl/*
>

 No, this is wrong. Since this is the "towl" application and not ROOT,
 you want to map /* and not /towl/* because the application will never
 see the /towl/ as it's an application/context prefix that Tomcat will
 remove.

   
>   
>   
>   
>   
>
> Also I noticed that even if I rename the towl application to ROOT, when
>
 i

> call the url with https://example.lbg.com/towl --> this towl directory
>
 is

> getting created under webapps by default
>

 If webapps/towl is being created, then it's happening for some other
 reason. Do you have anything under conf/Catalina/*/towl.xml which points
 to a WAR file or something? If so, remove that.

 5) Resarted tomcat and I have the below error and all the urls have the
> same issue
>
> Message org.apache.jasper.JasperException:
> java.lang.ClassNotFoundException: org.apache.jsp.index_jsp
>

 That's weird. Try stopping, deleting the work/ directory and restarting.

 

Re: Regarding Tomcat url redirection

2024-05-13 Thread Christopher Schultz

Lavanya,

On 5/13/24 05:57, lavanya tech wrote:

Somehow made it work now i can only access urls as you mentioned before
https://example.lbg.com and https://server.lbg.com with port 8443 and with
out

  https://example.lbg.com/towl and https://server.lbg.com/towl --> I have an
error now File not found.

So i think we need to make work https://example.lbg.com/ to
https://server.lbg.com/towl


I'm sorry, I'm still confused as to which way you want things.

Do you want to redirect /towl -> / or do you want to redirect / - > /towl?

Or does it depend upon the hostname? It would really be better if you 
could settle on one specific beahvior.


-chris


On Mon, May 13, 2024 at 9:41 AM lavanya tech 
wrote:


Hi Chris,

Where are you defining the RewriteValve itself?

Defined rewritevalve here
   

   
  resource="conf/rewrite.config" />

2) reated rewrite.config and added as below under conf/

  RewriteCond %{REQUEST_URI} ^/towl/(.*)
  RewriteRule ^/towl/(.*) https://example.lbg.com/%1 [R]

3) After renaming towl to ROOT -> /webapps/ROOT/WEB-INF/web.xml ( I
already have this mappings /* in web.xml file)


   
 Logging Area
 
 Authentication for registered users.
 
 /*
 /api/v1/search 
 /api/v1/suggest/* 
   
 
 LDAP_USER
 api
 
 

4) Restarted Tomcat, Then I cannot access https://server.lbg.com:8443/towl
--> Have below error

Message java.nio.file.NoSuchFileException:
/git/apache-tomcat-10.1.11/webapps/towl/WEB-INF/lib/xss-1.0.8.jar

Description The server encountered an unexpected condition that prevented
it from fulfilling the request.

5) Also https://example.lbg.com doesnot work anymore

Before you do anything with redirecting, can you just make sure you are
only deploying ROOT.war and nothing else?
 How can I do that. I already changed towl.war to ROOT.war

But still both the urls have error as mentioned above.


Si I revereted back the changes.
That's weird. Try stopping, deleting the work/ directory and restarting.
--> I have this wierd behavior for some reason, thoudh index.jsp is located
no changes were made to file. After deleting cookies url works

where Am I going wrong.

Thanks,
Lavanya


On Fri, May 10, 2024 at 6:50 PM Christopher Schultz <
ch...@christopherschultz.net> wrote:


Lavanya,

On 5/10/24 04:37, lavanya tech wrote:

I tried the below and have the issues.

1)proxyPort="443" and proxyName="example.lbg.com" to the connector
2) remanmed towl.war to ROOT.war
3) created rewrite.config and added as below under conf/


Where are you defining the RewriteValve itself?


RewriteCond %{REQUEST_URI} ^/towl/(.*)
RewriteRule ^/towl/(.*) https://example.lbg.com/%1 [R]


If this is being handled by the ROOT servlet then I think it's right.


4) added this in web.xml file of /webapps/towl/web.xml/


  

  
  
  
  Restricted Access to
/towl
  /towl/*


No, this is wrong. Since this is the "towl" application and not ROOT,
you want to map /* and not /towl/* because the application will never
see the /towl/ as it's an application/context prefix that Tomcat will
remove.


  
  
  
  
  

Also I noticed that even if I rename the towl application to ROOT, when

i

call the url with https://example.lbg.com/towl --> this towl directory

is

getting created under webapps by default


If webapps/towl is being created, then it's happening for some other
reason. Do you have anything under conf/Catalina/*/towl.xml which points
to a WAR file or something? If so, remove that.


5) Resarted tomcat and I have the below error and all the urls have the
same issue

Message org.apache.jasper.JasperException:
java.lang.ClassNotFoundException: org.apache.jsp.index_jsp


That's weird. Try stopping, deleting the work/ directory and restarting.


Description The server encountered an unexpected condition that

prevented

it from fulfilling the request.

Exception

org.apache.jasper.JasperException: org.apache.jasper.JasperException:
java.lang.ClassNotFoundException: org.apache.jsp.index_jsp


org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:578)



org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:422)

org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:380)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:328)
jakarta.servlet.http.HttpServlet.service(HttpServlet.java:658)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)


Before you do anything with redirecting, can you just make sure you are
only deploying ROOT.war and nothing else?

This should allow you to reach the application at both
https://example.lbg.com/ and https://server.lbg.com/ as well as both of
those with port 8443.

Then use the applications and make sure they are working as expected.
Then, we'll add the /towl handling.


Re: Regarding Tomcat url redirection

2024-05-13 Thread lavanya tech
Hi Chris,

Somehow made it work now i can only access urls as you mentioned before
https://example.lbg.com and https://server.lbg.com with port 8443 and with
out

 https://example.lbg.com/towl and https://server.lbg.com/towl --> I have an
error now File not found.

So i think we need to make work https://example.lbg.com/ to
https://server.lbg.com/towl

Thanks,
Lavanya


On Mon, May 13, 2024 at 9:41 AM lavanya tech 
wrote:

> Hi Chris,
>
> Where are you defining the RewriteValve itself?
>
> Defined rewritevalve here
>unpackWARs="true" autoDeploy="true">
>
>className="org.apache.catalina.valves.rewrite.RewriteValve" />
>  resource="conf/rewrite.config" />
>
> 2) reated rewrite.config and added as below under conf/
>
>  RewriteCond %{REQUEST_URI} ^/towl/(.*)
>  RewriteRule ^/towl/(.*) https://example.lbg.com/%1 [R]
>
> 3) After renaming towl to ROOT -> /webapps/ROOT/WEB-INF/web.xml ( I
> already have this mappings /* in web.xml file)
>
>
>   
> Logging Area
> 
> Authentication for registered users.
> 
> /*
> /api/v1/search 
> /api/v1/suggest/* 
>   
> 
> LDAP_USER
> api
> 
> 
>
> 4) Restarted Tomcat, Then I cannot access https://server.lbg.com:8443/towl
> --> Have below error
>
> Message java.nio.file.NoSuchFileException:
> /git/apache-tomcat-10.1.11/webapps/towl/WEB-INF/lib/xss-1.0.8.jar
>
> Description The server encountered an unexpected condition that prevented
> it from fulfilling the request.
>
> 5) Also https://example.lbg.com doesnot work anymore
>
> Before you do anything with redirecting, can you just make sure you are
> only deploying ROOT.war and nothing else?
> How can I do that. I already changed towl.war to ROOT.war
>
> But still both the urls have error as mentioned above.
>
>
> Si I revereted back the changes.
> That's weird. Try stopping, deleting the work/ directory and restarting.
> --> I have this wierd behavior for some reason, thoudh index.jsp is located
> no changes were made to file. After deleting cookies url works
>
> where Am I going wrong.
>
> Thanks,
> Lavanya
>
>
> On Fri, May 10, 2024 at 6:50 PM Christopher Schultz <
> ch...@christopherschultz.net> wrote:
>
>> Lavanya,
>>
>> On 5/10/24 04:37, lavanya tech wrote:
>> > I tried the below and have the issues.
>> >
>> > 1)proxyPort="443" and proxyName="example.lbg.com" to the connector
>> > 2) remanmed towl.war to ROOT.war
>> > 3) created rewrite.config and added as below under conf/
>>
>> Where are you defining the RewriteValve itself?
>>
>> > RewriteCond %{REQUEST_URI} ^/towl/(.*)
>> > RewriteRule ^/towl/(.*) https://example.lbg.com/%1 [R]
>>
>> If this is being handled by the ROOT servlet then I think it's right.
>>
>> > 4) added this in web.xml file of /webapps/towl/web.xml/
>> >
>> >
>> >  
>> >
>> >  
>> >  
>> >  
>> >  Restricted Access to
>> > /towl
>> >  /towl/*
>>
>> No, this is wrong. Since this is the "towl" application and not ROOT,
>> you want to map /* and not /towl/* because the application will never
>> see the /towl/ as it's an application/context prefix that Tomcat will
>> remove.
>>
>> >  
>> >  
>> >  
>> >  
>> >  
>> >
>> > Also I noticed that even if I rename the towl application to ROOT, when
>> i
>> > call the url with https://example.lbg.com/towl --> this towl directory
>> is
>> > getting created under webapps by default
>>
>> If webapps/towl is being created, then it's happening for some other
>> reason. Do you have anything under conf/Catalina/*/towl.xml which points
>> to a WAR file or something? If so, remove that.
>>
>> > 5) Resarted tomcat and I have the below error and all the urls have the
>> > same issue
>> >
>> > Message org.apache.jasper.JasperException:
>> > java.lang.ClassNotFoundException: org.apache.jsp.index_jsp
>>
>> That's weird. Try stopping, deleting the work/ directory and restarting.
>>
>> > Description The server encountered an unexpected condition that
>> prevented
>> > it from fulfilling the request.
>> >
>> > Exception
>> >
>> > org.apache.jasper.JasperException: org.apache.jasper.JasperException:
>> > java.lang.ClassNotFoundException: org.apache.jsp.index_jsp
>> >
>> org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:578)
>> >
>> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:422)
>> > org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:380)
>> > org.apache.jasper.servlet.JspServlet.service(JspServlet.java:328)
>> > jakarta.servlet.http.HttpServlet.service(HttpServlet.java:658)
>> > org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
>>
>> Before you do anything with redirecting, can you just make sure you are
>> only deploying ROOT.war and nothing else?
>>
>> This should allow you to reach the application at both
>> 

Re: Regarding Tomcat url redirection

2024-05-13 Thread lavanya tech
Hi Chris,

Where are you defining the RewriteValve itself?

Defined rewritevalve here
  

  
 resource="conf/rewrite.config" />

2) reated rewrite.config and added as below under conf/

 RewriteCond %{REQUEST_URI} ^/towl/(.*)
 RewriteRule ^/towl/(.*) https://example.lbg.com/%1 [R]

3) After renaming towl to ROOT -> /webapps/ROOT/WEB-INF/web.xml ( I already
have this mappings /* in web.xml file)

   
  
Logging Area

Authentication for registered users.

/*
/api/v1/search 
/api/v1/suggest/* 
  

LDAP_USER
api



4) Restarted Tomcat, Then I cannot access https://server.lbg.com:8443/towl
--> Have below error

Message java.nio.file.NoSuchFileException:
/git/apache-tomcat-10.1.11/webapps/towl/WEB-INF/lib/xss-1.0.8.jar

Description The server encountered an unexpected condition that prevented
it from fulfilling the request.

5) Also https://example.lbg.com doesnot work anymore

Before you do anything with redirecting, can you just make sure you are
only deploying ROOT.war and nothing else?
How can I do that. I already changed towl.war to ROOT.war

But still both the urls have error as mentioned above.


Si I revereted back the changes.
That's weird. Try stopping, deleting the work/ directory and restarting.
--> I have this wierd behavior for some reason, thoudh index.jsp is located
no changes were made to file. After deleting cookies url works

where Am I going wrong.

Thanks,
Lavanya


On Fri, May 10, 2024 at 6:50 PM Christopher Schultz <
ch...@christopherschultz.net> wrote:

> Lavanya,
>
> On 5/10/24 04:37, lavanya tech wrote:
> > I tried the below and have the issues.
> >
> > 1)proxyPort="443" and proxyName="example.lbg.com" to the connector
> > 2) remanmed towl.war to ROOT.war
> > 3) created rewrite.config and added as below under conf/
>
> Where are you defining the RewriteValve itself?
>
> > RewriteCond %{REQUEST_URI} ^/towl/(.*)
> > RewriteRule ^/towl/(.*) https://example.lbg.com/%1 [R]
>
> If this is being handled by the ROOT servlet then I think it's right.
>
> > 4) added this in web.xml file of /webapps/towl/web.xml/
> >
> >
> >  
> >
> >  
> >  
> >  
> >  Restricted Access to
> > /towl
> >  /towl/*
>
> No, this is wrong. Since this is the "towl" application and not ROOT,
> you want to map /* and not /towl/* because the application will never
> see the /towl/ as it's an application/context prefix that Tomcat will
> remove.
>
> >  
> >  
> >  
> >  
> >  
> >
> > Also I noticed that even if I rename the towl application to ROOT, when i
> > call the url with https://example.lbg.com/towl --> this towl directory
> is
> > getting created under webapps by default
>
> If webapps/towl is being created, then it's happening for some other
> reason. Do you have anything under conf/Catalina/*/towl.xml which points
> to a WAR file or something? If so, remove that.
>
> > 5) Resarted tomcat and I have the below error and all the urls have the
> > same issue
> >
> > Message org.apache.jasper.JasperException:
> > java.lang.ClassNotFoundException: org.apache.jsp.index_jsp
>
> That's weird. Try stopping, deleting the work/ directory and restarting.
>
> > Description The server encountered an unexpected condition that prevented
> > it from fulfilling the request.
> >
> > Exception
> >
> > org.apache.jasper.JasperException: org.apache.jasper.JasperException:
> > java.lang.ClassNotFoundException: org.apache.jsp.index_jsp
> >
> org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:578)
> >
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:422)
> > org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:380)
> > org.apache.jasper.servlet.JspServlet.service(JspServlet.java:328)
> > jakarta.servlet.http.HttpServlet.service(HttpServlet.java:658)
> > org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
>
> Before you do anything with redirecting, can you just make sure you are
> only deploying ROOT.war and nothing else?
>
> This should allow you to reach the application at both
> https://example.lbg.com/ and https://server.lbg.com/ as well as both of
> those with port 8443.
>
> Then use the applications and make sure they are working as expected.
> Then, we'll add the /towl handling.
>
> -chris
>
> > On Thu, May 9, 2024 at 11:20 PM Christopher Schultz <
> > ch...@christopherschultz.net> wrote:
> >
> >> Lavanya,
> >>
> >> On 5/9/24 13:48, lavanya tech wrote:
> >>> Thank you so much for your explanation. I will try these options.
> >>>
> >>> Do server and example both resolve to the same IP?
> >>>   -yes
> >>
> >> Good, that significantly reduces the complexity required, since you can
> >> do it will a single process (Tomcat) in a single environment.
> >>
> >>> So I need follow both 4a/b and 5a/b steps here or 

Re: Regarding Tomcat url redirection

2024-05-10 Thread Christopher Schultz

Lavanya,

On 5/10/24 06:03, lavanya tech wrote:

If we create new java.filter as below then we can redirect the urls  ?

import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebFilter("/*")
public class UrlRedirectionFilter implements Filter {

 @Override
 public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain)
 throws IOException, ServletException {
 HttpServletRequest httpRequest = (HttpServletRequest) request;
 HttpServletResponse httpResponse = (HttpServletResponse) response;

 String requestUrl = httpRequest.getRequestURL().toString();

 // Check if the request URL matches the target URL
 if (requestUrl.equals("https://example.lbg.com;)) {
 // Perform redirect to the desired destination URL
 httpResponse.sendRedirect("https://server.lbg.com/towl;);



This is the exact opposite of the stated goal.

You said you wanted server.lbg.com/towl to be redirected to 
example.lbg.com/ but this does the opposite.


I also wouldn't both to check the protocol. Let's save this until after 
the ROOT application is working as expected.


-chris

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Regarding Tomcat url redirection

2024-05-10 Thread Christopher Schultz

Lavanya,

On 5/10/24 04:37, lavanya tech wrote:

I tried the below and have the issues.

1)proxyPort="443" and proxyName="example.lbg.com" to the connector
2) remanmed towl.war to ROOT.war
3) created rewrite.config and added as below under conf/


Where are you defining the RewriteValve itself?


RewriteCond %{REQUEST_URI} ^/towl/(.*)
RewriteRule ^/towl/(.*) https://example.lbg.com/%1 [R]


If this is being handled by the ROOT servlet then I think it's right.


4) added this in web.xml file of /webapps/towl/web.xml/

   
 

 
 
 
 Restricted Access to
/towl
 /towl/*


No, this is wrong. Since this is the "towl" application and not ROOT, 
you want to map /* and not /towl/* because the application will never 
see the /towl/ as it's an application/context prefix that Tomcat will 
remove.



 
 
 
 
 

Also I noticed that even if I rename the towl application to ROOT, when i
call the url with https://example.lbg.com/towl --> this towl directory is
getting created under webapps by default


If webapps/towl is being created, then it's happening for some other 
reason. Do you have anything under conf/Catalina/*/towl.xml which points 
to a WAR file or something? If so, remove that.



5) Resarted tomcat and I have the below error and all the urls have the
same issue

Message org.apache.jasper.JasperException:
java.lang.ClassNotFoundException: org.apache.jsp.index_jsp


That's weird. Try stopping, deleting the work/ directory and restarting.


Description The server encountered an unexpected condition that prevented
it from fulfilling the request.

Exception

org.apache.jasper.JasperException: org.apache.jasper.JasperException:
java.lang.ClassNotFoundException: org.apache.jsp.index_jsp
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:578)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:422)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:380)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:328)
jakarta.servlet.http.HttpServlet.service(HttpServlet.java:658)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)


Before you do anything with redirecting, can you just make sure you are 
only deploying ROOT.war and nothing else?


This should allow you to reach the application at both 
https://example.lbg.com/ and https://server.lbg.com/ as well as both of 
those with port 8443.


Then use the applications and make sure they are working as expected. 
Then, we'll add the /towl handling.


-chris


On Thu, May 9, 2024 at 11:20 PM Christopher Schultz <
ch...@christopherschultz.net> wrote:


Lavanya,

On 5/9/24 13:48, lavanya tech wrote:

Thank you so much for your explanation. I will try these options.

Do server and example both resolve to the same IP?
  -yes


Good, that significantly reduces the complexity required, since you can
do it will a single process (Tomcat) in a single environment.


So I need follow both 4a/b and 5a/b steps here or any of them ?

If I setup exactly by using below steps , then I should access both the
urls right ? https://server.lbg.com:8443/towl and

https://example.lbg.com

If you visit either hostname with /towl, you will be redirected to
example.lbg.com/ with no port number. example:8443 will still work and
no redirect will take place... unless you specifically make arrangements
for that. We can do that later if you really want to.

Let's get the other things working, first.

-chris


On Thursday, May 9, 2024, Christopher Schultz <

ch...@christopherschultz.net>

wrote:


Lavanya,

On 5/9/24 02:58, lavanya tech wrote:


Just giving background again of this topic again.

1) The application team who is working they wanted to access the url
https://server.lbg.com:8443/towl —> which should redirect or point to
https://example.lbg.com

Is that a typo? You want specifically https://server.lbg.com/towl and
https://example.lbg.com/ to point to your application?
 — It’s not the Typo the requirements are still the

same.




Okay.

Do server and example both resolve to the same IP?

2) Hence I added firewall rule to redirect port 443 to 8443. And the url

https://example.lbg.com started working but its pointing to
https://server.lbg.com:8443 indeed and not

https://server.lbg.com:8443/to

wl

But then they wanted the point 1 to have it. If I understood

correctly. So

basically to achieve this we wanted a reverse proxy setup ?

I didnot define any additional host in server.xml file on just left to
default to  local host.



Here's what you have to do in order to support this odd configuration.

1. Configure your firewall to route port 443 -> 8443. I suspect this is
already done.

2. Deploy Tomcat on server.lbg.com with a  on port 8443.

This

is the default, so there shouldn't be anything to do. I suspect this is
already done. You should set proxyPort="443" and proxyName="

Re: Regarding Tomcat url redirection

2024-05-10 Thread lavanya tech
Hi Chris,
If we create new java.filter as below then we can redirect the urls  ?

import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebFilter("/*")
public class UrlRedirectionFilter implements Filter {

@Override
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain)
throws IOException, ServletException {
HttpServletRequest httpRequest = (HttpServletRequest) request;
HttpServletResponse httpResponse = (HttpServletResponse) response;

String requestUrl = httpRequest.getRequestURL().toString();

// Check if the request URL matches the target URL
if (requestUrl.equals("https://example.lbg.com;)) {
// Perform redirect to the desired destination URL
httpResponse.sendRedirect("https://server.lbg.com/towl;);
return;
}

// For all other URLs, disable access
httpResponse.sendError(HttpServletResponse.SC_NOT_FOUND);
}

// Other methods of the Filter interface (init(), destroy()) can be
left empty for this example
}

Thanks,
Lavanya

On Fri, May 10, 2024 at 10:37 AM lavanya tech 
wrote:

> Hi Chris,
>
> I tried the below and have the issues.
>
> 1)proxyPort="443" and proxyName="example.lbg.com" to the connector
> 2) remanmed towl.war to ROOT.war
> 3) created rewrite.config and added as below under conf/
>
> RewriteCond %{REQUEST_URI} ^/towl/(.*)
> RewriteRule ^/towl/(.*) https://example.lbg.com/%1 [R]
>
> 4) added this in web.xml file of /webapps/towl/web.xml/
>
>   
> 
>
> 
> 
> 
> Restricted Access to
> /towl
> /towl/*
> 
> 
> 
> 
> 
>
> Also I noticed that even if I rename the towl application to ROOT, when i
> call the url with https://example.lbg.com/towl --> this towl directory is
> getting created under webapps by default
>
> 5) Resarted tomcat and I have the below error and all the urls have the
> same issue
>
> Message org.apache.jasper.JasperException:
> java.lang.ClassNotFoundException: org.apache.jsp.index_jsp
>
> Description The server encountered an unexpected condition that prevented
> it from fulfilling the request.
>
> Exception
>
> org.apache.jasper.JasperException: org.apache.jasper.JasperException:
> java.lang.ClassNotFoundException: org.apache.jsp.index_jsp
>
> org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:578)
>
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:422)
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:380)
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:328)
> jakarta.servlet.http.HttpServlet.service(HttpServlet.java:658)
> org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
>
> On Thu, May 9, 2024 at 11:20 PM Christopher Schultz <
> ch...@christopherschultz.net> wrote:
>
>> Lavanya,
>>
>> On 5/9/24 13:48, lavanya tech wrote:
>> > Thank you so much for your explanation. I will try these options.
>> >
>> > Do server and example both resolve to the same IP?
>> >  -yes
>>
>> Good, that significantly reduces the complexity required, since you can
>> do it will a single process (Tomcat) in a single environment.
>>
>> > So I need follow both 4a/b and 5a/b steps here or any of them ?
>> >
>> > If I setup exactly by using below steps , then I should access both the
>> > urls right ? https://server.lbg.com:8443/towl and
>> https://example.lbg.com
>>
>> If you visit either hostname with /towl, you will be redirected to
>> example.lbg.com/ with no port number. example:8443 will still work and
>> no redirect will take place... unless you specifically make arrangements
>> for that. We can do that later if you really want to.
>>
>> Let's get the other things working, first.
>>
>> -chris
>>
>> > On Thursday, May 9, 2024, Christopher Schultz <
>> ch...@christopherschultz.net>
>> > wrote:
>> >
>> >> Lavanya,
>> >>
>> >> On 5/9/24 02:58, lavanya tech wrote:
>> >>
>> >>> Just giving background again of this topic again.
>> >>>
>> >>> 1) The application team who is working they wanted to access the url
>> >>> https://server.lbg.com:8443/towl —> which should redirect or point to
>> >>> https://example.lbg.com
>> >>>
>> >>> Is that a typo? You want specifically https://server.lbg.com/towl and
>> >>> https://example.lbg.com/ to point to your application?
>> >>> — It’s not the Typo the requirements are still the
>> same.
>> >>>
>> >>
>> >> Okay.
>> >>
>> >> Do server and example both resolve to the same IP?
>> >>
>> >> 2) Hence I added firewall rule to redirect port 443 to 8443. And the
>> url
>> >>> https://example.lbg.com started working but its pointing to
>> >>> https://server.lbg.com:8443 indeed and not
>> https://server.lbg.com:8443/to
>> >>> wl
>> >>>
>> >>> But then they 

Re: Regarding Tomcat url redirection

2024-05-10 Thread lavanya tech
Hi Chris,

I tried the below and have the issues.

1)proxyPort="443" and proxyName="example.lbg.com" to the connector
2) remanmed towl.war to ROOT.war
3) created rewrite.config and added as below under conf/

RewriteCond %{REQUEST_URI} ^/towl/(.*)
RewriteRule ^/towl/(.*) https://example.lbg.com/%1 [R]

4) added this in web.xml file of /webapps/towl/web.xml/

  





Restricted Access to
/towl
/towl/*






Also I noticed that even if I rename the towl application to ROOT, when i
call the url with https://example.lbg.com/towl --> this towl directory is
getting created under webapps by default

5) Resarted tomcat and I have the below error and all the urls have the
same issue

Message org.apache.jasper.JasperException:
java.lang.ClassNotFoundException: org.apache.jsp.index_jsp

Description The server encountered an unexpected condition that prevented
it from fulfilling the request.

Exception

org.apache.jasper.JasperException: org.apache.jasper.JasperException:
java.lang.ClassNotFoundException: org.apache.jsp.index_jsp
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:578)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:422)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:380)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:328)
jakarta.servlet.http.HttpServlet.service(HttpServlet.java:658)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)

On Thu, May 9, 2024 at 11:20 PM Christopher Schultz <
ch...@christopherschultz.net> wrote:

> Lavanya,
>
> On 5/9/24 13:48, lavanya tech wrote:
> > Thank you so much for your explanation. I will try these options.
> >
> > Do server and example both resolve to the same IP?
> >  -yes
>
> Good, that significantly reduces the complexity required, since you can
> do it will a single process (Tomcat) in a single environment.
>
> > So I need follow both 4a/b and 5a/b steps here or any of them ?
> >
> > If I setup exactly by using below steps , then I should access both the
> > urls right ? https://server.lbg.com:8443/towl and
> https://example.lbg.com
>
> If you visit either hostname with /towl, you will be redirected to
> example.lbg.com/ with no port number. example:8443 will still work and
> no redirect will take place... unless you specifically make arrangements
> for that. We can do that later if you really want to.
>
> Let's get the other things working, first.
>
> -chris
>
> > On Thursday, May 9, 2024, Christopher Schultz <
> ch...@christopherschultz.net>
> > wrote:
> >
> >> Lavanya,
> >>
> >> On 5/9/24 02:58, lavanya tech wrote:
> >>
> >>> Just giving background again of this topic again.
> >>>
> >>> 1) The application team who is working they wanted to access the url
> >>> https://server.lbg.com:8443/towl —> which should redirect or point to
> >>> https://example.lbg.com
> >>>
> >>> Is that a typo? You want specifically https://server.lbg.com/towl and
> >>> https://example.lbg.com/ to point to your application?
> >>> — It’s not the Typo the requirements are still the
> same.
> >>>
> >>
> >> Okay.
> >>
> >> Do server and example both resolve to the same IP?
> >>
> >> 2) Hence I added firewall rule to redirect port 443 to 8443. And the url
> >>> https://example.lbg.com started working but its pointing to
> >>> https://server.lbg.com:8443 indeed and not
> https://server.lbg.com:8443/to
> >>> wl
> >>>
> >>> But then they wanted the point 1 to have it. If I understood
> correctly. So
> >>> basically to achieve this we wanted a reverse proxy setup ?
> >>>
> >>> I didnot define any additional host in server.xml file on just left to
> >>> default to  local host.
> >>>
> >>
> >> Here's what you have to do in order to support this odd configuration.
> >>
> >> 1. Configure your firewall to route port 443 -> 8443. I suspect this is
> >> already done.
> >>
> >> 2. Deploy Tomcat on server.lbg.com with a  on port 8443.
> This
> >> is the default, so there shouldn't be anything to do. I suspect this is
> >> already done. You should set proxyPort="443" and proxyName="
> >> example.lbg.com" in your . This will ensure that any URLs
> >> generated by Tomcat or your application will point to
> >> https://example.lbg.com/ and not to server.lbg.com or have a port
> number
> >> or whatever.
> >>
> >> 3. Re-name your application directory or WAR file from towl -> ROOT
> (upper
> >> case is important). So if you have tomcat/webapps/towl re-name that to
> >> tomcat/webapps/ROOT or if you have tomcat/webapps/towl.war re-name that
> to
> >> tomcat/webapps/ROOT.war.
> >>
> >> The last thing to do is get /towl to re-direct to /. There are a few
> ways
> >> of doing that.
> >>
> >> 4a. Configure your application (now called ROOT and deployed on / and
> not
> >> /towl anymore) to handle the /towl URL and specifically redirect this
> back
> >> to /. This is oddly specific and has 

Re: Regarding Tomcat url redirection

2024-05-09 Thread Christopher Schultz

Lavanya,

On 5/9/24 13:48, lavanya tech wrote:

Thank you so much for your explanation. I will try these options.

Do server and example both resolve to the same IP?
 -yes


Good, that significantly reduces the complexity required, since you can 
do it will a single process (Tomcat) in a single environment.



So I need follow both 4a/b and 5a/b steps here or any of them ?

If I setup exactly by using below steps , then I should access both the
urls right ? https://server.lbg.com:8443/towl and https://example.lbg.com


If you visit either hostname with /towl, you will be redirected to 
example.lbg.com/ with no port number. example:8443 will still work and 
no redirect will take place... unless you specifically make arrangements 
for that. We can do that later if you really want to.


Let's get the other things working, first.

-chris


On Thursday, May 9, 2024, Christopher Schultz 
wrote:


Lavanya,

On 5/9/24 02:58, lavanya tech wrote:


Just giving background again of this topic again.

1) The application team who is working they wanted to access the url
https://server.lbg.com:8443/towl —> which should redirect or point to
https://example.lbg.com

Is that a typo? You want specifically https://server.lbg.com/towl and
https://example.lbg.com/ to point to your application?
— It’s not the Typo the requirements are still the same.



Okay.

Do server and example both resolve to the same IP?

2) Hence I added firewall rule to redirect port 443 to 8443. And the url

https://example.lbg.com started working but its pointing to
https://server.lbg.com:8443 indeed and not https://server.lbg.com:8443/to
wl

But then they wanted the point 1 to have it. If I understood correctly. So
basically to achieve this we wanted a reverse proxy setup ?

I didnot define any additional host in server.xml file on just left to
default to  local host.



Here's what you have to do in order to support this odd configuration.

1. Configure your firewall to route port 443 -> 8443. I suspect this is
already done.

2. Deploy Tomcat on server.lbg.com with a  on port 8443. This
is the default, so there shouldn't be anything to do. I suspect this is
already done. You should set proxyPort="443" and proxyName="
example.lbg.com" in your . This will ensure that any URLs
generated by Tomcat or your application will point to
https://example.lbg.com/ and not to server.lbg.com or have a port number
or whatever.

3. Re-name your application directory or WAR file from towl -> ROOT (upper
case is important). So if you have tomcat/webapps/towl re-name that to
tomcat/webapps/ROOT or if you have tomcat/webapps/towl.war re-name that to
tomcat/webapps/ROOT.war.

The last thing to do is get /towl to re-direct to /. There are a few ways
of doing that.

4a. Configure your application (now called ROOT and deployed on / and not
/towl anymore) to handle the /towl URL and specifically redirect this back
to /. This is oddly specific and has the application trying to redirect to
itself which is weird.

4b. Create a new application called towl or towl.war which will be
deployed on /towl and have THAT redirect to /. I think this is cleaner
because you can call the application anything you'd like and it will still
work. You don't have to match URL patterns yourself, you just re-name the
WAR file if you suddenly want to use /towl2 instead of /towl.

There are several ways to redirect.

5a. Use the rewrite valve and map /(*) to (global redirect) /\1. A few
notes: (1) the (*) means "capture this string" and \1 means "put the string
back. This allows you to redirect /towl/foo/bar to /foo/bar instead of
losing the /foo/bar. This syntax may not be perfect, adapt it to your
needs. (2) Remember that the towl application is deployed on /towl so you
don't want to redirect /towl/foo/bar you only want redirect /foo/bar since
the URL will be relative to the current context (/towl). Got that? Finally,
(3) you need to use a global redirect that does *NOT* redirect back to the
/towl application. Normally, if you redirect to /foo you'll get an
application-relative redirect from something like a rewrite
valve/filter/whatever. Take care to redirect relative to the SERVER and not
to the application.

5b. Write your own servlet to do a specific redirect.

I hope that helps,
-chris

On Wednesday, May 8, 2024, Christopher Schultz <

ch...@christopherschultz.net>
wrote:

Lavanya,


On 5/8/24 06:48, lavanya tech wrote:

I figured out how I can it make it work with 443. Now the URls are

working.
I added iptables route 443 to 8443 and it started working.

nslookup example.lbg.com

Non-authoritative answer:
Name:server.lbg.com
Address:  192.168.200.105
Aliases:  example.lbg.com


I have some application towl running with apache tomcat. I have the
below
URLs working.

https://server.lbg.com:8443/towl
https://server.lbg.com
https://example.lbg.com
https://example.lbg.com/towl


Now i wanted to disable the url https://example.lbg.com/towl and
https://server.lbg.com and 

Re: Regarding Tomcat url redirection

2024-05-09 Thread lavanya tech
Hi Chris,

Thank you so much for your explanation. I will try these options.

Do server and example both resolve to the same IP?
-yes

So I need follow both 4a/b and 5a/b steps here or any of them ?

If I setup exactly by using below steps , then I should access both the
urls right ? https://server.lbg.com:8443/towl and https://example.lbg.com

I will configure and if I face any issues I will write to you.

Thanks,
Lavanya


On Thursday, May 9, 2024, Christopher Schultz 
wrote:

> Lavanya,
>
> On 5/9/24 02:58, lavanya tech wrote:
>
>> Just giving background again of this topic again.
>>
>> 1) The application team who is working they wanted to access the url
>> https://server.lbg.com:8443/towl —> which should redirect or point to
>> https://example.lbg.com
>>
>> Is that a typo? You want specifically https://server.lbg.com/towl and
>> https://example.lbg.com/ to point to your application?
>>— It’s not the Typo the requirements are still the same.
>>
>
> Okay.
>
> Do server and example both resolve to the same IP?
>
> 2) Hence I added firewall rule to redirect port 443 to 8443. And the url
>> https://example.lbg.com started working but its pointing to
>> https://server.lbg.com:8443 indeed and not https://server.lbg.com:8443/to
>> wl
>>
>> But then they wanted the point 1 to have it. If I understood correctly. So
>> basically to achieve this we wanted a reverse proxy setup ?
>>
>> I didnot define any additional host in server.xml file on just left to
>> default to  local host.
>>
>
> Here's what you have to do in order to support this odd configuration.
>
> 1. Configure your firewall to route port 443 -> 8443. I suspect this is
> already done.
>
> 2. Deploy Tomcat on server.lbg.com with a  on port 8443. This
> is the default, so there shouldn't be anything to do. I suspect this is
> already done. You should set proxyPort="443" and proxyName="
> example.lbg.com" in your . This will ensure that any URLs
> generated by Tomcat or your application will point to
> https://example.lbg.com/ and not to server.lbg.com or have a port number
> or whatever.
>
> 3. Re-name your application directory or WAR file from towl -> ROOT (upper
> case is important). So if you have tomcat/webapps/towl re-name that to
> tomcat/webapps/ROOT or if you have tomcat/webapps/towl.war re-name that to
> tomcat/webapps/ROOT.war.
>
> The last thing to do is get /towl to re-direct to /. There are a few ways
> of doing that.
>
> 4a. Configure your application (now called ROOT and deployed on / and not
> /towl anymore) to handle the /towl URL and specifically redirect this back
> to /. This is oddly specific and has the application trying to redirect to
> itself which is weird.
>
> 4b. Create a new application called towl or towl.war which will be
> deployed on /towl and have THAT redirect to /. I think this is cleaner
> because you can call the application anything you'd like and it will still
> work. You don't have to match URL patterns yourself, you just re-name the
> WAR file if you suddenly want to use /towl2 instead of /towl.
>
> There are several ways to redirect.
>
> 5a. Use the rewrite valve and map /(*) to (global redirect) /\1. A few
> notes: (1) the (*) means "capture this string" and \1 means "put the string
> back. This allows you to redirect /towl/foo/bar to /foo/bar instead of
> losing the /foo/bar. This syntax may not be perfect, adapt it to your
> needs. (2) Remember that the towl application is deployed on /towl so you
> don't want to redirect /towl/foo/bar you only want redirect /foo/bar since
> the URL will be relative to the current context (/towl). Got that? Finally,
> (3) you need to use a global redirect that does *NOT* redirect back to the
> /towl application. Normally, if you redirect to /foo you'll get an
> application-relative redirect from something like a rewrite
> valve/filter/whatever. Take care to redirect relative to the SERVER and not
> to the application.
>
> 5b. Write your own servlet to do a specific redirect.
>
> I hope that helps,
> -chris
>
> On Wednesday, May 8, 2024, Christopher Schultz <
>> ch...@christopherschultz.net>
>> wrote:
>>
>> Lavanya,
>>>
>>> On 5/8/24 06:48, lavanya tech wrote:
>>>
>>> I figured out how I can it make it work with 443. Now the URls are
 working.
 I added iptables route 443 to 8443 and it started working.

 nslookup example.lbg.com

 Non-authoritative answer:
 Name:server.lbg.com
 Address:  192.168.200.105
 Aliases:  example.lbg.com


 I have some application towl running with apache tomcat. I have the
 below
 URLs working.

 https://server.lbg.com:8443/towl
 https://server.lbg.com
 https://example.lbg.com
 https://example.lbg.com/towl


 Now i wanted to disable the url https://example.lbg.com/towl and
 https://server.lbg.com and access only the other remaining two.


>>>
>>
>>
>>> I would *highly* recommend that you pick either /towl or / and not try 

Re: Regarding Tomcat url redirection

2024-05-09 Thread Christopher Schultz

Lavanya,

On 5/9/24 02:58, lavanya tech wrote:

Just giving background again of this topic again.

1) The application team who is working they wanted to access the url
https://server.lbg.com:8443/towl —> which should redirect or point to
https://example.lbg.com

Is that a typo? You want specifically https://server.lbg.com/towl and
https://example.lbg.com/ to point to your application?
   — It’s not the Typo the requirements are still the same.


Okay.

Do server and example both resolve to the same IP?


2) Hence I added firewall rule to redirect port 443 to 8443. And the url
https://example.lbg.com started working but its pointing to
https://server.lbg.com:8443 indeed and not https://server.lbg.com:8443/towl

But then they wanted the point 1 to have it. If I understood correctly. So
basically to achieve this we wanted a reverse proxy setup ?

I didnot define any additional host in server.xml file on just left to
default to  local host.


Here's what you have to do in order to support this odd configuration.

1. Configure your firewall to route port 443 -> 8443. I suspect this is 
already done.


2. Deploy Tomcat on server.lbg.com with a  on port 8443. This 
is the default, so there shouldn't be anything to do. I suspect this is 
already done. You should set proxyPort="443" and 
proxyName="example.lbg.com" in your . This will ensure that 
any URLs generated by Tomcat or your application will point to 
https://example.lbg.com/ and not to server.lbg.com or have a port number 
or whatever.


3. Re-name your application directory or WAR file from towl -> ROOT 
(upper case is important). So if you have tomcat/webapps/towl re-name 
that to tomcat/webapps/ROOT or if you have tomcat/webapps/towl.war 
re-name that to tomcat/webapps/ROOT.war.


The last thing to do is get /towl to re-direct to /. There are a few 
ways of doing that.


4a. Configure your application (now called ROOT and deployed on / and 
not /towl anymore) to handle the /towl URL and specifically redirect 
this back to /. This is oddly specific and has the application trying to 
redirect to itself which is weird.


4b. Create a new application called towl or towl.war which will be 
deployed on /towl and have THAT redirect to /. I think this is cleaner 
because you can call the application anything you'd like and it will 
still work. You don't have to match URL patterns yourself, you just 
re-name the WAR file if you suddenly want to use /towl2 instead of /towl.


There are several ways to redirect.

5a. Use the rewrite valve and map /(*) to (global redirect) /\1. A few 
notes: (1) the (*) means "capture this string" and \1 means "put the 
string back. This allows you to redirect /towl/foo/bar to /foo/bar 
instead of losing the /foo/bar. This syntax may not be perfect, adapt it 
to your needs. (2) Remember that the towl application is deployed on 
/towl so you don't want to redirect /towl/foo/bar you only want redirect 
/foo/bar since the URL will be relative to the current context (/towl). 
Got that? Finally, (3) you need to use a global redirect that does *NOT* 
redirect back to the /towl application. Normally, if you redirect to 
/foo you'll get an application-relative redirect from something like a 
rewrite valve/filter/whatever. Take care to redirect relative to the 
SERVER and not to the application.


5b. Write your own servlet to do a specific redirect.

I hope that helps,
-chris


On Wednesday, May 8, 2024, Christopher Schultz 
wrote:


Lavanya,

On 5/8/24 06:48, lavanya tech wrote:


I figured out how I can it make it work with 443. Now the URls are
working.
I added iptables route 443 to 8443 and it started working.

nslookup example.lbg.com

Non-authoritative answer:
Name:server.lbg.com
Address:  192.168.200.105
Aliases:  example.lbg.com


I have some application towl running with apache tomcat. I have the below
URLs working.

https://server.lbg.com:8443/towl
https://server.lbg.com
https://example.lbg.com
https://example.lbg.com/towl


Now i wanted to disable the url https://example.lbg.com/towl and
https://server.lbg.com and access only the other remaining two.








I would *highly* recommend that you pick either /towl or / and not try to
do both, unless you want to deploy the application twice (which is fine,
just deploy towl.war and ROOT.war as copies of each other). If you try to
re-write /towl to / or / to /towl, you'll find you spend the rest of your
days tracking-down edge-cases and "fixing" them -- likely making things
confusing and, probably, worse.

In the end our goal to makesure that the links are not  always dead as soon

as the towl is moved to a new machine. Can you pelase assit me how to do
that?



The goal should be that "moving" the application only means changing DNS
and everything else works as expected.

If you:

1. Deploy the application with a single context (e.g. /towl, which I
recommend)

2. Re-direct / to /towl (this requires a reverse-proxy or a ROOT
application that does nothing but 

Re: Regarding Tomcat url redirection

2024-05-09 Thread lavanya tech
Hi Chris,

Thanks.

Just giving background again of this topic again.

1) The application team who is working they wanted to access the url
https://server.lbg.com:8443/towl —> which should redirect or point to
https://example.lbg.com

Is that a typo? You want specifically https://server.lbg.com/towl and
https://example.lbg.com/ to point to your application?
  — It’s not the Typo the requirements are still the same.

2) Hence I added firewall rule to redirect port 443 to 8443. And the url
https://example.lbg.com started working but its pointing to
https://server.lbg.com:8443 indeed and not https://server.lbg.com:8443/towl

But then they wanted the point 1 to have it. If I understood correctly. So
basically to achieve this we wanted a reverse proxy setup ?

I didnot define any additional host in server.xml file on just left to
default to  local host.



Thanks,
Lavanya



On Wednesday, May 8, 2024, Christopher Schultz 
wrote:

> Lavanya,
>
> On 5/8/24 06:48, lavanya tech wrote:
>
>> I figured out how I can it make it work with 443. Now the URls are
>> working.
>> I added iptables route 443 to 8443 and it started working.
>>
>> nslookup example.lbg.com
>>
>> Non-authoritative answer:
>> Name:server.lbg.com
>> Address:  192.168.200.105
>> Aliases:  example.lbg.com
>>
>>
>> I have some application towl running with apache tomcat. I have the below
>> URLs working.
>>
>> https://server.lbg.com:8443/towl
>> https://server.lbg.com
>> https://example.lbg.com
>> https://example.lbg.com/towl
>>
>>
>> Now i wanted to disable the url https://example.lbg.com/towl and
>> https://server.lbg.com and access only the other remaining two.
>>
>


>
> I would *highly* recommend that you pick either /towl or / and not try to
> do both, unless you want to deploy the application twice (which is fine,
> just deploy towl.war and ROOT.war as copies of each other). If you try to
> re-write /towl to / or / to /towl, you'll find you spend the rest of your
> days tracking-down edge-cases and "fixing" them -- likely making things
> confusing and, probably, worse.
>
> In the end our goal to makesure that the links are not  always dead as soon
>> as the towl is moved to a new machine. Can you pelase assit me how to do
>> that?
>>
>
> The goal should be that "moving" the application only means changing DNS
> and everything else works as expected.
>
> If you:
>
> 1. Deploy the application with a single context (e.g. /towl, which I
> recommend)
>
> 2. Re-direct / to /towl (this requires a reverse-proxy or a ROOT
> application that does nothing but redirect ; my personal preference)
>
> 3. Do not define any  other than "localhost" and make it the
> default. Do not bother with any  elements since they are not
> necessary.
>
> Moving the application should only require that you:
>
> 4. Deploy the same application with the same configuration in the new
> location
>
> 5. Change DNS to point example.lbg.com and server.lbg.com to the new
> location of the service
>
> Hope that helps,
> -chris
>
> On Tue, Apr 30, 2024 at 5:44 PM Christopher Schultz <
> ch...@christopherschultz.net> wrote:
>
> Lavanya,
>
> On 4/30/24 07:10, lavanya tech wrote:
>
> Can you tell me how to do the below ? How should I setup Tomcat in
> server.xml ?
>
>
> If you want to use port 443 (the default port for HTTPS) then you will
> need to change Tomcat to bind to port 443 (if that's allowed on your OS)
> or arrange to have port 443 routed to port 8443. You may need additional
> configuration in Tomcat (specifically: proxyPort) to avoid having Tomcat
> generate URLs with ":8443" in them.
>
> Looking forward to your reply.
>
>
> If Tomcat is listening on port 8443 then you will need to include that
> in your URL, period. If you want to allow URLs without a port number,
> you will have to arrange to have something listening on port 443.
>
> On Windows, Tomcat can listen directly on port 443. On UNIX and
> UNIX-like systems, you won't be able to do this without running Tomcat
> as root WHICH YOU ABSOLUTELY SHOULD NOT DO.
>
> There are other ways to get port 443 working, but I'll need to know more
> about your environment. The port issue is "easier" than figuring out
> whatever is going on with your DNS, aliases, etc. so I would recommend
> we fix one thing at a time.
>
> -chris
>
> On Mon, Apr 29, 2024 at 2:03 PM lavanya tech 
> wrote:
>
> Hi Chris,
>
> There is no issues with browser, because I tested with different
>
> browsers
>
> and it all works fine. I am sure that there is no issue with the
> certificate.
>Because I was able to establish successful connections with port
>
> 8443, it
>
> just doesnot work with out port
>
>curl  https://example.lbg.com/towl
> curl: (56) Received HTTP code 504 from proxy after CONNECT
> curl: (56) Received HTTP code 504 from proxy after CONNECT
>
>
> If you want to use port 443 (the default port for HTTPS) then you will
> need to change Tomcat to bind to port 443 (if that's allowed on your OS)
> or arrange to have port 

Re: Regarding Tomcat url redirection

2024-05-08 Thread Christopher Schultz

Lavanya,

On 5/8/24 06:48, lavanya tech wrote:

I figured out how I can it make it work with 443. Now the URls are working.
I added iptables route 443 to 8443 and it started working.

nslookup example.lbg.com

Non-authoritative answer:
Name:server.lbg.com
Address:  192.168.200.105
Aliases:  example.lbg.com


I have some application towl running with apache tomcat. I have the below
URLs working.

https://server.lbg.com:8443/towl
https://server.lbg.com
https://example.lbg.com
https://example.lbg.com/towl


Now i wanted to disable the url https://example.lbg.com/towl and
https://server.lbg.com and access only the other remaining two.


Is that a typo? You want specifically https://server.lbg.com/towl and 
https://example.lbg.com/ to point to your application?


I would *highly* recommend that you pick either /towl or / and not try 
to do both, unless you want to deploy the application twice (which is 
fine, just deploy towl.war and ROOT.war as copies of each other). If you 
try to re-write /towl to / or / to /towl, you'll find you spend the rest 
of your days tracking-down edge-cases and "fixing" them -- likely making 
things confusing and, probably, worse.



In the end our goal to makesure that the links are not  always dead as soon
as the towl is moved to a new machine. Can you pelase assit me how to do
that?


The goal should be that "moving" the application only means changing DNS 
and everything else works as expected.


If you:

1. Deploy the application with a single context (e.g. /towl, which I 
recommend)


2. Re-direct / to /towl (this requires a reverse-proxy or a ROOT 
application that does nothing but redirect ; my personal preference)


3. Do not define any  other than "localhost" and make it the 
default. Do not bother with any  elements since they are not 
necessary.


Moving the application should only require that you:

4. Deploy the same application with the same configuration in the new 
location


5. Change DNS to point example.lbg.com and server.lbg.com to the new 
location of the service


Hope that helps,
-chris


On Tue, Apr 30, 2024 at 5:44 PM Christopher Schultz <
ch...@christopherschultz.net> wrote:


Lavanya,

On 4/30/24 07:10, lavanya tech wrote:

Can you tell me how to do the below ? How should I setup Tomcat in
server.xml ?


If you want to use port 443 (the default port for HTTPS) then you will
need to change Tomcat to bind to port 443 (if that's allowed on your OS)
or arrange to have port 443 routed to port 8443. You may need additional
configuration in Tomcat (specifically: proxyPort) to avoid having Tomcat
generate URLs with ":8443" in them.

Looking forward to your reply.


If Tomcat is listening on port 8443 then you will need to include that
in your URL, period. If you want to allow URLs without a port number,
you will have to arrange to have something listening on port 443.

On Windows, Tomcat can listen directly on port 443. On UNIX and
UNIX-like systems, you won't be able to do this without running Tomcat
as root WHICH YOU ABSOLUTELY SHOULD NOT DO.

There are other ways to get port 443 working, but I'll need to know more
about your environment. The port issue is "easier" than figuring out
whatever is going on with your DNS, aliases, etc. so I would recommend
we fix one thing at a time.

-chris


On Mon, Apr 29, 2024 at 2:03 PM lavanya tech 
wrote:


Hi Chris,

There is no issues with browser, because I tested with different

browsers

and it all works fine. I am sure that there is no issue with the
certificate.
   Because I was able to establish successful connections with port

8443, it

just doesnot work with out port

   curl  https://example.lbg.com/towl
curl: (56) Received HTTP code 504 from proxy after CONNECT
curl: (56) Received HTTP code 504 from proxy after CONNECT


If you want to use port 443 (the default port for HTTPS) then you will
need to change Tomcat to bind to port 443 (if that's allowed on your OS)
or arrange to have port 443 routed to port 8443. You may need additional
configuration in Tomcat (specifically: proxyPort) to avoid having Tomcat
generate URLs with ":8443" in them.



should i use connect port like the above ?  But you mentioned before we
dont need any configuration changes. Please clarify I am not able to

figure

this out and I have this issue many days pending. How to make it work

with

port 8443 and with out port

Also I wanted to use weburl with alias name permanently instead of the
hostname. How can I achieve both

Thanks,
Lavanya


-->


On Fri, Apr 26, 2024 at 9:28 PM Christopher Schultz <
ch...@christopherschultz.net> wrote:


Lavanya,

On 4/25/24 07:24, lavanya tech wrote:

Hi Chris,

One question / doubt:

As I mentioned earlier, the below URLS already working in the browser

https://server.lbg.com:8443/towl
https://example.lbg.com:8443/towl -> redirect ( which means when I

hit in

browser) it points to https://server.lbg.com:8443/towl ---> To be

frank,

even I donot need redirect here, not sure why it redirects.

Re: Regarding Tomcat url redirection

2024-05-08 Thread lavanya tech
Hello Chris,

I figured out how I can it make it work with 443. Now the URls are working.
I added iptables route 443 to 8443 and it started working.

nslookup example.lbg.com

Non-authoritative answer:
Name:server.lbg.com
Address:  192.168.200.105
Aliases:  example.lbg.com


I have some application towl running with apache tomcat. I have the below
URLs working.

https://server.lbg.com:8443/towl
https://server.lbg.com
https://example.lbg.com
https://example.lbg.com/towl


Now i wanted to disable the url https://example.lbg.com/towl and
https://server.lbg.com and access only the other remaining two.

In the end our goal to makesure that the links are not  always dead as soon
as the towl is moved to a new machine. Can you pelase assit me how to do
that ?

Thanks,
Lavanya

On Tue, Apr 30, 2024 at 5:44 PM Christopher Schultz <
ch...@christopherschultz.net> wrote:

> Lavanya,
>
> On 4/30/24 07:10, lavanya tech wrote:
> > Can you tell me how to do the below ? How should I setup Tomcat in
> > server.xml ?
> >
> >
> > If you want to use port 443 (the default port for HTTPS) then you will
> > need to change Tomcat to bind to port 443 (if that's allowed on your OS)
> > or arrange to have port 443 routed to port 8443. You may need additional
> > configuration in Tomcat (specifically: proxyPort) to avoid having Tomcat
> > generate URLs with ":8443" in them.
> >
> > Looking forward to your reply.
>
> If Tomcat is listening on port 8443 then you will need to include that
> in your URL, period. If you want to allow URLs without a port number,
> you will have to arrange to have something listening on port 443.
>
> On Windows, Tomcat can listen directly on port 443. On UNIX and
> UNIX-like systems, you won't be able to do this without running Tomcat
> as root WHICH YOU ABSOLUTELY SHOULD NOT DO.
>
> There are other ways to get port 443 working, but I'll need to know more
> about your environment. The port issue is "easier" than figuring out
> whatever is going on with your DNS, aliases, etc. so I would recommend
> we fix one thing at a time.
>
> -chris
>
> > On Mon, Apr 29, 2024 at 2:03 PM lavanya tech 
> > wrote:
> >
> >> Hi Chris,
> >>
> >> There is no issues with browser, because I tested with different
> browsers
> >> and it all works fine. I am sure that there is no issue with the
> >> certificate.
> >>   Because I was able to establish successful connections with port
> 8443, it
> >> just doesnot work with out port
> >>
> >>   curl  https://example.lbg.com/towl
> >> curl: (56) Received HTTP code 504 from proxy after CONNECT
> >> curl: (56) Received HTTP code 504 from proxy after CONNECT
> >>
> >>
> >> If you want to use port 443 (the default port for HTTPS) then you will
> >> need to change Tomcat to bind to port 443 (if that's allowed on your OS)
> >> or arrange to have port 443 routed to port 8443. You may need additional
> >> configuration in Tomcat (specifically: proxyPort) to avoid having Tomcat
> >> generate URLs with ":8443" in them.
> >>
> >>  >> connectionTimeout="2"
> >> redirectPort="8443"
> >> maxThreads="150"
> >> scheme="https" secure="true" SSLEnabled="true"
> >> keystoreFile="path_to_your_keystore_file"
> >> keystorePass="your_keystore_password"
> >> keystoreType="PKCS12"
> >> clientAuth="false" sslProtocol="TLS"
> >> proxyPort="443"/>
> >>
> >> should i use connect port like the above ?  But you mentioned before we
> >> dont need any configuration changes. Please clarify I am not able to
> figure
> >> this out and I have this issue many days pending. How to make it work
> with
> >> port 8443 and with out port
> >>
> >> Also I wanted to use weburl with alias name permanently instead of the
> >> hostname. How can I achieve both
> >>
> >> Thanks,
> >> Lavanya
> >>
> >>
> >>-->
> >>
> >>
> >> On Fri, Apr 26, 2024 at 9:28 PM Christopher Schultz <
> >> ch...@christopherschultz.net> wrote:
> >>
> >>> Lavanya,
> >>>
> >>> On 4/25/24 07:24, lavanya tech wrote:
>  Hi Chris,
> 
>  One question / doubt:
> 
>  As I mentioned earlier, the below URLS already working in the browser
> > https://server.lbg.com:8443/towl
> > https://example.lbg.com:8443/towl -> redirect ( which means when I
> >>> hit in
>  browser) it points to https://server.lbg.com:8443/towl ---> To be
> >>> frank,
>  even I donot need redirect here, not sure why it redirects.
> 
>  My question is why its working even though SAN is not registered with
> >>> the
>  certificate ? It doesnot even throw warning in the browser.
> >>>
> >>> I'm not sure. Is it possible you have dismissed this error in the past
> >>> and the browser is remembering that? Try this with a different web
> >>> browser or maybe with curl from the command-line to see what happens.
> >>>
>  Why https://server.lbg.com/towl or https://example.lbg.com/towl -->
> >>> How it
>  should work with New SAN certificate 

Re: Regarding Tomcat url redirection

2024-04-30 Thread Christopher Schultz

Lavanya,

On 4/30/24 07:10, lavanya tech wrote:

Can you tell me how to do the below ? How should I setup Tomcat in
server.xml ?


If you want to use port 443 (the default port for HTTPS) then you will
need to change Tomcat to bind to port 443 (if that's allowed on your OS)
or arrange to have port 443 routed to port 8443. You may need additional
configuration in Tomcat (specifically: proxyPort) to avoid having Tomcat
generate URLs with ":8443" in them.

Looking forward to your reply.


If Tomcat is listening on port 8443 then you will need to include that 
in your URL, period. If you want to allow URLs without a port number, 
you will have to arrange to have something listening on port 443.


On Windows, Tomcat can listen directly on port 443. On UNIX and 
UNIX-like systems, you won't be able to do this without running Tomcat 
as root WHICH YOU ABSOLUTELY SHOULD NOT DO.


There are other ways to get port 443 working, but I'll need to know more 
about your environment. The port issue is "easier" than figuring out 
whatever is going on with your DNS, aliases, etc. so I would recommend 
we fix one thing at a time.


-chris


On Mon, Apr 29, 2024 at 2:03 PM lavanya tech 
wrote:


Hi Chris,

There is no issues with browser, because I tested with different browsers
and it all works fine. I am sure that there is no issue with the
certificate.
  Because I was able to establish successful connections with port 8443, it
just doesnot work with out port

  curl  https://example.lbg.com/towl
curl: (56) Received HTTP code 504 from proxy after CONNECT
curl: (56) Received HTTP code 504 from proxy after CONNECT


If you want to use port 443 (the default port for HTTPS) then you will
need to change Tomcat to bind to port 443 (if that's allowed on your OS)
or arrange to have port 443 routed to port 8443. You may need additional
configuration in Tomcat (specifically: proxyPort) to avoid having Tomcat
generate URLs with ":8443" in them.



should i use connect port like the above ?  But you mentioned before we
dont need any configuration changes. Please clarify I am not able to figure
this out and I have this issue many days pending. How to make it work with
port 8443 and with out port

Also I wanted to use weburl with alias name permanently instead of the
hostname. How can I achieve both

Thanks,
Lavanya


   -->


On Fri, Apr 26, 2024 at 9:28 PM Christopher Schultz <
ch...@christopherschultz.net> wrote:


Lavanya,

On 4/25/24 07:24, lavanya tech wrote:

Hi Chris,

One question / doubt:

As I mentioned earlier, the below URLS already working in the browser

https://server.lbg.com:8443/towl
https://example.lbg.com:8443/towl -> redirect ( which means when I

hit in

browser) it points to https://server.lbg.com:8443/towl ---> To be

frank,

even I donot need redirect here, not sure why it redirects.

My question is why its working even though SAN is not registered with

the

certificate ? It doesnot even throw warning in the browser.


I'm not sure. Is it possible you have dismissed this error in the past
and the browser is remembering that? Try this with a different web
browser or maybe with curl from the command-line to see what happens.


Why https://server.lbg.com/towl or https://example.lbg.com/towl -->

How it

should work with New SAN certificate ?


You don't need to worry about the port number or application name, only
the hostname is a part of the SAN.

-chris


On Thu, Apr 25, 2024 at 10:16 AM lavanya tech 
Hi Chris,


Thanks I will request new certificate with SANs and I will try to fix

the

things from our end.

Best Regards,
Lavanya

On Wed, Apr 24, 2024 at 11:12 PM Christopher Schultz <
ch...@christopherschultz.net> wrote:


Lavanya,

On 4/24/24 15:39, lavanya tech wrote:

Local host means the machine i am logged in to server.lbg.com

You are right, example.lbg.com is CNAME record.


Okay, thanks for clearing that up.


I dont have any SAN configured for the certificate. The certificate

is

requested for only server.lbg.com


You will never be able to make a secure request to anything other than
server.lbg.com without seeing an error. I highly recommend adding the
other hostname as a SAN to your certificate if you really want to
support this.

Even if you wanted https://example.lbg.com/whatever to return an HTTP
302 redirect to https://server.lbg.com/whatever, the user would see a
certificate hostname mismatch error which is ugly. It's best to make

it

work without users seeing ugly things.


So if i just request new certificate with SAN it should work ? If

yes, I

will request for it and follow your steps as below suggested.


Yes, it should.


Should i use CName record or DNS? Does it make difference?


CNAME *is* DNS.

Whenever possible, use hostnames and not IP addresses as SANs. It's

more

flexible that way, and users get to see hostnames instead of IP

addresses.


-chris


On Wednesday, April 24, 2024, Christopher Schultz <
ch...@christopherschultz.net> wrote:


Lavanya,

On 4/24/24 07:37, lavanya 

Re: Regarding Tomcat url redirection

2024-04-30 Thread lavanya tech
Hi Chris,

Can you tell me how to do the below ? How should I setup Tomcat in
server.xml ?


If you want to use port 443 (the default port for HTTPS) then you will
need to change Tomcat to bind to port 443 (if that's allowed on your OS)
or arrange to have port 443 routed to port 8443. You may need additional
configuration in Tomcat (specifically: proxyPort) to avoid having Tomcat
generate URLs with ":8443" in them.

Looking forward to your reply.

Thanks,
Lavanya

On Mon, Apr 29, 2024 at 2:03 PM lavanya tech 
wrote:

> Hi Chris,
>
> There is no issues with browser, because I tested with different browsers
> and it all works fine. I am sure that there is no issue with the
> certificate.
>  Because I was able to establish successful connections with port 8443, it
> just doesnot work with out port
>
>  curl  https://example.lbg.com/towl
> curl: (56) Received HTTP code 504 from proxy after CONNECT
> curl: (56) Received HTTP code 504 from proxy after CONNECT
>
>
> If you want to use port 443 (the default port for HTTPS) then you will
> need to change Tomcat to bind to port 443 (if that's allowed on your OS)
> or arrange to have port 443 routed to port 8443. You may need additional
> configuration in Tomcat (specifically: proxyPort) to avoid having Tomcat
> generate URLs with ":8443" in them.
>
> connectionTimeout="2"
>redirectPort="8443"
>maxThreads="150"
>scheme="https" secure="true" SSLEnabled="true"
>keystoreFile="path_to_your_keystore_file"
>keystorePass="your_keystore_password"
>keystoreType="PKCS12"
>clientAuth="false" sslProtocol="TLS"
>proxyPort="443"/>
>
> should i use connect port like the above ?  But you mentioned before we
> dont need any configuration changes. Please clarify I am not able to figure
> this out and I have this issue many days pending. How to make it work with
> port 8443 and with out port
>
> Also I wanted to use weburl with alias name permanently instead of the
> hostname. How can I achieve both
>
> Thanks,
> Lavanya
>
>
>   -->
>
>
> On Fri, Apr 26, 2024 at 9:28 PM Christopher Schultz <
> ch...@christopherschultz.net> wrote:
>
>> Lavanya,
>>
>> On 4/25/24 07:24, lavanya tech wrote:
>> > Hi Chris,
>> >
>> > One question / doubt:
>> >
>> > As I mentioned earlier, the below URLS already working in the browser
>> >> https://server.lbg.com:8443/towl
>> >> https://example.lbg.com:8443/towl -> redirect ( which means when I
>> hit in
>> > browser) it points to https://server.lbg.com:8443/towl ---> To be
>> frank,
>> > even I donot need redirect here, not sure why it redirects.
>> >
>> > My question is why its working even though SAN is not registered with
>> the
>> > certificate ? It doesnot even throw warning in the browser.
>>
>> I'm not sure. Is it possible you have dismissed this error in the past
>> and the browser is remembering that? Try this with a different web
>> browser or maybe with curl from the command-line to see what happens.
>>
>> > Why https://server.lbg.com/towl or https://example.lbg.com/towl -->
>> How it
>> > should work with New SAN certificate ?
>>
>> You don't need to worry about the port number or application name, only
>> the hostname is a part of the SAN.
>>
>> -chris
>>
>> > On Thu, Apr 25, 2024 at 10:16 AM lavanya tech > >
>> > wrote:
>> >
>> >> Hi Chris,
>> >>
>> >>
>> >> Thanks I will request new certificate with SANs and I will try to fix
>> the
>> >> things from our end.
>> >>
>> >> Best Regards,
>> >> Lavanya
>> >>
>> >> On Wed, Apr 24, 2024 at 11:12 PM Christopher Schultz <
>> >> ch...@christopherschultz.net> wrote:
>> >>
>> >>> Lavanya,
>> >>>
>> >>> On 4/24/24 15:39, lavanya tech wrote:
>>  Local host means the machine i am logged in to server.lbg.com
>> 
>>  You are right, example.lbg.com is CNAME record.
>> >>>
>> >>> Okay, thanks for clearing that up.
>> >>>
>>  I dont have any SAN configured for the certificate. The certificate
>> is
>>  requested for only server.lbg.com
>> >>>
>> >>> You will never be able to make a secure request to anything other than
>> >>> server.lbg.com without seeing an error. I highly recommend adding the
>> >>> other hostname as a SAN to your certificate if you really want to
>> >>> support this.
>> >>>
>> >>> Even if you wanted https://example.lbg.com/whatever to return an HTTP
>> >>> 302 redirect to https://server.lbg.com/whatever, the user would see a
>> >>> certificate hostname mismatch error which is ugly. It's best to make
>> it
>> >>> work without users seeing ugly things.
>> >>>
>>  So if i just request new certificate with SAN it should work ? If
>> yes, I
>>  will request for it and follow your steps as below suggested.
>> >>>
>> >>> Yes, it should.
>> >>>
>>  Should i use CName record or DNS? Does it make difference?
>> >>>
>> >>> CNAME *is* DNS.
>> >>>
>> >>> Whenever possible, use hostnames and not IP addresses as SANs. It's
>> more
>> >>> flexible that way, and 

Re: Regarding Tomcat url redirection

2024-04-29 Thread lavanya tech
Hi Chris,

There is no issues with browser, because I tested with different browsers
and it all works fine. I am sure that there is no issue with the
certificate.
 Because I was able to establish successful connections with port 8443, it
just doesnot work with out port

 curl  https://example.lbg.com/towl
curl: (56) Received HTTP code 504 from proxy after CONNECT
curl: (56) Received HTTP code 504 from proxy after CONNECT


If you want to use port 443 (the default port for HTTPS) then you will
need to change Tomcat to bind to port 443 (if that's allowed on your OS)
or arrange to have port 443 routed to port 8443. You may need additional
configuration in Tomcat (specifically: proxyPort) to avoid having Tomcat
generate URLs with ":8443" in them.



should i use connect port like the above ?  But you mentioned before we
dont need any configuration changes. Please clarify I am not able to figure
this out and I have this issue many days pending. How to make it work with
port 8443 and with out port

Also I wanted to use weburl with alias name permanently instead of the
hostname. How can I achieve both

Thanks,
Lavanya


  -->


On Fri, Apr 26, 2024 at 9:28 PM Christopher Schultz <
ch...@christopherschultz.net> wrote:

> Lavanya,
>
> On 4/25/24 07:24, lavanya tech wrote:
> > Hi Chris,
> >
> > One question / doubt:
> >
> > As I mentioned earlier, the below URLS already working in the browser
> >> https://server.lbg.com:8443/towl
> >> https://example.lbg.com:8443/towl -> redirect ( which means when I hit
> in
> > browser) it points to https://server.lbg.com:8443/towl ---> To be frank,
> > even I donot need redirect here, not sure why it redirects.
> >
> > My question is why its working even though SAN is not registered with the
> > certificate ? It doesnot even throw warning in the browser.
>
> I'm not sure. Is it possible you have dismissed this error in the past
> and the browser is remembering that? Try this with a different web
> browser or maybe with curl from the command-line to see what happens.
>
> > Why https://server.lbg.com/towl or https://example.lbg.com/towl --> How
> it
> > should work with New SAN certificate ?
>
> You don't need to worry about the port number or application name, only
> the hostname is a part of the SAN.
>
> -chris
>
> > On Thu, Apr 25, 2024 at 10:16 AM lavanya tech 
> > wrote:
> >
> >> Hi Chris,
> >>
> >>
> >> Thanks I will request new certificate with SANs and I will try to fix
> the
> >> things from our end.
> >>
> >> Best Regards,
> >> Lavanya
> >>
> >> On Wed, Apr 24, 2024 at 11:12 PM Christopher Schultz <
> >> ch...@christopherschultz.net> wrote:
> >>
> >>> Lavanya,
> >>>
> >>> On 4/24/24 15:39, lavanya tech wrote:
>  Local host means the machine i am logged in to server.lbg.com
> 
>  You are right, example.lbg.com is CNAME record.
> >>>
> >>> Okay, thanks for clearing that up.
> >>>
>  I dont have any SAN configured for the certificate. The certificate is
>  requested for only server.lbg.com
> >>>
> >>> You will never be able to make a secure request to anything other than
> >>> server.lbg.com without seeing an error. I highly recommend adding the
> >>> other hostname as a SAN to your certificate if you really want to
> >>> support this.
> >>>
> >>> Even if you wanted https://example.lbg.com/whatever to return an HTTP
> >>> 302 redirect to https://server.lbg.com/whatever, the user would see a
> >>> certificate hostname mismatch error which is ugly. It's best to make it
> >>> work without users seeing ugly things.
> >>>
>  So if i just request new certificate with SAN it should work ? If
> yes, I
>  will request for it and follow your steps as below suggested.
> >>>
> >>> Yes, it should.
> >>>
>  Should i use CName record or DNS? Does it make difference?
> >>>
> >>> CNAME *is* DNS.
> >>>
> >>> Whenever possible, use hostnames and not IP addresses as SANs. It's
> more
> >>> flexible that way, and users get to see hostnames instead of IP
> addresses.
> >>>
> >>> -chris
> >>>
>  On Wednesday, April 24, 2024, Christopher Schultz <
>  ch...@christopherschultz.net> wrote:
> 
> > Lavanya,
> >
> > On 4/24/24 07:37, lavanya tech wrote:
> >
> >> Sorry I understood wrongly here with regards to my environment, Let
> me
> >> start from the beginning. I donot want to use redirect at all. I
> >>> simply
> >> wanted to force apache tomcat to use both localhost and dns name of
> >>> the
> >> localhost via url.
> >>
> >
> > When you say "force" what do you mean?
> >
> > When you say "use both localhost and DNS name" what do you mean?
> >
> > When you say "localhost" do you mean 127.0.0.1 or "the machine I'm
> > logged-into right now"?
> >
> > I have DNS resollution as below.
> >>
> >> server.lbg.com --> localhost
> >>
> >
> > Is that a CNAME record?
> >
> > nslookup server.lbg.com (localhost)
> >> Name:server.lbg.com
> >> Address:  

Re: Regarding Tomcat url redirection

2024-04-26 Thread Christopher Schultz

Lavanya,

On 4/25/24 09:36, lavanya tech wrote:

I have updated the certificate now, but still I cannot access url
https://example.lbg.com/towl  either https://server.lbg.com/towl ?

I wonder why its working with port 8443 and not with out port


If Tomcat is listening to port 8443, then you need to use port 8443 to 
make a request. The cert doesn't cover port number, so you can still use it.


If you want to use port 443 (the default port for HTTPS) then you will 
need to change Tomcat to bind to port 443 (if that's allowed on your OS) 
or arrange to have port 443 routed to port 8443. You may need additional 
configuration in Tomcat (specifically: proxyPort) to avoid having Tomcat 
generate URLs with ":8443" in them.


-chris


On Thu, Apr 25, 2024 at 1:24 PM lavanya tech 
wrote:


Hi Chris,

One question / doubt:

As I mentioned earlier, the below URLS already working in the browser

https://server.lbg.com:8443/towl
https://example.lbg.com:8443/towl -> redirect ( which means when I hit

in browser) it points to https://server.lbg.com:8443/towl ---> To be
frank, even I donot need redirect here, not sure why it redirects.

My question is why its working even though SAN is not registered with the
certificate ? It doesnot even throw warning in the browser.

Why https://server.lbg.com/towl or https://example.lbg.com/towl --> How
it should work with New SAN certificate ?

Thanks,
Lavanya



On Thu, Apr 25, 2024 at 10:16 AM lavanya tech 
wrote:


Hi Chris,


Thanks I will request new certificate with SANs and I will try to fix the
things from our end.

Best Regards,
Lavanya

On Wed, Apr 24, 2024 at 11:12 PM Christopher Schultz <
ch...@christopherschultz.net> wrote:


Lavanya,

On 4/24/24 15:39, lavanya tech wrote:

Local host means the machine i am logged in to server.lbg.com

You are right, example.lbg.com is CNAME record.


Okay, thanks for clearing that up.


I dont have any SAN configured for the certificate. The certificate is
requested for only server.lbg.com


You will never be able to make a secure request to anything other than
server.lbg.com without seeing an error. I highly recommend adding the
other hostname as a SAN to your certificate if you really want to
support this.

Even if you wanted https://example.lbg.com/whatever to return an HTTP
302 redirect to https://server.lbg.com/whatever, the user would see a
certificate hostname mismatch error which is ugly. It's best to make it
work without users seeing ugly things.


So if i just request new certificate with SAN it should work ? If yes,

I

will request for it and follow your steps as below suggested.


Yes, it should.


Should i use CName record or DNS? Does it make difference?


CNAME *is* DNS.

Whenever possible, use hostnames and not IP addresses as SANs. It's more
flexible that way, and users get to see hostnames instead of IP
addresses.

-chris


On Wednesday, April 24, 2024, Christopher Schultz <
ch...@christopherschultz.net> wrote:


Lavanya,

On 4/24/24 07:37, lavanya tech wrote:


Sorry I understood wrongly here with regards to my environment, Let

me

start from the beginning. I donot want to use redirect at all. I

simply

wanted to force apache tomcat to use both localhost and dns name of

the

localhost via url.



When you say "force" what do you mean?

When you say "use both localhost and DNS name" what do you mean?

When you say "localhost" do you mean 127.0.0.1 or "the machine I'm
logged-into right now"?

I have DNS resollution as below.


server.lbg.com --> localhost



Is that a CNAME record?

nslookup server.lbg.com (localhost)

Name:server.lbg.com
Address:  192.168.100.20
alias: example.lbg.com



That's a weird DNS response. The DNS name "localhost" should *always*
return 127.0.0.1 for IPv4 and ::1 for IPv6. It shouldn't return
191.168.100.20.

We have working the below urls working:

https://server.lbg.com:8443/towl
https://example.lbg.com:8443/towl --> redirects to



What do you mean "redirect"? Does it return a 30x response that

causes the

browser to make a new request to \/

https://server.lbg.com:8443/towl  --> still works --> we have SSL

configured for the same but this SSL certificate doesnot have

additional

DNS setup.



What SANs are in your certificate? How many certificates do you have?

But I would need to somehow  access https://example.lbg.com --> which

means
I would need to access via 443 here ?



I'm so confused. What needs to access what?

I tried to adding the below to  server.xml as below, but that doesnot

seems

to work.

   



This will only redirect (HTTP 302) requests to

http://yourhost/anything

to https://yourhost/anything *if the application specifically

requests

CONFIDENTIAL transport*. It doesn't just redirect everything by

default. If

you want it to redirect everything, you'll need to set that up e.g.

using

RewriteValve. There are other options, too.

Do i need additional SSL certificate for the https://example.lbg.com

to

make it work ?



If you don't want your 

Re: Regarding Tomcat url redirection

2024-04-26 Thread Christopher Schultz

Lavanya,

On 4/25/24 07:24, lavanya tech wrote:

Hi Chris,

One question / doubt:

As I mentioned earlier, the below URLS already working in the browser

https://server.lbg.com:8443/towl
https://example.lbg.com:8443/towl -> redirect ( which means when I hit in

browser) it points to https://server.lbg.com:8443/towl ---> To be frank,
even I donot need redirect here, not sure why it redirects.

My question is why its working even though SAN is not registered with the
certificate ? It doesnot even throw warning in the browser.


I'm not sure. Is it possible you have dismissed this error in the past 
and the browser is remembering that? Try this with a different web 
browser or maybe with curl from the command-line to see what happens.



Why https://server.lbg.com/towl or https://example.lbg.com/towl --> How it
should work with New SAN certificate ?


You don't need to worry about the port number or application name, only 
the hostname is a part of the SAN.


-chris


On Thu, Apr 25, 2024 at 10:16 AM lavanya tech 
wrote:


Hi Chris,


Thanks I will request new certificate with SANs and I will try to fix the
things from our end.

Best Regards,
Lavanya

On Wed, Apr 24, 2024 at 11:12 PM Christopher Schultz <
ch...@christopherschultz.net> wrote:


Lavanya,

On 4/24/24 15:39, lavanya tech wrote:

Local host means the machine i am logged in to server.lbg.com

You are right, example.lbg.com is CNAME record.


Okay, thanks for clearing that up.


I dont have any SAN configured for the certificate. The certificate is
requested for only server.lbg.com


You will never be able to make a secure request to anything other than
server.lbg.com without seeing an error. I highly recommend adding the
other hostname as a SAN to your certificate if you really want to
support this.

Even if you wanted https://example.lbg.com/whatever to return an HTTP
302 redirect to https://server.lbg.com/whatever, the user would see a
certificate hostname mismatch error which is ugly. It's best to make it
work without users seeing ugly things.


So if i just request new certificate with SAN it should work ? If yes, I
will request for it and follow your steps as below suggested.


Yes, it should.


Should i use CName record or DNS? Does it make difference?


CNAME *is* DNS.

Whenever possible, use hostnames and not IP addresses as SANs. It's more
flexible that way, and users get to see hostnames instead of IP addresses.

-chris


On Wednesday, April 24, 2024, Christopher Schultz <
ch...@christopherschultz.net> wrote:


Lavanya,

On 4/24/24 07:37, lavanya tech wrote:


Sorry I understood wrongly here with regards to my environment, Let me
start from the beginning. I donot want to use redirect at all. I

simply

wanted to force apache tomcat to use both localhost and dns name of

the

localhost via url.



When you say "force" what do you mean?

When you say "use both localhost and DNS name" what do you mean?

When you say "localhost" do you mean 127.0.0.1 or "the machine I'm
logged-into right now"?

I have DNS resollution as below.


server.lbg.com --> localhost



Is that a CNAME record?

nslookup server.lbg.com (localhost)

Name:server.lbg.com
Address:  192.168.100.20
alias: example.lbg.com



That's a weird DNS response. The DNS name "localhost" should *always*
return 127.0.0.1 for IPv4 and ::1 for IPv6. It shouldn't return
191.168.100.20.

We have working the below urls working:

https://server.lbg.com:8443/towl
https://example.lbg.com:8443/towl --> redirects to



What do you mean "redirect"? Does it return a 30x response that causes

the

browser to make a new request to \/

https://server.lbg.com:8443/towl  --> still works --> we have SSL

configured for the same but this SSL certificate doesnot have

additional

DNS setup.



What SANs are in your certificate? How many certificates do you have?

But I would need to somehow  access https://example.lbg.com --> which

means
I would need to access via 443 here ?



I'm so confused. What needs to access what?

I tried to adding the below to  server.xml as below, but that doesnot

seems

to work.

   



This will only redirect (HTTP 302) requests to

http://yourhost/anything

to https://yourhost/anything *if the application specifically requests
CONFIDENTIAL transport*. It doesn't just redirect everything by

default. If

you want it to redirect everything, you'll need to set that up e.g.

using

RewriteValve. There are other options, too.

Do i need additional SSL certificate for the https://example.lbg.com

to

make it work ?



If you don't want your browser to complain, you will need at least one

TLS

certificate that contains every Subject Alternative Name (SAN) for

every

possible hostname you expect to use with this service. You ca do it

with

multiple certificates as well, but a single cert with multiple SANs is

less

work.

Do i need to set up an additional web server for this like apache or

nginx

for redirecting requests?



No.

Please stop saying "redirect" because 

Re: Regarding Tomcat url redirection

2024-04-25 Thread lavanya tech
Hi

I have updated the certificate now, but still I cannot access url
https://example.lbg.com/towl  either https://server.lbg.com/towl ?

I wonder why its working with port 8443 and not with out port



On Thu, Apr 25, 2024 at 1:24 PM lavanya tech 
wrote:

> Hi Chris,
>
> One question / doubt:
>
> As I mentioned earlier, the below URLS already working in the browser
> > https://server.lbg.com:8443/towl
> > https://example.lbg.com:8443/towl -> redirect ( which means when I hit
> in browser) it points to https://server.lbg.com:8443/towl ---> To be
> frank, even I donot need redirect here, not sure why it redirects.
>
> My question is why its working even though SAN is not registered with the
> certificate ? It doesnot even throw warning in the browser.
>
> Why https://server.lbg.com/towl or https://example.lbg.com/towl --> How
> it should work with New SAN certificate ?
>
> Thanks,
> Lavanya
>
>
>
> On Thu, Apr 25, 2024 at 10:16 AM lavanya tech 
> wrote:
>
>> Hi Chris,
>>
>>
>> Thanks I will request new certificate with SANs and I will try to fix the
>> things from our end.
>>
>> Best Regards,
>> Lavanya
>>
>> On Wed, Apr 24, 2024 at 11:12 PM Christopher Schultz <
>> ch...@christopherschultz.net> wrote:
>>
>>> Lavanya,
>>>
>>> On 4/24/24 15:39, lavanya tech wrote:
>>> > Local host means the machine i am logged in to server.lbg.com
>>> >
>>> > You are right, example.lbg.com is CNAME record.
>>>
>>> Okay, thanks for clearing that up.
>>>
>>> > I dont have any SAN configured for the certificate. The certificate is
>>> > requested for only server.lbg.com
>>>
>>> You will never be able to make a secure request to anything other than
>>> server.lbg.com without seeing an error. I highly recommend adding the
>>> other hostname as a SAN to your certificate if you really want to
>>> support this.
>>>
>>> Even if you wanted https://example.lbg.com/whatever to return an HTTP
>>> 302 redirect to https://server.lbg.com/whatever, the user would see a
>>> certificate hostname mismatch error which is ugly. It's best to make it
>>> work without users seeing ugly things.
>>>
>>> > So if i just request new certificate with SAN it should work ? If yes,
>>> I
>>> > will request for it and follow your steps as below suggested.
>>>
>>> Yes, it should.
>>>
>>> > Should i use CName record or DNS? Does it make difference?
>>>
>>> CNAME *is* DNS.
>>>
>>> Whenever possible, use hostnames and not IP addresses as SANs. It's more
>>> flexible that way, and users get to see hostnames instead of IP
>>> addresses.
>>>
>>> -chris
>>>
>>> > On Wednesday, April 24, 2024, Christopher Schultz <
>>> > ch...@christopherschultz.net> wrote:
>>> >
>>> >> Lavanya,
>>> >>
>>> >> On 4/24/24 07:37, lavanya tech wrote:
>>> >>
>>> >>> Sorry I understood wrongly here with regards to my environment, Let
>>> me
>>> >>> start from the beginning. I donot want to use redirect at all. I
>>> simply
>>> >>> wanted to force apache tomcat to use both localhost and dns name of
>>> the
>>> >>> localhost via url.
>>> >>>
>>> >>
>>> >> When you say "force" what do you mean?
>>> >>
>>> >> When you say "use both localhost and DNS name" what do you mean?
>>> >>
>>> >> When you say "localhost" do you mean 127.0.0.1 or "the machine I'm
>>> >> logged-into right now"?
>>> >>
>>> >> I have DNS resollution as below.
>>> >>>
>>> >>> server.lbg.com --> localhost
>>> >>>
>>> >>
>>> >> Is that a CNAME record?
>>> >>
>>> >> nslookup server.lbg.com (localhost)
>>> >>> Name:server.lbg.com
>>> >>> Address:  192.168.100.20
>>> >>> alias: example.lbg.com
>>> >>>
>>> >>
>>> >> That's a weird DNS response. The DNS name "localhost" should *always*
>>> >> return 127.0.0.1 for IPv4 and ::1 for IPv6. It shouldn't return
>>> >> 191.168.100.20.
>>> >>
>>> >> We have working the below urls working:
>>> >>> https://server.lbg.com:8443/towl
>>> >>> https://example.lbg.com:8443/towl --> redirects to
>>> >>>
>>> >>
>>> >> What do you mean "redirect"? Does it return a 30x response that
>>> causes the
>>> >> browser to make a new request to \/
>>> >>
>>> >> https://server.lbg.com:8443/towl  --> still works --> we have SSL
>>> >>> configured for the same but this SSL certificate doesnot have
>>> additional
>>> >>> DNS setup.
>>> >>>
>>> >>
>>> >> What SANs are in your certificate? How many certificates do you have?
>>> >>
>>> >> But I would need to somehow  access https://example.lbg.com --> which
>>> >>> means
>>> >>> I would need to access via 443 here ?
>>> >>>
>>> >>
>>> >> I'm so confused. What needs to access what?
>>> >>
>>> >> I tried to adding the below to  server.xml as below, but that doesnot
>>> seems
>>> >>> to work.
>>> >>>
>>> >>>   >> >>> protocol="org.apache.coyote.http11.Http11NioProtocol"
>>> >>>  connectionTimeout="2"
>>> >>>  redirectPort="443" />
>>> >>>
>>> >>
>>> >> This will only redirect (HTTP 302) requests to
>>> http://yourhost/anything
>>> >> to https://yourhost/anything *if the application specifically
>>> requests
>>> >> CONFIDENTIAL 

Re: Regarding Tomcat url redirection

2024-04-25 Thread lavanya tech
Hi Chris,

One question / doubt:

As I mentioned earlier, the below URLS already working in the browser
> https://server.lbg.com:8443/towl
> https://example.lbg.com:8443/towl -> redirect ( which means when I hit in
browser) it points to https://server.lbg.com:8443/towl ---> To be frank,
even I donot need redirect here, not sure why it redirects.

My question is why its working even though SAN is not registered with the
certificate ? It doesnot even throw warning in the browser.

Why https://server.lbg.com/towl or https://example.lbg.com/towl --> How it
should work with New SAN certificate ?

Thanks,
Lavanya



On Thu, Apr 25, 2024 at 10:16 AM lavanya tech 
wrote:

> Hi Chris,
>
>
> Thanks I will request new certificate with SANs and I will try to fix the
> things from our end.
>
> Best Regards,
> Lavanya
>
> On Wed, Apr 24, 2024 at 11:12 PM Christopher Schultz <
> ch...@christopherschultz.net> wrote:
>
>> Lavanya,
>>
>> On 4/24/24 15:39, lavanya tech wrote:
>> > Local host means the machine i am logged in to server.lbg.com
>> >
>> > You are right, example.lbg.com is CNAME record.
>>
>> Okay, thanks for clearing that up.
>>
>> > I dont have any SAN configured for the certificate. The certificate is
>> > requested for only server.lbg.com
>>
>> You will never be able to make a secure request to anything other than
>> server.lbg.com without seeing an error. I highly recommend adding the
>> other hostname as a SAN to your certificate if you really want to
>> support this.
>>
>> Even if you wanted https://example.lbg.com/whatever to return an HTTP
>> 302 redirect to https://server.lbg.com/whatever, the user would see a
>> certificate hostname mismatch error which is ugly. It's best to make it
>> work without users seeing ugly things.
>>
>> > So if i just request new certificate with SAN it should work ? If yes, I
>> > will request for it and follow your steps as below suggested.
>>
>> Yes, it should.
>>
>> > Should i use CName record or DNS? Does it make difference?
>>
>> CNAME *is* DNS.
>>
>> Whenever possible, use hostnames and not IP addresses as SANs. It's more
>> flexible that way, and users get to see hostnames instead of IP addresses.
>>
>> -chris
>>
>> > On Wednesday, April 24, 2024, Christopher Schultz <
>> > ch...@christopherschultz.net> wrote:
>> >
>> >> Lavanya,
>> >>
>> >> On 4/24/24 07:37, lavanya tech wrote:
>> >>
>> >>> Sorry I understood wrongly here with regards to my environment, Let me
>> >>> start from the beginning. I donot want to use redirect at all. I
>> simply
>> >>> wanted to force apache tomcat to use both localhost and dns name of
>> the
>> >>> localhost via url.
>> >>>
>> >>
>> >> When you say "force" what do you mean?
>> >>
>> >> When you say "use both localhost and DNS name" what do you mean?
>> >>
>> >> When you say "localhost" do you mean 127.0.0.1 or "the machine I'm
>> >> logged-into right now"?
>> >>
>> >> I have DNS resollution as below.
>> >>>
>> >>> server.lbg.com --> localhost
>> >>>
>> >>
>> >> Is that a CNAME record?
>> >>
>> >> nslookup server.lbg.com (localhost)
>> >>> Name:server.lbg.com
>> >>> Address:  192.168.100.20
>> >>> alias: example.lbg.com
>> >>>
>> >>
>> >> That's a weird DNS response. The DNS name "localhost" should *always*
>> >> return 127.0.0.1 for IPv4 and ::1 for IPv6. It shouldn't return
>> >> 191.168.100.20.
>> >>
>> >> We have working the below urls working:
>> >>> https://server.lbg.com:8443/towl
>> >>> https://example.lbg.com:8443/towl --> redirects to
>> >>>
>> >>
>> >> What do you mean "redirect"? Does it return a 30x response that causes
>> the
>> >> browser to make a new request to \/
>> >>
>> >> https://server.lbg.com:8443/towl  --> still works --> we have SSL
>> >>> configured for the same but this SSL certificate doesnot have
>> additional
>> >>> DNS setup.
>> >>>
>> >>
>> >> What SANs are in your certificate? How many certificates do you have?
>> >>
>> >> But I would need to somehow  access https://example.lbg.com --> which
>> >>> means
>> >>> I would need to access via 443 here ?
>> >>>
>> >>
>> >> I'm so confused. What needs to access what?
>> >>
>> >> I tried to adding the below to  server.xml as below, but that doesnot
>> seems
>> >>> to work.
>> >>>
>> >>>   > >>> protocol="org.apache.coyote.http11.Http11NioProtocol"
>> >>>  connectionTimeout="2"
>> >>>  redirectPort="443" />
>> >>>
>> >>
>> >> This will only redirect (HTTP 302) requests to
>> http://yourhost/anything
>> >> to https://yourhost/anything *if the application specifically requests
>> >> CONFIDENTIAL transport*. It doesn't just redirect everything by
>> default. If
>> >> you want it to redirect everything, you'll need to set that up e.g.
>> using
>> >> RewriteValve. There are other options, too.
>> >>
>> >> Do i need additional SSL certificate for the https://example.lbg.com
>> to
>> >>> make it work ?
>> >>>
>> >>
>> >> If you don't want your browser to complain, you will need at least one
>> TLS
>> >> certificate that contains every 

Re: Regarding Tomcat url redirection

2024-04-25 Thread lavanya tech
Hi Chris,


Thanks I will request new certificate with SANs and I will try to fix the
things from our end.

Best Regards,
Lavanya

On Wed, Apr 24, 2024 at 11:12 PM Christopher Schultz <
ch...@christopherschultz.net> wrote:

> Lavanya,
>
> On 4/24/24 15:39, lavanya tech wrote:
> > Local host means the machine i am logged in to server.lbg.com
> >
> > You are right, example.lbg.com is CNAME record.
>
> Okay, thanks for clearing that up.
>
> > I dont have any SAN configured for the certificate. The certificate is
> > requested for only server.lbg.com
>
> You will never be able to make a secure request to anything other than
> server.lbg.com without seeing an error. I highly recommend adding the
> other hostname as a SAN to your certificate if you really want to
> support this.
>
> Even if you wanted https://example.lbg.com/whatever to return an HTTP
> 302 redirect to https://server.lbg.com/whatever, the user would see a
> certificate hostname mismatch error which is ugly. It's best to make it
> work without users seeing ugly things.
>
> > So if i just request new certificate with SAN it should work ? If yes, I
> > will request for it and follow your steps as below suggested.
>
> Yes, it should.
>
> > Should i use CName record or DNS? Does it make difference?
>
> CNAME *is* DNS.
>
> Whenever possible, use hostnames and not IP addresses as SANs. It's more
> flexible that way, and users get to see hostnames instead of IP addresses.
>
> -chris
>
> > On Wednesday, April 24, 2024, Christopher Schultz <
> > ch...@christopherschultz.net> wrote:
> >
> >> Lavanya,
> >>
> >> On 4/24/24 07:37, lavanya tech wrote:
> >>
> >>> Sorry I understood wrongly here with regards to my environment, Let me
> >>> start from the beginning. I donot want to use redirect at all. I simply
> >>> wanted to force apache tomcat to use both localhost and dns name of the
> >>> localhost via url.
> >>>
> >>
> >> When you say "force" what do you mean?
> >>
> >> When you say "use both localhost and DNS name" what do you mean?
> >>
> >> When you say "localhost" do you mean 127.0.0.1 or "the machine I'm
> >> logged-into right now"?
> >>
> >> I have DNS resollution as below.
> >>>
> >>> server.lbg.com --> localhost
> >>>
> >>
> >> Is that a CNAME record?
> >>
> >> nslookup server.lbg.com (localhost)
> >>> Name:server.lbg.com
> >>> Address:  192.168.100.20
> >>> alias: example.lbg.com
> >>>
> >>
> >> That's a weird DNS response. The DNS name "localhost" should *always*
> >> return 127.0.0.1 for IPv4 and ::1 for IPv6. It shouldn't return
> >> 191.168.100.20.
> >>
> >> We have working the below urls working:
> >>> https://server.lbg.com:8443/towl
> >>> https://example.lbg.com:8443/towl --> redirects to
> >>>
> >>
> >> What do you mean "redirect"? Does it return a 30x response that causes
> the
> >> browser to make a new request to \/
> >>
> >> https://server.lbg.com:8443/towl  --> still works --> we have SSL
> >>> configured for the same but this SSL certificate doesnot have
> additional
> >>> DNS setup.
> >>>
> >>
> >> What SANs are in your certificate? How many certificates do you have?
> >>
> >> But I would need to somehow  access https://example.lbg.com --> which
> >>> means
> >>> I would need to access via 443 here ?
> >>>
> >>
> >> I'm so confused. What needs to access what?
> >>
> >> I tried to adding the below to  server.xml as below, but that doesnot
> seems
> >>> to work.
> >>>
> >>>>>> protocol="org.apache.coyote.http11.Http11NioProtocol"
> >>>  connectionTimeout="2"
> >>>  redirectPort="443" />
> >>>
> >>
> >> This will only redirect (HTTP 302) requests to http://yourhost/anything
> >> to https://yourhost/anything *if the application specifically requests
> >> CONFIDENTIAL transport*. It doesn't just redirect everything by
> default. If
> >> you want it to redirect everything, you'll need to set that up e.g.
> using
> >> RewriteValve. There are other options, too.
> >>
> >> Do i need additional SSL certificate for the https://example.lbg.com
> to
> >>> make it work ?
> >>>
> >>
> >> If you don't want your browser to complain, you will need at least one
> TLS
> >> certificate that contains every Subject Alternative Name (SAN) for every
> >> possible hostname you expect to use with this service. You ca do it with
> >> multiple certificates as well, but a single cert with multiple SANs is
> less
> >> work.
> >>
> >> Do i need to set up an additional web server for this like apache or
> nginx
> >>> for redirecting requests?
> >>>
> >>
> >> No.
> >>
> >> Please stop saying "redirect" because it sounds like you almost never
> mean
> >> "HTTP 30x redirect" and that's confusing everything.
> >>
> >> I *think* you only need the following:
> >>
> >> 1. A TLS certificate with the following SANs:
> >>
> >>* server.lbg.com
> >>* example.lbg.com
> >>* localhost (you shouldn't do this)
> >>
> >> 2. DNS configured for all hostnames:
> >>
> >>* server.lbg.com -> A 192.168.100.20
> >>* example.lgb.com 

Re: Regarding Tomcat url redirection

2024-04-24 Thread Christopher Schultz

Lavanya,

On 4/24/24 15:39, lavanya tech wrote:

Local host means the machine i am logged in to server.lbg.com

You are right, example.lbg.com is CNAME record.


Okay, thanks for clearing that up.


I dont have any SAN configured for the certificate. The certificate is
requested for only server.lbg.com


You will never be able to make a secure request to anything other than 
server.lbg.com without seeing an error. I highly recommend adding the 
other hostname as a SAN to your certificate if you really want to 
support this.


Even if you wanted https://example.lbg.com/whatever to return an HTTP 
302 redirect to https://server.lbg.com/whatever, the user would see a 
certificate hostname mismatch error which is ugly. It's best to make it 
work without users seeing ugly things.



So if i just request new certificate with SAN it should work ? If yes, I
will request for it and follow your steps as below suggested.


Yes, it should.


Should i use CName record or DNS? Does it make difference?


CNAME *is* DNS.

Whenever possible, use hostnames and not IP addresses as SANs. It's more 
flexible that way, and users get to see hostnames instead of IP addresses.


-chris


On Wednesday, April 24, 2024, Christopher Schultz <
ch...@christopherschultz.net> wrote:


Lavanya,

On 4/24/24 07:37, lavanya tech wrote:


Sorry I understood wrongly here with regards to my environment, Let me
start from the beginning. I donot want to use redirect at all. I simply
wanted to force apache tomcat to use both localhost and dns name of the
localhost via url.



When you say "force" what do you mean?

When you say "use both localhost and DNS name" what do you mean?

When you say "localhost" do you mean 127.0.0.1 or "the machine I'm
logged-into right now"?

I have DNS resollution as below.


server.lbg.com --> localhost



Is that a CNAME record?

nslookup server.lbg.com (localhost)

Name:server.lbg.com
Address:  192.168.100.20
alias: example.lbg.com



That's a weird DNS response. The DNS name "localhost" should *always*
return 127.0.0.1 for IPv4 and ::1 for IPv6. It shouldn't return
191.168.100.20.

We have working the below urls working:

https://server.lbg.com:8443/towl
https://example.lbg.com:8443/towl --> redirects to



What do you mean "redirect"? Does it return a 30x response that causes the
browser to make a new request to \/

https://server.lbg.com:8443/towl  --> still works --> we have SSL

configured for the same but this SSL certificate doesnot have additional
DNS setup.



What SANs are in your certificate? How many certificates do you have?

But I would need to somehow  access https://example.lbg.com --> which

means
I would need to access via 443 here ?



I'm so confused. What needs to access what?

I tried to adding the below to  server.xml as below, but that doesnot seems

to work.

  



This will only redirect (HTTP 302) requests to http://yourhost/anything
to https://yourhost/anything *if the application specifically requests
CONFIDENTIAL transport*. It doesn't just redirect everything by default. If
you want it to redirect everything, you'll need to set that up e.g. using
RewriteValve. There are other options, too.

Do i need additional SSL certificate for the https://example.lbg.com  to

make it work ?



If you don't want your browser to complain, you will need at least one TLS
certificate that contains every Subject Alternative Name (SAN) for every
possible hostname you expect to use with this service. You ca do it with
multiple certificates as well, but a single cert with multiple SANs is less
work.

Do i need to set up an additional web server for this like apache or nginx

for redirecting requests?



No.

Please stop saying "redirect" because it sounds like you almost never mean
"HTTP 30x redirect" and that's confusing everything.

I *think* you only need the following:

1. A TLS certificate with the following SANs:

   * server.lbg.com
   * example.lbg.com
   * localhost (you shouldn't do this)

2. DNS configured for all hostnames:

   * server.lbg.com -> A 192.168.100.20
   * example.lgb.com -> A 192.168.100.20

3. Tomcat configured with a single  which is the default virtual
host. Note that this is the *default Tomcat configuration* and doesn't need
to be changed from the default.

4. Tomcat configured with your certificate like this:


  


  


If your SANs are configured properly, this should allow you to connect
using any of these URLs:

$ curl https://server.lbg.com/towl/login.jsp

   (returns login page)

$ curl https://example.lbg.com/towl/login.jsp

   (returns login page)

If your application's web.xml contains something like this:

   
 
   theapp
   /*
 
 
   CONFIDENTIAL
 
   

... then these URLs insecure HTTP URLs should redirect your clients:

$ curl http://server.lbg.com/towl/login.jsp

   (returns HTTP 302 redirect to https://server.lbg.com/towl/login.jsp)

$ curl https://server.lbg.com/towl/login.jsp

   (returns 

Re: Regarding Tomcat url redirection

2024-04-24 Thread lavanya tech
Hi Chris,

Thanks for the reply.

Local host means the machine i am logged in to server.lbg.com

You are right, example.lbg.com is CNAME record.

I dont have any SAN configured for the certificate. The certificate is
requested for only server.lbg.com

So if i just request new certificate with SAN it should work ? If yes, I
will request for it and follow your steps as below suggested.

Should i use CName record or DNS? Does it make difference?

Thanks,
Lavanya






On Wednesday, April 24, 2024, Christopher Schultz <
ch...@christopherschultz.net> wrote:

> Lavanya,
>
> On 4/24/24 07:37, lavanya tech wrote:
>
>> Sorry I understood wrongly here with regards to my environment, Let me
>> start from the beginning. I donot want to use redirect at all. I simply
>> wanted to force apache tomcat to use both localhost and dns name of the
>> localhost via url.
>>
>
> When you say "force" what do you mean?
>
> When you say "use both localhost and DNS name" what do you mean?
>
> When you say "localhost" do you mean 127.0.0.1 or "the machine I'm
> logged-into right now"?
>
> I have DNS resollution as below.
>>
>> server.lbg.com --> localhost
>>
>
> Is that a CNAME record?
>
> nslookup server.lbg.com (localhost)
>> Name:server.lbg.com
>> Address:  192.168.100.20
>> alias: example.lbg.com
>>
>
> That's a weird DNS response. The DNS name "localhost" should *always*
> return 127.0.0.1 for IPv4 and ::1 for IPv6. It shouldn't return
> 191.168.100.20.
>
> We have working the below urls working:
>> https://server.lbg.com:8443/towl
>> https://example.lbg.com:8443/towl --> redirects to
>>
>
> What do you mean "redirect"? Does it return a 30x response that causes the
> browser to make a new request to \/
>
> https://server.lbg.com:8443/towl  --> still works --> we have SSL
>> configured for the same but this SSL certificate doesnot have additional
>> DNS setup.
>>
>
> What SANs are in your certificate? How many certificates do you have?
>
> But I would need to somehow  access https://example.lbg.com --> which
>> means
>> I would need to access via 443 here ?
>>
>
> I'm so confused. What needs to access what?
>
> I tried to adding the below to  server.xml as below, but that doesnot seems
>> to work.
>>
>>  > protocol="org.apache.coyote.http11.Http11NioProtocol"
>> connectionTimeout="2"
>> redirectPort="443" />
>>
>
> This will only redirect (HTTP 302) requests to http://yourhost/anything
> to https://yourhost/anything *if the application specifically requests
> CONFIDENTIAL transport*. It doesn't just redirect everything by default. If
> you want it to redirect everything, you'll need to set that up e.g. using
> RewriteValve. There are other options, too.
>
> Do i need additional SSL certificate for the https://example.lbg.com  to
>> make it work ?
>>
>
> If you don't want your browser to complain, you will need at least one TLS
> certificate that contains every Subject Alternative Name (SAN) for every
> possible hostname you expect to use with this service. You ca do it with
> multiple certificates as well, but a single cert with multiple SANs is less
> work.
>
> Do i need to set up an additional web server for this like apache or nginx
>> for redirecting requests?
>>
>
> No.
>
> Please stop saying "redirect" because it sounds like you almost never mean
> "HTTP 30x redirect" and that's confusing everything.
>
> I *think* you only need the following:
>
> 1. A TLS certificate with the following SANs:
>
>   * server.lbg.com
>   * example.lbg.com
>   * localhost (you shouldn't do this)
>
> 2. DNS configured for all hostnames:
>
>   * server.lbg.com -> A 192.168.100.20
>   * example.lgb.com -> A 192.168.100.20
>
> 3. Tomcat configured with a single  which is the default virtual
> host. Note that this is the *default Tomcat configuration* and doesn't need
> to be changed from the default.
>
> 4. Tomcat configured with your certificate like this:
>
>   SSLEnabled="true">
>  
>certificateFile="/path/to/your/cert.crt"
>certificateKeyFile="/path/to/your/key.pem" />
>
>  
>
>
> If your SANs are configured properly, this should allow you to connect
> using any of these URLs:
>
> $ curl https://server.lbg.com/towl/login.jsp
>
>   (returns login page)
>
> $ curl https://example.lbg.com/towl/login.jsp
>
>   (returns login page)
>
> If your application's web.xml contains something like this:
>
>   
> 
>   theapp
>   /*
> 
> 
>   CONFIDENTIAL
> 
>   
>
> ... then these URLs insecure HTTP URLs should redirect your clients:
>
> $ curl http://server.lbg.com/towl/login.jsp
>
>   (returns HTTP 302 redirect to https://server.lbg.com/towl/login.jsp)
>
> $ curl https://server.lbg.com/towl/login.jsp
>
>   (returns HTTP 302 redirect to https://example.lbg.com/towl/login.jsp)
>
> I don't think you need any use of the RewriteValve unless you want to
> handle sending HTTP 302 redirect responses to insecure requests without
> specifying 

Re: Regarding Tomcat url redirection

2024-04-24 Thread Christopher Schultz

Lavanya,

On 4/24/24 07:37, lavanya tech wrote:

Sorry I understood wrongly here with regards to my environment, Let me
start from the beginning. I donot want to use redirect at all. I simply
wanted to force apache tomcat to use both localhost and dns name of the
localhost via url.


When you say "force" what do you mean?

When you say "use both localhost and DNS name" what do you mean?

When you say "localhost" do you mean 127.0.0.1 or "the machine I'm 
logged-into right now"?



I have DNS resollution as below.

server.lbg.com --> localhost


Is that a CNAME record?


nslookup server.lbg.com (localhost)
Name:server.lbg.com
Address:  192.168.100.20
alias: example.lbg.com


That's a weird DNS response. The DNS name "localhost" should *always* 
return 127.0.0.1 for IPv4 and ::1 for IPv6. It shouldn't return 
191.168.100.20.



We have working the below urls working:
https://server.lbg.com:8443/towl
https://example.lbg.com:8443/towl --> redirects to


What do you mean "redirect"? Does it return a 30x response that causes 
the browser to make a new request to \/



https://server.lbg.com:8443/towl  --> still works --> we have SSL
configured for the same but this SSL certificate doesnot have additional
DNS setup.


What SANs are in your certificate? How many certificates do you have?


But I would need to somehow  access https://example.lbg.com --> which means
I would need to access via 443 here ?


I'm so confused. What needs to access what?


I tried to adding the below to  server.xml as below, but that doesnot seems
to work.

 


This will only redirect (HTTP 302) requests to http://yourhost/anything 
to https://yourhost/anything *if the application specifically requests 
CONFIDENTIAL transport*. It doesn't just redirect everything by default. 
If you want it to redirect everything, you'll need to set that up e.g. 
using RewriteValve. There are other options, too.



Do i need additional SSL certificate for the https://example.lbg.com  to
make it work ?


If you don't want your browser to complain, you will need at least one 
TLS certificate that contains every Subject Alternative Name (SAN) for 
every possible hostname you expect to use with this service. You ca do 
it with multiple certificates as well, but a single cert with multiple 
SANs is less work.



Do i need to set up an additional web server for this like apache or nginx
for redirecting requests?


No.

Please stop saying "redirect" because it sounds like you almost never 
mean "HTTP 30x redirect" and that's confusing everything.


I *think* you only need the following:

1. A TLS certificate with the following SANs:

  * server.lbg.com
  * example.lbg.com
  * localhost (you shouldn't do this)

2. DNS configured for all hostnames:

  * server.lbg.com -> A 192.168.100.20
  * example.lgb.com -> A 192.168.100.20

3. Tomcat configured with a single  which is the default virtual 
host. Note that this is the *default Tomcat configuration* and doesn't 
need to be changed from the default.


4. Tomcat configured with your certificate like this:

   
 
   
   
 
   

If your SANs are configured properly, this should allow you to connect 
using any of these URLs:


$ curl https://server.lbg.com/towl/login.jsp

  (returns login page)

$ curl https://example.lbg.com/towl/login.jsp

  (returns login page)

If your application's web.xml contains something like this:

  

  theapp
  /*


  CONFIDENTIAL

  

... then these URLs insecure HTTP URLs should redirect your clients:

$ curl http://server.lbg.com/towl/login.jsp

  (returns HTTP 302 redirect to https://server.lbg.com/towl/login.jsp)

$ curl https://server.lbg.com/towl/login.jsp

  (returns HTTP 302 redirect to https://example.lbg.com/towl/login.jsp)

I don't think you need any use of the RewriteValve unless you want to 
handle sending HTTP 302 redirect responses to insecure requests without 
specifying the CONFIDENTIAL transport-guarantee in your application's 
web.xml file. But I don't see any reason NOT to have that in there.


-chris


On Tue, Apr 23, 2024 at 10:52 PM Christopher Schultz <
ch...@christopherschultz.net> wrote:


Lavanya,

On 4/22/24 05:21, lavanya tech wrote:

Could you please explain, what you exactly mean ? So here redirect is

not a

solution right ?


Redirecting is fine.

Perhaps you should take a step back and decide: what do you actually
want, here? You might be trying to solve problem X by applying solution
Y, and you've already decided that solution Y is correct so you are
trying to get help with that.

Perhaps ask for help with Problem X?

For example, "I don't want users to have to type the name of my
application to reach it so I want example.com/ to go to my application
instead of example.com/myapp/".

Or, "I have multiple domains and I want all of them to redirect to the
canonical domain example.com and to go to me web application /myapp so
everything goes to example.com/myapp/".


"You'd have to use a glob/regex if
you 

Re: Regarding Tomcat url redirection

2024-04-24 Thread lavanya tech
Hi  Chris,

Sorry I understood wrongly here with regards to my environment, Let me
start from the beginning. I donot want to use redirect at all. I simply
wanted to force apache tomcat to use both localhost and dns name of the
localhost via url.
I have DNS resollution as below.

server.lbg.com --> localhost

nslookup server.lbg.com (localhost)
Name:server.lbg.com
Address:  192.168.100.20
alias: example.lbg.com

We have working the below urls working:
https://server.lbg.com:8443/towl
https://example.lbg.com:8443/towl --> redirects to
https://server.lbg.com:8443/towl  --> still works --> we have SSL
configured for the same but this SSL certificate doesnot have additional
DNS setup.
But I would need to somehow  access https://example.lbg.com --> which means
I would need to access via 443 here ?

I tried to adding the below to  server.xml as below, but that doesnot seems
to work.


-->

Do i need additional SSL certificate for the https://example.lbg.com  to
make it work ?

Do i need to set up an additional web server for this like apache or nginx
for redirecting requests?

I look forward to your feedback.

Thanks and Best Regards,
Lavanya






On Tue, Apr 23, 2024 at 10:52 PM Christopher Schultz <
ch...@christopherschultz.net> wrote:

> Lavanya,
>
> On 4/22/24 05:21, lavanya tech wrote:
> > Could you please explain, what you exactly mean ? So here redirect is
> not a
> > solution right ?
>
> Redirecting is fine.
>
> Perhaps you should take a step back and decide: what do you actually
> want, here? You might be trying to solve problem X by applying solution
> Y, and you've already decided that solution Y is correct so you are
> trying to get help with that.
>
> Perhaps ask for help with Problem X?
>
> For example, "I don't want users to have to type the name of my
> application to reach it so I want example.com/ to go to my application
> instead of example.com/myapp/".
>
> Or, "I have multiple domains and I want all of them to redirect to the
> canonical domain example.com and to go to me web application /myapp so
> everything goes to example.com/myapp/".
>
> > "You'd have to use a glob/regex if
> > you wanted to check for [anything and maybe nothing.]example.com."
>
> There is nothing in your configuration or question that suggests that
> the hostname in the request is relevant, but you are making it a
> *requirement* that the request contains a specific Host header. IF you
> don't actually need that, why do you have it?
>
> -chris
>
> > On Fri, Apr 19, 2024 at 3:03 PM Christopher Schultz <
> > ch...@christopherschultz.net> wrote:
> >
> >> Ammu,
> >>
> >> On 4/19/24 08:32, lavanya tech wrote:
> >>> Thank you very much. I removed  for example.com as well as
> adding
> >> an
> >>>  in server.xml
> >>> I copied context.xml file
> >>> /git/app/apache-tomcat-10.1.11/webapps/towl/META-INF/context.xml
> >>> Removed < in rewrite.config files.
> >>>
> >>> But still I dont redirect the URL.
> >>
> >> If you have  in server.xml and also your application in the
> >> webapps/ directory, then you will be double-deploying your application.
> >>
> >> Re-name /git/app/apache-tomcat-10.1.11/webapps/towl/ to be
> >> /git/app/apache-tomcat-10.1.11/webapps/ROOT (the capitals are important)
> >> and remove the  element from your server.xml.
> >>
> >> Then start your server and read the logs.
> >>
> >>> *nslookup alias.example.com 
> >>> gives-->Non-authoritative answer:Name: www.example.com
> >>> Address:  192.168.200.10Aliases:
> >> alias.example.com
> >>> *
> >>>
> >>>
> >>> Just to give some information here, *www.example.com
> >>> * has alias* "alias.example.com
> >>> "*
> >>> But https://www.example.com:/example --> works fine with out
> issues
> >> but
> >>> the alias doesnot works (https://alias.example.com)
> >>> So i am not sure if the redirect url helps or if its correct
> >>
> >> Your rewrite configuration says that you have to be using host
> >> "example.com" but your request goes to www.example.com. Your
> >> configuration should only redirect a request such as:
> >>
> >> $ curl -v http://example.com:/something
> >>
> >> HTTP/1.1 301 Moved Permanently
> >> ...
> >> Location: https://www.example.com:/example
> >>
> >> If you make a request like:
> >>
> >> $ curl -v http://www.example.com:/something
> >>
> >> I wouldn't expect a redirect because of your "host" condition. The
> >> "%{HTTP_HOST} example.com" looks at the entire Host header and not just
> >> anything that ends in "example.com". You'd have to use a glob/regex if
> >> you wanted to check for [anything and maybe nothing.]example.com.
> >>
> >> You'd also have to make sure that your application is serving responses
> >> to requests to / which is why I'm recommending you use the ROOT web
> >> application name instead of "towl".
> >>
> >> -chris
> >>
> >>> On Fri, Apr 19, 2024 at 1:21 PM Christopher 

Re: Regarding Tomcat url redirection

2024-04-23 Thread Christopher Schultz

Lavanya,

On 4/22/24 05:21, lavanya tech wrote:

Could you please explain, what you exactly mean ? So here redirect is not a
solution right ?


Redirecting is fine.

Perhaps you should take a step back and decide: what do you actually 
want, here? You might be trying to solve problem X by applying solution 
Y, and you've already decided that solution Y is correct so you are 
trying to get help with that.


Perhaps ask for help with Problem X?

For example, "I don't want users to have to type the name of my 
application to reach it so I want example.com/ to go to my application 
instead of example.com/myapp/".


Or, "I have multiple domains and I want all of them to redirect to the 
canonical domain example.com and to go to me web application /myapp so 
everything goes to example.com/myapp/".



"You'd have to use a glob/regex if
you wanted to check for [anything and maybe nothing.]example.com."


There is nothing in your configuration or question that suggests that 
the hostname in the request is relevant, but you are making it a 
*requirement* that the request contains a specific Host header. IF you 
don't actually need that, why do you have it?


-chris


On Fri, Apr 19, 2024 at 3:03 PM Christopher Schultz <
ch...@christopherschultz.net> wrote:


Ammu,

On 4/19/24 08:32, lavanya tech wrote:

Thank you very much. I removed  for example.com as well as adding

an

 in server.xml
I copied context.xml file
/git/app/apache-tomcat-10.1.11/webapps/towl/META-INF/context.xml
Removed < in rewrite.config files.

But still I dont redirect the URL.


If you have  in server.xml and also your application in the
webapps/ directory, then you will be double-deploying your application.

Re-name /git/app/apache-tomcat-10.1.11/webapps/towl/ to be
/git/app/apache-tomcat-10.1.11/webapps/ROOT (the capitals are important)
and remove the  element from your server.xml.

Then start your server and read the logs.


*nslookup alias.example.com 
gives-->Non-authoritative answer:Name: www.example.com
Address:  192.168.200.10Aliases:

alias.example.com

*


Just to give some information here, *www.example.com
* has alias* "alias.example.com
"*
But https://www.example.com:/example --> works fine with out issues

but

the alias doesnot works (https://alias.example.com)
So i am not sure if the redirect url helps or if its correct


Your rewrite configuration says that you have to be using host
"example.com" but your request goes to www.example.com. Your
configuration should only redirect a request such as:

$ curl -v http://example.com:/something

HTTP/1.1 301 Moved Permanently
...
Location: https://www.example.com:/example

If you make a request like:

$ curl -v http://www.example.com:/something

I wouldn't expect a redirect because of your "host" condition. The
"%{HTTP_HOST} example.com" looks at the entire Host header and not just
anything that ends in "example.com". You'd have to use a glob/regex if
you wanted to check for [anything and maybe nothing.]example.com.

You'd also have to make sure that your application is serving responses
to requests to / which is why I'm recommending you use the ROOT web
application name instead of "towl".

-chris


On Fri, Apr 19, 2024 at 1:21 PM Christopher Schultz <
ch...@christopherschultz.net> wrote:


Ammu,

On 4/18/24 09:34, lavanya tech wrote:

I am attaching server.xml and context.xml and rewrite.config files.
The paths are

/git/app/apache-tomcat-10.1.11/webapps/towl/context.xml

   
className="org.apache.catalina.valves.rewrite.RewriteValve"

/>

   



This file ^^^ is in the wrong place. It should be in
/git/app/apache-tomcat-10.1.11/webapps/towl/META-INF/context.xml


/git/app/apache-tomcat-10.1.11/webapps/towl/WEB-INF/rewrite.config

https://www.example.com:/example [R=301,L]


Why do you have < symbols at the beginning of these lines?


server.xml


   > [...]


 
 


It's best not to define any  in server.xml. I would remove this
 entirely and allow Tomcat to auto-reploy from your
webapps/towl directory. If you need this application to be deployed as
the ROOT context (on / and not /towl) then you should re-name
/git/app/apache-tomcat-10.1.11/webapps/towl to
/git/app/apache-tomcat-10.1.11/webapps/ROOT

You also don't need a  for example.com as well as adding an
 for the same domain (though this is probably to anonymize the
configuration). You can feel free to simply use the "localhost" 
as the default  and deploy everything into it. This makes your
configuration changes relative to a stock Tomcat less significant and
easier to apply to new versions if/when necessary.

-chris


On Thu, Apr 18, 2024 at 2:17 PM Christopher Schultz <
ch...@christopherschultz.net> wrote:


Ammu,

On 4/18/24 07:45, lavanya tech wrote:

I added classname rewrite valeus in contex.xml file .




Re: Regarding Tomcat url redirection

2024-04-22 Thread lavanya tech
Hi Chris,

I have already a Root folder /git/app/apache-tomcat-10.1.11/webapps, I see
the files index.jsp and index.jsp has below configuration.
So should I add server.xml under ROOT folder aswell with localhost and
example.com such that both the urls are accessible. ? Please suggest

<% response.sendRedirect("/towl"); %>

Thanks,
amm

On Mon, Apr 22, 2024 at 11:21 AM lavanya tech 
wrote:

> Hi Chris,
>
> Could you please explain, what you exactly mean ? So here redirect is not
> a solution right ?
>
> "You'd have to use a glob/regex if
> you wanted to check for [anything and maybe nothing.]example.com."
>
> Thanks,
> ammu
>
>
>
>
> On Fri, Apr 19, 2024 at 3:03 PM Christopher Schultz <
> ch...@christopherschultz.net> wrote:
>
>> Ammu,
>>
>> On 4/19/24 08:32, lavanya tech wrote:
>> > Thank you very much. I removed  for example.com as well as
>> adding an
>> >  in server.xml
>> > I copied context.xml file
>> > /git/app/apache-tomcat-10.1.11/webapps/towl/META-INF/context.xml
>> > Removed < in rewrite.config files.
>> >
>> > But still I dont redirect the URL.
>>
>> If you have  in server.xml and also your application in the
>> webapps/ directory, then you will be double-deploying your application.
>>
>> Re-name /git/app/apache-tomcat-10.1.11/webapps/towl/ to be
>> /git/app/apache-tomcat-10.1.11/webapps/ROOT (the capitals are important)
>> and remove the  element from your server.xml.
>>
>> Then start your server and read the logs.
>>
>> > *nslookup alias.example.com 
>> > gives-->Non-authoritative answer:Name: www.example.com
>> > Address:  192.168.200.10Aliases:
>> alias.example.com
>> > *
>> >
>> >
>> > Just to give some information here, *www.example.com
>> > * has alias* "alias.example.com
>> > "*
>> > But https://www.example.com:/example --> works fine with out
>> issues but
>> > the alias doesnot works (https://alias.example.com)
>> > So i am not sure if the redirect url helps or if its correct
>>
>> Your rewrite configuration says that you have to be using host
>> "example.com" but your request goes to www.example.com. Your
>> configuration should only redirect a request such as:
>>
>> $ curl -v http://example.com:/something
>>
>> HTTP/1.1 301 Moved Permanently
>> ...
>> Location: https://www.example.com:/example
>>
>> If you make a request like:
>>
>> $ curl -v http://www.example.com:/something
>>
>> I wouldn't expect a redirect because of your "host" condition. The
>> "%{HTTP_HOST} example.com" looks at the entire Host header and not just
>> anything that ends in "example.com". You'd have to use a glob/regex if
>> you wanted to check for [anything and maybe nothing.]example.com.
>>
>> You'd also have to make sure that your application is serving responses
>> to requests to / which is why I'm recommending you use the ROOT web
>> application name instead of "towl".
>>
>> -chris
>>
>> > On Fri, Apr 19, 2024 at 1:21 PM Christopher Schultz <
>> > ch...@christopherschultz.net> wrote:
>> >
>> >> Ammu,
>> >>
>> >> On 4/18/24 09:34, lavanya tech wrote:
>> >>> I am attaching server.xml and context.xml and rewrite.config files.
>> >>> The paths are
>> >>>
>> >>> /git/app/apache-tomcat-10.1.11/webapps/towl/context.xml
>> >>> 
>> >>>   > className="org.apache.catalina.valves.rewrite.RewriteValve"
>> >> />
>> >>>   
>> >>> 
>> >>
>> >> This file ^^^ is in the wrong place. It should be in
>> >> /git/app/apache-tomcat-10.1.11/webapps/towl/META-INF/context.xml
>> >>
>> >>> /git/app/apache-tomcat-10.1.11/webapps/towl/WEB-INF/rewrite.config
>> >>>
>> >>> > >>> https://www.example.com:/example [R=301,L]
>> >>
>> >> Why do you have < symbols at the beginning of these lines?
>> >>
>> >>> server.xml
>> >>>
>> >>   > [...]
>> >>>
>> >>> > >>> autoDeploy="true">
>> >>> 
>> >>
>> >> It's best not to define any  in server.xml. I would remove
>> this
>> >>  entirely and allow Tomcat to auto-reploy from your
>> >> webapps/towl directory. If you need this application to be deployed as
>> >> the ROOT context (on / and not /towl) then you should re-name
>> >> /git/app/apache-tomcat-10.1.11/webapps/towl to
>> >> /git/app/apache-tomcat-10.1.11/webapps/ROOT
>> >>
>> >> You also don't need a  for example.com as well as adding an
>> >>  for the same domain (though this is probably to anonymize the
>> >> configuration). You can feel free to simply use the "localhost" 
>> >> as the default  and deploy everything into it. This makes your
>> >> configuration changes relative to a stock Tomcat less significant and
>> >> easier to apply to new versions if/when necessary.
>> >>
>> >> -chris
>> >>
>> >>> On Thu, Apr 18, 2024 at 2:17 PM Christopher Schultz <
>> >>> ch...@christopherschultz.net> wrote:
>> >>>
>>  Ammu,
>> 
>>  On 4/18/24 07:45, lavanya tech wrote:
>> > I added classname rewrite valeus in contex.xml file .
>> >
>> >
>> > 

Re: Regarding Tomcat url redirection

2024-04-22 Thread lavanya tech
Hi Chris,

Could you please explain, what you exactly mean ? So here redirect is not a
solution right ?

"You'd have to use a glob/regex if
you wanted to check for [anything and maybe nothing.]example.com."

Thanks,
ammu




On Fri, Apr 19, 2024 at 3:03 PM Christopher Schultz <
ch...@christopherschultz.net> wrote:

> Ammu,
>
> On 4/19/24 08:32, lavanya tech wrote:
> > Thank you very much. I removed  for example.com as well as adding
> an
> >  in server.xml
> > I copied context.xml file
> > /git/app/apache-tomcat-10.1.11/webapps/towl/META-INF/context.xml
> > Removed < in rewrite.config files.
> >
> > But still I dont redirect the URL.
>
> If you have  in server.xml and also your application in the
> webapps/ directory, then you will be double-deploying your application.
>
> Re-name /git/app/apache-tomcat-10.1.11/webapps/towl/ to be
> /git/app/apache-tomcat-10.1.11/webapps/ROOT (the capitals are important)
> and remove the  element from your server.xml.
>
> Then start your server and read the logs.
>
> > *nslookup alias.example.com 
> > gives-->Non-authoritative answer:Name: www.example.com
> > Address:  192.168.200.10Aliases:
> alias.example.com
> > *
> >
> >
> > Just to give some information here, *www.example.com
> > * has alias* "alias.example.com
> > "*
> > But https://www.example.com:/example --> works fine with out issues
> but
> > the alias doesnot works (https://alias.example.com)
> > So i am not sure if the redirect url helps or if its correct
>
> Your rewrite configuration says that you have to be using host
> "example.com" but your request goes to www.example.com. Your
> configuration should only redirect a request such as:
>
> $ curl -v http://example.com:/something
>
> HTTP/1.1 301 Moved Permanently
> ...
> Location: https://www.example.com:/example
>
> If you make a request like:
>
> $ curl -v http://www.example.com:/something
>
> I wouldn't expect a redirect because of your "host" condition. The
> "%{HTTP_HOST} example.com" looks at the entire Host header and not just
> anything that ends in "example.com". You'd have to use a glob/regex if
> you wanted to check for [anything and maybe nothing.]example.com.
>
> You'd also have to make sure that your application is serving responses
> to requests to / which is why I'm recommending you use the ROOT web
> application name instead of "towl".
>
> -chris
>
> > On Fri, Apr 19, 2024 at 1:21 PM Christopher Schultz <
> > ch...@christopherschultz.net> wrote:
> >
> >> Ammu,
> >>
> >> On 4/18/24 09:34, lavanya tech wrote:
> >>> I am attaching server.xml and context.xml and rewrite.config files.
> >>> The paths are
> >>>
> >>> /git/app/apache-tomcat-10.1.11/webapps/towl/context.xml
> >>> 
> >>>className="org.apache.catalina.valves.rewrite.RewriteValve"
> >> />
> >>>   
> >>> 
> >>
> >> This file ^^^ is in the wrong place. It should be in
> >> /git/app/apache-tomcat-10.1.11/webapps/towl/META-INF/context.xml
> >>
> >>> /git/app/apache-tomcat-10.1.11/webapps/towl/WEB-INF/rewrite.config
> >>>
> >>>  >>> https://www.example.com:/example [R=301,L]
> >>
> >> Why do you have < symbols at the beginning of these lines?
> >>
> >>> server.xml
> >>>
> >>   > [...]
> >>>
> >>>  >>> autoDeploy="true">
> >>> 
> >>
> >> It's best not to define any  in server.xml. I would remove this
> >>  entirely and allow Tomcat to auto-reploy from your
> >> webapps/towl directory. If you need this application to be deployed as
> >> the ROOT context (on / and not /towl) then you should re-name
> >> /git/app/apache-tomcat-10.1.11/webapps/towl to
> >> /git/app/apache-tomcat-10.1.11/webapps/ROOT
> >>
> >> You also don't need a  for example.com as well as adding an
> >>  for the same domain (though this is probably to anonymize the
> >> configuration). You can feel free to simply use the "localhost" 
> >> as the default  and deploy everything into it. This makes your
> >> configuration changes relative to a stock Tomcat less significant and
> >> easier to apply to new versions if/when necessary.
> >>
> >> -chris
> >>
> >>> On Thu, Apr 18, 2024 at 2:17 PM Christopher Schultz <
> >>> ch...@christopherschultz.net> wrote:
> >>>
>  Ammu,
> 
>  On 4/18/24 07:45, lavanya tech wrote:
> > I added classname rewrite valeus in contex.xml file .
> >
> >
> > >> className="org.apache.catalina.valves.rewrite.RewriteValve"
>  />
> >
> >
> > created rewrite.config so both of them is located under  conf under
> > apache-tomcat.
> >
> >
> > > > https://www.example.com:/example [R=301,L]
> >
> > So according to the documentaion they say context.xml should be
> placed
> > under webapps and rewrite.config file should be put in WEB-INF folder
> >> of
> > apache-tomcat . I placed 

Re: Regarding Tomcat url redirection

2024-04-19 Thread Christopher Schultz

Ammu,

On 4/19/24 08:32, lavanya tech wrote:

Thank you very much. I removed  for example.com as well as adding an
 in server.xml
I copied context.xml file
/git/app/apache-tomcat-10.1.11/webapps/towl/META-INF/context.xml
Removed < in rewrite.config files.

But still I dont redirect the URL.


If you have  in server.xml and also your application in the 
webapps/ directory, then you will be double-deploying your application.


Re-name /git/app/apache-tomcat-10.1.11/webapps/towl/ to be 
/git/app/apache-tomcat-10.1.11/webapps/ROOT (the capitals are important) 
and remove the  element from your server.xml.


Then start your server and read the logs.


*nslookup alias.example.com 
gives-->Non-authoritative answer:Name: www.example.com
Address:  192.168.200.10Aliases:  alias.example.com
*


Just to give some information here, *www.example.com
* has alias* "alias.example.com
"*
But https://www.example.com:/example --> works fine with out issues but
the alias doesnot works (https://alias.example.com)
So i am not sure if the redirect url helps or if its correct


Your rewrite configuration says that you have to be using host 
"example.com" but your request goes to www.example.com. Your 
configuration should only redirect a request such as:


$ curl -v http://example.com:/something

HTTP/1.1 301 Moved Permanently
...
Location: https://www.example.com:/example

If you make a request like:

$ curl -v http://www.example.com:/something

I wouldn't expect a redirect because of your "host" condition. The 
"%{HTTP_HOST} example.com" looks at the entire Host header and not just 
anything that ends in "example.com". You'd have to use a glob/regex if 
you wanted to check for [anything and maybe nothing.]example.com.


You'd also have to make sure that your application is serving responses 
to requests to / which is why I'm recommending you use the ROOT web 
application name instead of "towl".


-chris


On Fri, Apr 19, 2024 at 1:21 PM Christopher Schultz <
ch...@christopherschultz.net> wrote:


Ammu,

On 4/18/24 09:34, lavanya tech wrote:

I am attaching server.xml and context.xml and rewrite.config files.
The paths are

/git/app/apache-tomcat-10.1.11/webapps/towl/context.xml

  
/>

  



This file ^^^ is in the wrong place. It should be in
/git/app/apache-tomcat-10.1.11/webapps/towl/META-INF/context.xml


/git/app/apache-tomcat-10.1.11/webapps/towl/WEB-INF/rewrite.config

https://www.example.com:/example [R=301,L]


Why do you have < symbols at the beginning of these lines?


server.xml


  > [...]






It's best not to define any  in server.xml. I would remove this
 entirely and allow Tomcat to auto-reploy from your
webapps/towl directory. If you need this application to be deployed as
the ROOT context (on / and not /towl) then you should re-name
/git/app/apache-tomcat-10.1.11/webapps/towl to
/git/app/apache-tomcat-10.1.11/webapps/ROOT

You also don't need a  for example.com as well as adding an
 for the same domain (though this is probably to anonymize the
configuration). You can feel free to simply use the "localhost" 
as the default  and deploy everything into it. This makes your
configuration changes relative to a stock Tomcat less significant and
easier to apply to new versions if/when necessary.

-chris


On Thu, Apr 18, 2024 at 2:17 PM Christopher Schultz <
ch...@christopherschultz.net> wrote:


Ammu,

On 4/18/24 07:45, lavanya tech wrote:

I added classname rewrite valeus in contex.xml file .

   
   
className="org.apache.catalina.valves.rewrite.RewriteValve"

/>

   

created rewrite.config so both of them is located under  conf under
apache-tomcat.


   https://www.example.com:/example [R=301,L]

So according to the documentaion they say context.xml should be placed
under webapps and rewrite.config file should be put in WEB-INF folder

of

apache-tomcat . I placed and restarted tomcat webserver but still it
doesnot redirect.


Can you give full paths to both server.xml and rewrite.config, re-post
your current server.xml  element, and the complete contents of
rewrite.config?

Have you looked at the log files after start?

-chris


On Thu, Apr 18, 2024 at 1:36 PM lavanya tech 


wrote:


Hi Thomas,

Thanks for the fast response.

I added classname rewrite valeus in contex.xml file .

   
   
className="org.apache.catalina.valves.rewrite.RewriteValve"

/>

   

created rewrite.config so both of them is located under  conf under
apache-tomcat.

So according to the documentaion they say context.xml should be placed
under webapps and rewrite.config file should be put in WEB-INF folder

of

apache-tomcat

Thnks,
Ammu



On Thu, Apr 18, 2024 at 1:22 PM Mark Thomas  wrote:


On 18/04/2024 12:05, lavanya tech wrote:

Hi Team,

I am using "Tomcat 10.1" in our environment and I wanted to redirect


Re: Regarding Tomcat url redirection

2024-04-19 Thread lavanya tech
Hi Chris,

Thank you very much. I removed  for example.com as well as adding an
 in server.xml
I copied context.xml file
/git/app/apache-tomcat-10.1.11/webapps/towl/META-INF/context.xml
Removed < in rewrite.config files.

But still I dont redirect the URL.

For your information






*nslookup alias.example.com 
gives-->Non-authoritative answer:Name: www.example.com
Address:  192.168.200.10Aliases:  alias.example.com
*


Just to give some information here, *www.example.com
* has alias* "alias.example.com
"*
But https://www.example.com:/example --> works fine with out issues but
the alias doesnot works (https://alias.example.com)
So i am not sure if the redirect url helps or if its correct

Looking for some suggestions.

Thanks
Ammu

On Fri, Apr 19, 2024 at 1:21 PM Christopher Schultz <
ch...@christopherschultz.net> wrote:

> Ammu,
>
> On 4/18/24 09:34, lavanya tech wrote:
> > I am attaching server.xml and context.xml and rewrite.config files.
> > The paths are
> >
> > /git/app/apache-tomcat-10.1.11/webapps/towl/context.xml
> > 
> >   />
> >  
> > 
>
> This file ^^^ is in the wrong place. It should be in
> /git/app/apache-tomcat-10.1.11/webapps/towl/META-INF/context.xml
>
> > /git/app/apache-tomcat-10.1.11/webapps/towl/WEB-INF/rewrite.config
> >
> >  > https://www.example.com:/example [R=301,L]
>
> Why do you have < symbols at the beginning of these lines?
>
> > server.xml
> >
>  > [...]
> >
> > > autoDeploy="true">
> >
>
> It's best not to define any  in server.xml. I would remove this
>  entirely and allow Tomcat to auto-reploy from your
> webapps/towl directory. If you need this application to be deployed as
> the ROOT context (on / and not /towl) then you should re-name
> /git/app/apache-tomcat-10.1.11/webapps/towl to
> /git/app/apache-tomcat-10.1.11/webapps/ROOT
>
> You also don't need a  for example.com as well as adding an
>  for the same domain (though this is probably to anonymize the
> configuration). You can feel free to simply use the "localhost" 
> as the default  and deploy everything into it. This makes your
> configuration changes relative to a stock Tomcat less significant and
> easier to apply to new versions if/when necessary.
>
> -chris
>
> > On Thu, Apr 18, 2024 at 2:17 PM Christopher Schultz <
> > ch...@christopherschultz.net> wrote:
> >
> >> Ammu,
> >>
> >> On 4/18/24 07:45, lavanya tech wrote:
> >>> I added classname rewrite valeus in contex.xml file .
> >>>
> >>>   
> >>>className="org.apache.catalina.valves.rewrite.RewriteValve"
> >> />
> >>>   
> >>>
> >>> created rewrite.config so both of them is located under  conf under
> >>> apache-tomcat.
> >>>
> >>>
> >>>>>>>>> https://www.example.com:/example [R=301,L]
> >>>
> >>> So according to the documentaion they say context.xml should be placed
> >>> under webapps and rewrite.config file should be put in WEB-INF folder
> of
> >>> apache-tomcat . I placed and restarted tomcat webserver but still it
> >>> doesnot redirect.
> >>
> >> Can you give full paths to both server.xml and rewrite.config, re-post
> >> your current server.xml  element, and the complete contents of
> >> rewrite.config?
> >>
> >> Have you looked at the log files after start?
> >>
> >> -chris
> >>
> >>> On Thu, Apr 18, 2024 at 1:36 PM lavanya tech  >
> >>> wrote:
> >>>
>  Hi Thomas,
> 
>  Thanks for the fast response.
> 
>  I added classname rewrite valeus in contex.xml file .
> 
>    
> className="org.apache.catalina.valves.rewrite.RewriteValve"
> >> />
>    
> 
>  created rewrite.config so both of them is located under  conf under
>  apache-tomcat.
> 
>  So according to the documentaion they say context.xml should be placed
>  under webapps and rewrite.config file should be put in WEB-INF folder
> of
>  apache-tomcat
> 
>  Thnks,
>  Ammu
> 
> 
> 
>  On Thu, Apr 18, 2024 at 1:22 PM Mark Thomas  wrote:
> 
> > On 18/04/2024 12:05, lavanya tech wrote:
> >> Hi Team,
> >>
> >> I am using "Tomcat 10.1" in our environment and I wanted to redirect
> >> url
> >> from https://example.com to https://www.servercom: and for
> this i
> >> modified the server.xml as below in tomcat config, and the below
> >> configuration doesnot seems to work. Does anyone has ideas. Please
> > suggest.
> >> The url alone https://www.servercom:/ already works. But just
> >> redirection from the old to one doesnot.
> >>
> >>  > autoDeploy="true">
> >>
> >>example.com
> >>
> >> > className="org.apache.catalina.valves.rewrite.RewriteValve"/>
> >>
> >> >> autoDeploy="true">
> >>
> >>   

Re: Regarding Tomcat url redirection

2024-04-19 Thread Christopher Schultz

Ammu,

On 4/18/24 09:34, lavanya tech wrote:

I am attaching server.xml and context.xml and rewrite.config files.
The paths are

/git/app/apache-tomcat-10.1.11/webapps/towl/context.xml

 
 



This file ^^^ is in the wrong place. It should be in 
/git/app/apache-tomcat-10.1.11/webapps/towl/META-INF/context.xml



/git/app/apache-tomcat-10.1.11/webapps/towl/WEB-INF/rewrite.config

https://www.example.com:/example [R=301,L]


Why do you have < symbols at the beginning of these lines?


server.xml


> [...]


   
   


It's best not to define any  in server.xml. I would remove this 
 entirely and allow Tomcat to auto-reploy from your 
webapps/towl directory. If you need this application to be deployed as 
the ROOT context (on / and not /towl) then you should re-name 
/git/app/apache-tomcat-10.1.11/webapps/towl to 
/git/app/apache-tomcat-10.1.11/webapps/ROOT


You also don't need a  for example.com as well as adding an 
 for the same domain (though this is probably to anonymize the 
configuration). You can feel free to simply use the "localhost"  
as the default  and deploy everything into it. This makes your 
configuration changes relative to a stock Tomcat less significant and 
easier to apply to new versions if/when necessary.


-chris


On Thu, Apr 18, 2024 at 2:17 PM Christopher Schultz <
ch...@christopherschultz.net> wrote:


Ammu,

On 4/18/24 07:45, lavanya tech wrote:

I added classname rewrite valeus in contex.xml file .

  
  
/>

  

created rewrite.config so both of them is located under  conf under
apache-tomcat.


  https://www.example.com:/example [R=301,L]

So according to the documentaion they say context.xml should be placed
under webapps and rewrite.config file should be put in WEB-INF folder of
apache-tomcat . I placed and restarted tomcat webserver but still it
doesnot redirect.


Can you give full paths to both server.xml and rewrite.config, re-post
your current server.xml  element, and the complete contents of
rewrite.config?

Have you looked at the log files after start?

-chris


On Thu, Apr 18, 2024 at 1:36 PM lavanya tech 
wrote:


Hi Thomas,

Thanks for the fast response.

I added classname rewrite valeus in contex.xml file .

  
  
/>

  

created rewrite.config so both of them is located under  conf under
apache-tomcat.

So according to the documentaion they say context.xml should be placed
under webapps and rewrite.config file should be put in WEB-INF folder of
apache-tomcat

Thnks,
Ammu



On Thu, Apr 18, 2024 at 1:22 PM Mark Thomas  wrote:


On 18/04/2024 12:05, lavanya tech wrote:

Hi Team,

I am using "Tomcat 10.1" in our environment and I wanted to redirect

url

from https://example.com to https://www.servercom: and for this i
modified the server.xml as below in tomcat config, and the below
configuration doesnot seems to work. Does anyone has ideas. Please

suggest.

The url alone https://www.servercom:/ already works. But just
redirection from the old to one doesnot.


autoDeploy="true">

   
   example.com
   
   
className="org.apache.catalina.valves.rewrite.RewriteValve"/>

   
   
   
   example.com
   
className="org.apache.catalina.valves.rewrite.RewriteValve"/>

   
   
   
   example.com
   
   https://www.servercom:/example/$1 [R=301,L]


1. That isn't valid XML.

2. Where in the Tomcat docs does it say you can nest re-write rules in

a

Host element (or any other element)?


   
   
   
   



You need to configure the RewriteValve.
https://tomcat.apache.org/tomcat-10.1-doc/rewrite.html

Mark

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org






-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org






-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Regarding Tomcat url redirection

2024-04-18 Thread lavanya tech
Hi Chris,

Thanks for message,

I am attaching server.xml and context.xml and rewrite.config files.
The paths are

/git/app/apache-tomcat-10.1.11/webapps/towl/context.xml





/git/app/apache-tomcat-10.1.11/webapps/towl/WEB-INF/rewrite.config

https://www.example.com:/example [R=301,L]

server.xml






  
  
  
  
  
  
  
  

  
  


  

  
  



























  
  

  
  


  

  
  
  example.com
  
  







  

  


Thanks
Ammu

On Thu, Apr 18, 2024 at 2:17 PM Christopher Schultz <
ch...@christopherschultz.net> wrote:

> Ammu,
>
> On 4/18/24 07:45, lavanya tech wrote:
> > I added classname rewrite valeus in contex.xml file .
> >
> >  
> >   />
> >  
> >
> > created rewrite.config so both of them is located under  conf under
> > apache-tomcat.
> >
> >
> >   >   > https://www.example.com:/example [R=301,L]
> >
> > So according to the documentaion they say context.xml should be placed
> > under webapps and rewrite.config file should be put in WEB-INF folder of
> > apache-tomcat . I placed and restarted tomcat webserver but still it
> > doesnot redirect.
>
> Can you give full paths to both server.xml and rewrite.config, re-post
> your current server.xml  element, and the complete contents of
> rewrite.config?
>
> Have you looked at the log files after start?
>
> -chris
>
> > On Thu, Apr 18, 2024 at 1:36 PM lavanya tech 
> > wrote:
> >
> >> Hi Thomas,
> >>
> >> Thanks for the fast response.
> >>
> >> I added classname rewrite valeus in contex.xml file .
> >>
> >>  
> >>   />
> >>  
> >>
> >> created rewrite.config so both of them is located under  conf under
> >> apache-tomcat.
> >>
> >> So according to the documentaion they say context.xml should be placed
> >> under webapps and rewrite.config file should be put in WEB-INF folder of
> >> apache-tomcat
> >>
> >> Thnks,
> >> Ammu
> >>
> >>
> >>
> >> On Thu, Apr 18, 2024 at 1:22 PM Mark Thomas  wrote:
> >>
> >>> On 18/04/2024 12:05, lavanya tech wrote:
>  Hi Team,
> 
>  I am using "Tomcat 10.1" in our environment and I wanted to redirect
> url
>  from https://example.com to https://www.servercom: and for this i
>  modified the server.xml as below in tomcat config, and the below
>  configuration doesnot seems to work. Does anyone has ideas. Please
> >>> suggest.
>  The url alone https://www.servercom:/ already works. But just
>  redirection from the old to one doesnot.
> 
>   >>> autoDeploy="true">
>    
>    example.com
>    
> >>> className="org.apache.catalina.valves.rewrite.RewriteValve"/>
>    
>  autoDeploy="true">
>    
>    example.com
> >>> className="org.apache.catalina.valves.rewrite.RewriteValve"/>
>    
>  unpackWARs="true" autoDeploy="true">
>    
>    example.com
>    
>  https://www.servercom:/example/$1 [R=301,L]
> >>>
> >>> 1. That isn't valid XML.
> >>>
> >>> 2. Where in the Tomcat docs does it say you can nest re-write rules in
> a
> >>> Host element (or any other element)?
> >>>
>    
>    
>    
>    
>  
> >>>
> >>> You need to configure the RewriteValve.
> >>> https://tomcat.apache.org/tomcat-10.1-doc/rewrite.html
> >>>
> >>> Mark
> >>>
> >>> -
> >>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> >>> For additional commands, e-mail: users-h...@tomcat.apache.org
> >>>
> >>>
> >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: Regarding Tomcat url redirection

2024-04-18 Thread Christopher Schultz

Ammu,

On 4/18/24 07:45, lavanya tech wrote:

I added classname rewrite valeus in contex.xml file .

 
 
 

created rewrite.config so both of them is located under  conf under
apache-tomcat.


 https://www.example.com:/example [R=301,L]

So according to the documentaion they say context.xml should be placed
under webapps and rewrite.config file should be put in WEB-INF folder of
apache-tomcat . I placed and restarted tomcat webserver but still it
doesnot redirect.


Can you give full paths to both server.xml and rewrite.config, re-post 
your current server.xml  element, and the complete contents of 
rewrite.config?


Have you looked at the log files after start?

-chris


On Thu, Apr 18, 2024 at 1:36 PM lavanya tech 
wrote:


Hi Thomas,

Thanks for the fast response.

I added classname rewrite valeus in contex.xml file .

 
 
 

created rewrite.config so both of them is located under  conf under
apache-tomcat.

So according to the documentaion they say context.xml should be placed
under webapps and rewrite.config file should be put in WEB-INF folder of
apache-tomcat

Thnks,
Ammu



On Thu, Apr 18, 2024 at 1:22 PM Mark Thomas  wrote:


On 18/04/2024 12:05, lavanya tech wrote:

Hi Team,

I am using "Tomcat 10.1" in our environment and I wanted to redirect url
from https://example.com to https://www.servercom: and for this i
modified the server.xml as below in tomcat config, and the below
configuration doesnot seems to work. Does anyone has ideas. Please

suggest.

The url alone https://www.servercom:/ already works. But just
redirection from the old to one doesnot.


autoDeploy="true">

  
  example.com
  
  
className="org.apache.catalina.valves.rewrite.RewriteValve"/>

  
  
  
  example.com
  
className="org.apache.catalina.valves.rewrite.RewriteValve"/>

  
  
  
  example.com
  
  https://www.servercom:/example/$1 [R=301,L]


1. That isn't valid XML.

2. Where in the Tomcat docs does it say you can nest re-write rules in a
Host element (or any other element)?


  
  
  
  



You need to configure the RewriteValve.
https://tomcat.apache.org/tomcat-10.1-doc/rewrite.html

Mark

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org






-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Regarding Tomcat url redirection

2024-04-18 Thread lavanya tech
Hi Thomas,

Thanks for the fast response.

I added classname rewrite valeus in contex.xml file .





created rewrite.config so both of them is located under  conf under
apache-tomcat.


https://www.example.com:/example [R=301,L]

So according to the documentaion they say context.xml should be placed
under webapps and rewrite.config file should be put in WEB-INF folder of
apache-tomcat . I placed and restarted tomcat webserver but still it
doesnot redirect.


Thnks,
Ammu

On Thu, Apr 18, 2024 at 1:36 PM lavanya tech 
wrote:

> Hi Thomas,
>
> Thanks for the fast response.
>
> I added classname rewrite valeus in contex.xml file .
>
> 
> 
> 
>
> created rewrite.config so both of them is located under  conf under
> apache-tomcat.
>
> So according to the documentaion they say context.xml should be placed
> under webapps and rewrite.config file should be put in WEB-INF folder of
> apache-tomcat
>
> Thnks,
> Ammu
>
>
>
> On Thu, Apr 18, 2024 at 1:22 PM Mark Thomas  wrote:
>
>> On 18/04/2024 12:05, lavanya tech wrote:
>> > Hi Team,
>> >
>> > I am using "Tomcat 10.1" in our environment and I wanted to redirect url
>> > from https://example.com to https://www.servercom: and for this i
>> > modified the server.xml as below in tomcat config, and the below
>> > configuration doesnot seems to work. Does anyone has ideas. Please
>> suggest.
>> > The url alone https://www.servercom:/ already works. But just
>> > redirection from the old to one doesnot.
>> >
>> > > autoDeploy="true">
>> >  
>> >  example.com
>> >  
>> >  > className="org.apache.catalina.valves.rewrite.RewriteValve"/>
>> >  
>> >  > > autoDeploy="true">
>> >  
>> >  example.com
>> >  > className="org.apache.catalina.valves.rewrite.RewriteValve"/>
>> >  
>> >  > > unpackWARs="true" autoDeploy="true">
>> >  
>> >  example.com
>> >  
>> >  > >  > > https://www.servercom:/example/$1 [R=301,L]
>>
>> 1. That isn't valid XML.
>>
>> 2. Where in the Tomcat docs does it say you can nest re-write rules in a
>> Host element (or any other element)?
>>
>> >  
>> >  
>> >  
>> >  
>> > 
>>
>> You need to configure the RewriteValve.
>> https://tomcat.apache.org/tomcat-10.1-doc/rewrite.html
>>
>> Mark
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>
>>


Re: Regarding Tomcat url redirection

2024-04-18 Thread lavanya tech
Hi Thomas,

Thanks for the fast response.

I added classname rewrite valeus in contex.xml file .





created rewrite.config so both of them is located under  conf under
apache-tomcat.

So according to the documentaion they say context.xml should be placed
under webapps and rewrite.config file should be put in WEB-INF folder of
apache-tomcat

Thnks,
Ammu



On Thu, Apr 18, 2024 at 1:22 PM Mark Thomas  wrote:

> On 18/04/2024 12:05, lavanya tech wrote:
> > Hi Team,
> >
> > I am using "Tomcat 10.1" in our environment and I wanted to redirect url
> > from https://example.com to https://www.servercom: and for this i
> > modified the server.xml as below in tomcat config, and the below
> > configuration doesnot seems to work. Does anyone has ideas. Please
> suggest.
> > The url alone https://www.servercom:/ already works. But just
> > redirection from the old to one doesnot.
> >
> >  autoDeploy="true">
> >  
> >  example.com
> >  
> >  
> >  
> >   > autoDeploy="true">
> >  
> >  example.com
> >   className="org.apache.catalina.valves.rewrite.RewriteValve"/>
> >  
> >   > unpackWARs="true" autoDeploy="true">
> >  
> >  example.com
> >  
> >   >   > https://www.servercom:/example/$1 [R=301,L]
>
> 1. That isn't valid XML.
>
> 2. Where in the Tomcat docs does it say you can nest re-write rules in a
> Host element (or any other element)?
>
> >  
> >  
> >  
> >  
> > 
>
> You need to configure the RewriteValve.
> https://tomcat.apache.org/tomcat-10.1-doc/rewrite.html
>
> Mark
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: Regarding Tomcat url redirection

2024-04-18 Thread Mark Thomas

On 18/04/2024 12:05, lavanya tech wrote:

Hi Team,

I am using "Tomcat 10.1" in our environment and I wanted to redirect url
from https://example.com to https://www.servercom: and for this i
modified the server.xml as below in tomcat config, and the below
configuration doesnot seems to work. Does anyone has ideas. Please suggest.
The url alone https://www.servercom:/ already works. But just
redirection from the old to one doesnot.


 
 example.com
 
 
 
 
 
 example.com
 
 
 
 
 example.com
 
 https://www.servercom:/example/$1 [R=301,L]


1. That isn't valid XML.

2. Where in the Tomcat docs does it say you can nest re-write rules in a 
Host element (or any other element)?



 
 
 
 



You need to configure the RewriteValve.
https://tomcat.apache.org/tomcat-10.1-doc/rewrite.html

Mark

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Regarding Tomcat url redirection

2024-04-18 Thread lavanya tech
Hi Team,

I am using "Tomcat 10.1" in our environment and I wanted to redirect url
from https://example.com to https://www.servercom: and for this i
modified the server.xml as below in tomcat config, and the below
configuration doesnot seems to work. Does anyone has ideas. Please suggest.
The url alone https://www.servercom:/ already works. But just
redirection from the old to one doesnot.



example.com





example.com




example.com

https://www.servercom:/example/$1 [R=301,L]








Thanks,
Ammu


Tomcat url redirection

2010-09-21 Thread rujin raj
*Support team,
*
*
*
*
I'm working with an application that uses apache tomcat 6 to serve the
website. I've installed the application and tomcat on a Windows 2003
server and everything is working fine.For instance I want
http://events.mydomain.xxx/ to
go to http://events.mydomain.xxx/myapp.Moreover whenever i type the Public
IP address (http://xxx.yyy.zzz.aaa) instead of
events.mydomain.xxx should also redirect to
  http://events.mydomain.xxx/myapp.

Any ideas how I might do this with apache tomcat would be very helpful
and appreciated.

Thank you in advance.

Regards
rujinraj
*


Re: Tomcat url redirection

2010-09-21 Thread michel

http://tuckey.org



- Original Message - 
From: rujin raj rujin...@gmail.com

To: users@tomcat.apache.org
Sent: Tuesday, September 21, 2010 2:22 PM
Subject: Tomcat url redirection



*Support team,
*
*
*
*
I'm working with an application that uses apache tomcat 6 to serve the
website. I've installed the application and tomcat on a Windows 2003
server and everything is working fine.For instance I want
http://events.mydomain.xxx/ to
go to http://events.mydomain.xxx/myapp.Moreover whenever i type the Public
IP address (http://xxx.yyy.zzz.aaa) instead of
events.mydomain.xxx should also redirect to
 http://events.mydomain.xxx/myapp.

Any ideas how I might do this with apache tomcat would be very helpful
and appreciated.

Thank you in advance.

Regards
rujinraj
*




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat url redirection

2010-09-21 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Rujin,

On 9/21/2010 2:22 PM, rujin raj wrote:
 Moreover whenever i type the Public
 IP address (http://xxx.yyy.zzz.aaa) instead of
 events.mydomain.xxx should also redirect to
   http://events.mydomain.xxx/myapp.

See Michel's response for redirection. If you want IP - hostname
switching, set up a rule that looks for a non-preferred Host header
and issues a redirect.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkyZBE4ACgkQ9CaO5/Lv0PBNsQCeLQH8l961InR8mM0Z7vzp/LtV
GJEAoIrYnOoVKegQqMgOYEvHoIQa4oal
=52TO
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Tomcat url redirection

2010-09-21 Thread Caldarale, Charles R
 From: rujin raj [mailto:rujin...@gmail.com] 
 Subject: Tomcat url redirection

 I want http://events.mydomain.xxx/ to
 go to http://events.mydomain.xxx/myapp.

Then name your webapp ROOT (case sensitive, even on Windows), not myapp, just 
as the Tomcat doc says to do.

 Moreover whenever i type the Public
 IP address (http://xxx.yyy.zzz.aaa) instead of
 events.mydomain.xxx should also redirect to
 http://events.mydomain.xxx/myapp.

That will happen automatically if events.mydomain.xxx and xxx.yyy.zzz.aaa both 
map to an IP address on the server on which Tomcat runs, *and* you have Tomcat 
listening on address 0.0.0.0 (the default), *and* you rename your app to ROOT, 
as noted above.

No rewrite filters are required if you set things up properly.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: HTTPConnector url redirection

2008-08-22 Thread David Smith
Just as a thought, but I've seen on occasion where Firefox in particular 
will offer up cached content when something goes haywire with the 
request.  As a test, when you drop the s from https (leaving the port 
number on the end), try to reload w/ the shift key down to force your 
browser to drop cached content in favor of fresh material.  I'm willing 
to bet it'll just give you garbage because the server will offer up a 
SSL handshake and the browser will accept it as an html response.


Now if your URLs didn't have the port numbers in them (tomcat using port 
80 for http and 443 for https) and you dropped the s from https, the 
browser would connect on port 80 instead of 443 and the redirection 
would happen again the way you are expecting.


--David

raveendra wrote:

Yes i am sure, initially when i type my default url
http://localhost:8080/myapp/start.action
it is getting redirected to https://localhost:8443/myapp/start.action.

But after accepting certificate and page is loaded if i remove s from
redirected url it is still
loading the page.It shouldn't even connect to the server as you said.I want
it to happen if any one remove s and try to reload the page.

Note : http://localhost:8443/myapp/start.action in this url the port no is
secure port no.Here with http as protocol we are trying to connect to a port
which is https.

Could you please help me?

Thanks for your reply,

On Thu, Aug 21, 2008 at 10:34 PM, Christopher Schultz 
[EMAIL PROTECTED] wrote:

  

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Raveendra,

raveendra wrote:


But after accepting the certificate and loading the page.If i change my
  

url


to http://localhost:8443/myapp/start.action just by removing 's' it is
loading the pages
with some GUI errors and after traversing couple of pages it is logging
out.
  

Are you sure? Trying to get your web browser to connect using HTTP to a
server expecting HTTPS should not even be able to make a connection,
much less give you broken pages.

Can you double-check all URLs and be very careful about copying and
pasting them?

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkitoCYACgkQ9CaO5/Lv0PD9DwCffAfZwA4DgY3E5xmr11vFBsZK
y1sAoMBW9x5JRnzrVQUALWow40fod3eQ
=nlbZ
-END PGP SIGNATURE-





-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



HTTPConnector url redirection

2008-08-21 Thread raveendra
Hi all,

I am want to run my entire application on https which is developed using
struts2.So i configured my server.xml and web.xml as shown below.

server.xml
   Connector port=8080 protocol=HTTP/1.1
   maxThreads=150 connectionTimeout=2
   redirectPort=8443 /

 Connector  port=8443 protocol=HTTP/1.1
  minSpareThreads=5 maxSpareThreads=75
  enableLookups=true disableUploadTimeout=true
  acceptCount=100 maxThreads=200
  scheme=https secure=true SSLEnabled=true
  keystoreFile=C:/Tomcat 6.0/conf/airo/.keystore
keystorePass=mypassword
  clientAuth=false sslProtocol=SSL/

Connector port=8009 protocol=AJP/1.3 redirectPort=8443 /

web.xml--
security-constraint
web-resource-collection
web-resource-nameama/web-resource-name
url-pattern/*/url-pattern
/web-resource-collection
user-data-constraint
transport-guaranteeCONFIDENTIAL/transport-guarantee
/user-data-constraint
/security-constraint

when i type url http://localhost:8080/myapp/start.action it is getting
redirected to https://localhost:8443/myapp/start.action.
But after accepting the certificate and loading the page.If i change my url
to http://localhost:8443/myapp/start.action just by removing 's' it is
loading the pages
with some GUI errors and after traversing couple of pages it is logging
out.I don't want it to happen.

When user remove 's' from url i want to redirect to same url with
https.Suppose if they remove 's' and it is
http://localhost:8080/myapp/start.action and load the page
i want it to redirected to https://localhost:8080/myapp/start.action.


Re: HTTPConnector url redirection

2008-08-21 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Raveendra,

raveendra wrote:
 But after accepting the certificate and loading the page.If i change my url
 to http://localhost:8443/myapp/start.action just by removing 's' it is
 loading the pages
 with some GUI errors and after traversing couple of pages it is logging
 out.

Are you sure? Trying to get your web browser to connect using HTTP to a
server expecting HTTPS should not even be able to make a connection,
much less give you broken pages.

Can you double-check all URLs and be very careful about copying and
pasting them?

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkitoCYACgkQ9CaO5/Lv0PD9DwCffAfZwA4DgY3E5xmr11vFBsZK
y1sAoMBW9x5JRnzrVQUALWow40fod3eQ
=nlbZ
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: HTTPConnector url redirection

2008-08-21 Thread raveendra
Yes i am sure, initially when i type my default url
http://localhost:8080/myapp/start.action
it is getting redirected to https://localhost:8443/myapp/start.action.

But after accepting certificate and page is loaded if i remove s from
redirected url it is still
loading the page.It shouldn't even connect to the server as you said.I want
it to happen if any one remove s and try to reload the page.

Note : http://localhost:8443/myapp/start.action in this url the port no is
secure port no.Here with http as protocol we are trying to connect to a port
which is https.

Could you please help me?

Thanks for your reply,

On Thu, Aug 21, 2008 at 10:34 PM, Christopher Schultz 
[EMAIL PROTECTED] wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Raveendra,

 raveendra wrote:
  But after accepting the certificate and loading the page.If i change my
 url
  to http://localhost:8443/myapp/start.action just by removing 's' it is
  loading the pages
  with some GUI errors and after traversing couple of pages it is logging
  out.

 Are you sure? Trying to get your web browser to connect using HTTP to a
 server expecting HTTPS should not even be able to make a connection,
 much less give you broken pages.

 Can you double-check all URLs and be very careful about copying and
 pasting them?

 - -chris
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.9 (MingW32)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

 iEYEARECAAYFAkitoCYACgkQ9CaO5/Lv0PD9DwCffAfZwA4DgY3E5xmr11vFBsZK
 y1sAoMBW9x5JRnzrVQUALWow40fod3eQ
 =nlbZ
 -END PGP SIGNATURE-

 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




url redirection

2008-03-27 Thread Melanie Pfefer
Hi,

I have 2 web apps deployed on 2 tomcat servers. How to
redirect urls that contains ‘jar’ string from one app
to another?

http://zeus:8085/web/sec:jar:001
to
http://zeus:8086/src/web:sec:jar:001

thanks


  __
Sent from Yahoo! Mail.
More Ways to Keep in Touch. http://uk.docs.yahoo.com/nowyoucan.html

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RES: url redirection

2008-03-27 Thread Milanez, Marcus
Hi,

I'm not completely sure about what you want, but you can redirect urls 
according to a given pattern between tomcat instances using jakarta connectors. 
 Is that what you want? You can have further info here 
http://tomcat.apache.org/connectors-doc/

Yours,

Marcus

-Mensagem original-
De: Melanie Pfefer [mailto:[EMAIL PROTECTED] 
Enviada em: quinta-feira, 27 de março de 2008 07:32
Para: users@tomcat.apache.org
Assunto: url redirection

Hi,

I have 2 web apps deployed on 2 tomcat servers. How to redirect urls that 
contains 'jar' string from one app to another?

http://zeus:8085/web/sec:jar:001
to
http://zeus:8086/src/web:sec:jar:001

thanks


  __
Sent from Yahoo! Mail.
More Ways to Keep in Touch. http://uk.docs.yahoo.com/nowyoucan.html

-
To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: 
[EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: RES: url redirection

2008-03-27 Thread Melanie Pfefer
Hi,

thanks for your reply. what I want is to redirect 

http://zeus:8085/web/sec:jar:001

to


http://zeus:8086/src/web:sec:jar:001

The first one is on apache
the 2nd one is on tomcat

thanks again
--- Milanez, Marcus [EMAIL PROTECTED]
wrote:

 Hi,
 
 I'm not completely sure about what you want, but you
 can redirect urls according to a given pattern
 between tomcat instances using jakarta connectors. 
 Is that what you want? You can have further info
 here http://tomcat.apache.org/connectors-doc/
 
 Yours,
 
 Marcus
 
 -Mensagem original-
 De: Melanie Pfefer
 [mailto:[EMAIL PROTECTED] 
 Enviada em: quinta-feira, 27 de março de 2008 07:32
 Para: users@tomcat.apache.org
 Assunto: url redirection
 
 Hi,
 
 I have 2 web apps deployed on 2 tomcat servers. How
 to redirect urls that contains 'jar' string from one
 app to another?
 
 http://zeus:8085/web/sec:jar:001
 to
 http://zeus:8086/src/web:sec:jar:001
 
 thanks
 
 
  

__
 Sent from Yahoo! Mail.
 More Ways to Keep in Touch.
 http://uk.docs.yahoo.com/nowyoucan.html
 

-
 To start a new topic, e-mail:
 users@tomcat.apache.org To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, e-mail:
 [EMAIL PROTECTED]
 
 

-
 To start a new topic, e-mail:
 users@tomcat.apache.org
 To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, e-mail:
 [EMAIL PROTECTED]
 
 



  ___ 
Yahoo! For Good helps you make a difference  

http://uk.promotions.yahoo.com/forgood/

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: RES: url redirection

2008-03-27 Thread Christopher Schultz

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Melanie,

Melanie Pfefer wrote:
| thanks for your reply. what I want is to redirect
|
| http://zeus:8085/web/sec:jar:001
|
| to
|
|
| http://zeus:8086/src/web:sec:jar:001
|
| The first one is on apache
| the 2nd one is on tomcat

If you are using apache, you should check the RedirectMatch directive.
You can use it to send redirects for certain regular expressions, and
use back-references for the redirected URL. I think this is exactly what
you want.

- -chris

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.8 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkfruW0ACgkQ9CaO5/Lv0PDwfACcCZSm5CPDohwsupHtVM0ogqon
pZQAniWoQ55YanvgWWaKNcaaP4JRVtB3
=h+Hk
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: RES: url redirection

2008-03-27 Thread ChrisS
Melanie are you using FreeBSD or OpenBSD? I am going back a bit but I 
remember using Zeus on OpenBSD.


The way I set up clustering recently was through a workers.properties file 
which I stored in the apache/conf subdirectory. To start with you have to 
make sure all the prerequisites are in place. If you are using a version of 
Apache that supports it you need to DSO the mod_jk module into this (if you 
haven't done this already) with 
./configure --with-apxs=/usr/local/apache/bin/apxs. This won't work unless 
you have mod_ssl installed !make sure the version you have supports it!. For 
example if you are using an APACI version, you may face problems. If you do 
have mod_ssl installed and are witnessing problems note the error whilst 
trying to launch Apache. I witnessed numerous errors whilst trying to build 
1.3.39, 1.3.4, 2.0.x 2.2.x this way.


- Original Message - 
From: Melanie Pfefer [EMAIL PROTECTED]

To: Tomcat Users List users@tomcat.apache.org
Sent: Thursday, March 27, 2008 12:31 PM
Subject: Re: RES: url redirection



Hi,

thanks for your reply. what I want is to redirect

http://zeus:8085/web/sec:jar:001

to


http://zeus:8086/src/web:sec:jar:001

The first one is on apache
the 2nd one is on tomcat

thanks again
--- Milanez, Marcus [EMAIL PROTECTED]
wrote:


Hi,

I'm not completely sure about what you want, but you
can redirect urls according to a given pattern
between tomcat instances using jakarta connectors.
Is that what you want? You can have further info
here http://tomcat.apache.org/connectors-doc/

Yours,

Marcus

-Mensagem original-
De: Melanie Pfefer
[mailto:[EMAIL PROTECTED]
Enviada em: quinta-feira, 27 de março de 2008 07:32
Para: users@tomcat.apache.org
Assunto: url redirection

Hi,

I have 2 web apps deployed on 2 tomcat servers. How
to redirect urls that contains 'jar' string from one
app to another?

http://zeus:8085/web/sec:jar:001
to
http://zeus:8086/src/web:sec:jar:001

thanks





__

Sent from Yahoo! Mail.
More Ways to Keep in Touch.
http://uk.docs.yahoo.com/nowyoucan.html



-

To start a new topic, e-mail:
users@tomcat.apache.org To unsubscribe, e-mail:
[EMAIL PROTECTED]
For additional commands, e-mail:
[EMAIL PROTECTED]




-

To start a new topic, e-mail:
users@tomcat.apache.org
To unsubscribe, e-mail:
[EMAIL PROTECTED]
For additional commands, e-mail:
[EMAIL PROTECTED]






 ___
Yahoo! For Good helps you make a difference

http://uk.promotions.yahoo.com/forgood/

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: RES: url redirection

2008-03-27 Thread Melanie Pfefer
Hello
Actually I was able to define a rewrite rule in
apache:

RewriteRule ^/(.*web:jar.*) http://zeus:8086/src/$1
[R=301,L]

now
http://zeus/web:jar:001
redirects to
http://zeus:8086/src/web:jar:001

But if I tried to change the flag to P (proxy) in
httpd.conf
the apache error file gives:
[Thu Mar 27 17:18:58 2008] [error] [client
172.21.194.71] File does not exist:
/usr/local/apache2/htdocs/src, referer:
http://zeus/web:jar:001

the tomcat gives:

Your request is: http://zeus:8086/src/web:jar:001
Patj info is: web:jar:001
Session (1A578677550D1A75793540B152A8D6B6) has been
added to the list of valid Sessions
MY path info in treeview is: web:jar:001


I suspect I should something on tomcat to all this
operation. right?

I am using Solaris 10 - apache 2.2.4 and tomcat 6


--- ChrisS [EMAIL PROTECTED] wrote:

 Melanie are you using FreeBSD or OpenBSD? I am going
 back a bit but I 
 remember using Zeus on OpenBSD.
 
 The way I set up clustering recently was through a
 workers.properties file 
 which I stored in the apache/conf subdirectory. To
 start with you have to 
 make sure all the prerequisites are in place. If you
 are using a version of 
 Apache that supports it you need to DSO the mod_jk
 module into this (if you 
 haven't done this already) with 
 ./configure
 --with-apxs=/usr/local/apache/bin/apxs. This won't
 work unless 
 you have mod_ssl installed !make sure the version
 you have supports it!. For 
 example if you are using an APACI version, you may
 face problems. If you do 
 have mod_ssl installed and are witnessing problems
 note the error whilst 
 trying to launch Apache. I witnessed numerous errors
 whilst trying to build 
 1.3.39, 1.3.4, 2.0.x 2.2.x this way.
 
 - Original Message - 
 From: Melanie Pfefer [EMAIL PROTECTED]
 To: Tomcat Users List users@tomcat.apache.org
 Sent: Thursday, March 27, 2008 12:31 PM
 Subject: Re: RES: url redirection
 
 
  Hi,
 
  thanks for your reply. what I want is to redirect
 
  http://zeus:8085/web/sec:jar:001
 
  to
 
 
  http://zeus:8086/src/web:sec:jar:001
 
  The first one is on apache
  the 2nd one is on tomcat
 
  thanks again
  --- Milanez, Marcus [EMAIL PROTECTED]
  wrote:
 
  Hi,
 
  I'm not completely sure about what you want, but
 you
  can redirect urls according to a given pattern
  between tomcat instances using jakarta
 connectors.
  Is that what you want? You can have further info
  here http://tomcat.apache.org/connectors-doc/
 
  Yours,
 
  Marcus
 
  -Mensagem original-
  De: Melanie Pfefer
  [mailto:[EMAIL PROTECTED]
  Enviada em: quinta-feira, 27 de março de 2008
 07:32
  Para: users@tomcat.apache.org
  Assunto: url redirection
 
  Hi,
 
  I have 2 web apps deployed on 2 tomcat servers.
 How
  to redirect urls that contains 'jar' string from
 one
  app to another?
 
  http://zeus:8085/web/sec:jar:001
  to
  http://zeus:8086/src/web:sec:jar:001
 
  thanks
 
 
 
 
 

__
  Sent from Yahoo! Mail.
  More Ways to Keep in Touch.
  http://uk.docs.yahoo.com/nowyoucan.html
 
 
 

-
  To start a new topic, e-mail:
  users@tomcat.apache.org To unsubscribe, e-mail:
  [EMAIL PROTECTED]
  For additional commands, e-mail:
  [EMAIL PROTECTED]
 
 
 
 

-
  To start a new topic, e-mail:
  users@tomcat.apache.org
  To unsubscribe, e-mail:
  [EMAIL PROTECTED]
  For additional commands, e-mail:
  [EMAIL PROTECTED]
 
 
 
 
 
  

___
  Yahoo! For Good helps you make a difference
 
  http://uk.promotions.yahoo.com/forgood/
 
 

-
  To start a new topic, e-mail:
 users@tomcat.apache.org
  To unsubscribe, e-mail:
 [EMAIL PROTECTED]
  For additional commands, e-mail:
 [EMAIL PROTECTED]
 
  
 
 
 

-
 To start a new topic, e-mail:
 users@tomcat.apache.org
 To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, e-mail:
 [EMAIL PROTECTED]
 
 



  __
Sent from Yahoo! Mail.
More Ways to Keep in Touch. http://uk.docs.yahoo.com/nowyoucan.html

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: RES: url redirection

2008-03-27 Thread ChrisS
I worked with Solaris 10's apache and found that I had to download the 
apache source code eventually and rebuild it myself. I found a few bugs in 
2.2.8's configure scripts, what I am using now but I got it to work, if you 
are up for it I could help out!


I never used the P proxy flag in httpd.conf, I used jk_mod.1.2.6 (but this 
is jk_mod.1.2.7 really) then to get apache to communicate with the tomcat 
nodes I set up a worker file included it in httpd.conf, that with the jk_mod 
included in httpd's module section and I was accessing Tomcat through two 
worker ports set up in apache. Is this what you are trying to do?

Chris S

- Original Message - 
From: Melanie Pfefer [EMAIL PROTECTED]

To: Tomcat Users List users@tomcat.apache.org
Sent: Thursday, March 27, 2008 4:23 PM
Subject: Re: RES: url redirection



Hello
Actually I was able to define a rewrite rule in
apache:

RewriteRule ^/(.*web:jar.*) http://zeus:8086/src/$1
[R=301,L]

now
http://zeus/web:jar:001
redirects to
http://zeus:8086/src/web:jar:001

But if I tried to change the flag to P (proxy) in
httpd.conf
the apache error file gives:
[Thu Mar 27 17:18:58 2008] [error] [client
172.21.194.71] File does not exist:
/usr/local/apache2/htdocs/src, referer:
http://zeus/web:jar:001

the tomcat gives:

Your request is: http://zeus:8086/src/web:jar:001
Patj info is: web:jar:001
Session (1A578677550D1A75793540B152A8D6B6) has been
added to the list of valid Sessions
MY path info in treeview is: web:jar:001


I suspect I should something on tomcat to all this
operation. right?

I am using Solaris 10 - apache 2.2.4 and tomcat 6


--- ChrisS [EMAIL PROTECTED] wrote:


Melanie are you using FreeBSD or OpenBSD? I am going
back a bit but I
remember using Zeus on OpenBSD.

The way I set up clustering recently was through a
workers.properties file
which I stored in the apache/conf subdirectory. To
start with you have to
make sure all the prerequisites are in place. If you
are using a version of
Apache that supports it you need to DSO the mod_jk
module into this (if you
haven't done this already) with
./configure
--with-apxs=/usr/local/apache/bin/apxs. This won't
work unless
you have mod_ssl installed !make sure the version
you have supports it!. For
example if you are using an APACI version, you may
face problems. If you do
have mod_ssl installed and are witnessing problems
note the error whilst
trying to launch Apache. I witnessed numerous errors
whilst trying to build
1.3.39, 1.3.4, 2.0.x 2.2.x this way.

- Original Message - 
From: Melanie Pfefer [EMAIL PROTECTED]

To: Tomcat Users List users@tomcat.apache.org
Sent: Thursday, March 27, 2008 12:31 PM
Subject: Re: RES: url redirection


 Hi,

 thanks for your reply. what I want is to redirect

 http://zeus:8085/web/sec:jar:001

 to


 http://zeus:8086/src/web:sec:jar:001

 The first one is on apache
 the 2nd one is on tomcat

 thanks again
 --- Milanez, Marcus [EMAIL PROTECTED]
 wrote:

 Hi,

 I'm not completely sure about what you want, but
you
 can redirect urls according to a given pattern
 between tomcat instances using jakarta
connectors.
 Is that what you want? You can have further info
 here http://tomcat.apache.org/connectors-doc/

 Yours,

 Marcus

 -Mensagem original-
 De: Melanie Pfefer
 [mailto:[EMAIL PROTECTED]
 Enviada em: quinta-feira, 27 de março de 2008
07:32
 Para: users@tomcat.apache.org
 Assunto: url redirection

 Hi,

 I have 2 web apps deployed on 2 tomcat servers.
How
 to redirect urls that contains 'jar' string from
one
 app to another?

 http://zeus:8085/web/sec:jar:001
 to
 http://zeus:8086/src/web:sec:jar:001

 thanks







__

 Sent from Yahoo! Mail.
 More Ways to Keep in Touch.
 http://uk.docs.yahoo.com/nowyoucan.html





-

 To start a new topic, e-mail:
 users@tomcat.apache.org To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, e-mail:
 [EMAIL PROTECTED]






-

 To start a new topic, e-mail:
 users@tomcat.apache.org
 To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, e-mail:
 [EMAIL PROTECTED]








___

 Yahoo! For Good helps you make a difference

 http://uk.promotions.yahoo.com/forgood/




-

 To start a new topic, e-mail:
users@tomcat.apache.org
 To unsubscribe, e-mail:
[EMAIL PROTECTED]
 For additional commands, e-mail:
[EMAIL PROTECTED]







-

To start a new topic, e-mail:
users@tomcat.apache.org
To unsubscribe, e-mail:
[EMAIL PROTECTED]
For additional commands, e-mail:
[EMAIL PROTECTED]






 __
Sent from Yahoo! Mail.
More Ways

Re: RES: url redirection

2008-03-27 Thread Christopher Schultz

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Melanie,

Melanie Pfefer wrote:
| Hello
| Actually I was able to define a rewrite rule in
| apache:
|
| RewriteRule ^/(.*web:jar.*) http://zeus:8086/src/$1
| [R=301,L]

Aah, mod_rewrite: the chainsaw of httpd configuration. I personally
think RedirectMatch is a lot cleaner. mod_rewrite is very heavy (because
it can do so many different things).

But hey... whatever works.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.8 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkfr3akACgkQ9CaO5/Lv0PA0AgCfa3z0uq7gPkXEAuLmVnbkFVGb
s8MAn3RlP9NOVjBB8YUV8hepJx6r5JnG
=SD08
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: RES: url redirection

2008-03-27 Thread Melanie Pfefer
all I want is to redirect from apache to tomcat. That
I was able to do using rewrite rule
however, I want the redirection to be transparent (no
changes in url) so i thought of using P flag.

if ur method can do this please share how to do it.
thanks
--- ChrisS [EMAIL PROTECTED] wrote:

 I worked with Solaris 10's apache and found that I
 had to download the 
 apache source code eventually and rebuild it myself.
 I found a few bugs in 
 2.2.8's configure scripts, what I am using now but I
 got it to work, if you 
 are up for it I could help out!
 
 I never used the P proxy flag in httpd.conf, I used
 jk_mod.1.2.6 (but this 
 is jk_mod.1.2.7 really) then to get apache to
 communicate with the tomcat 
 nodes I set up a worker file included it in
 httpd.conf, that with the jk_mod 
 included in httpd's module section and I was
 accessing Tomcat through two 
 worker ports set up in apache. Is this what you are
 trying to do?
 Chris S
 
 - Original Message - 
 From: Melanie Pfefer [EMAIL PROTECTED]
 To: Tomcat Users List users@tomcat.apache.org
 Sent: Thursday, March 27, 2008 4:23 PM
 Subject: Re: RES: url redirection
 
 
  Hello
  Actually I was able to define a rewrite rule in
  apache:
 
  RewriteRule ^/(.*web:jar.*)
 http://zeus:8086/src/$1
  [R=301,L]
 
  now
  http://zeus/web:jar:001
  redirects to
  http://zeus:8086/src/web:jar:001
 
  But if I tried to change the flag to P (proxy) in
  httpd.conf
  the apache error file gives:
  [Thu Mar 27 17:18:58 2008] [error] [client
  172.21.194.71] File does not exist:
  /usr/local/apache2/htdocs/src, referer:
  http://zeus/web:jar:001
 
  the tomcat gives:
 
  Your request is:
 http://zeus:8086/src/web:jar:001
  Patj info is: web:jar:001
  Session (1A578677550D1A75793540B152A8D6B6) has
 been
  added to the list of valid Sessions
  MY path info in treeview is: web:jar:001
 
 
  I suspect I should something on tomcat to all this
  operation. right?
 
  I am using Solaris 10 - apache 2.2.4 and tomcat 6
 
 
  --- ChrisS [EMAIL PROTECTED]
 wrote:
 
  Melanie are you using FreeBSD or OpenBSD? I am
 going
  back a bit but I
  remember using Zeus on OpenBSD.
 
  The way I set up clustering recently was through
 a
  workers.properties file
  which I stored in the apache/conf subdirectory.
 To
  start with you have to
  make sure all the prerequisites are in place. If
 you
  are using a version of
  Apache that supports it you need to DSO the
 mod_jk
  module into this (if you
  haven't done this already) with
  ./configure
  --with-apxs=/usr/local/apache/bin/apxs. This
 won't
  work unless
  you have mod_ssl installed !make sure the version
  you have supports it!. For
  example if you are using an APACI version, you
 may
  face problems. If you do
  have mod_ssl installed and are witnessing
 problems
  note the error whilst
  trying to launch Apache. I witnessed numerous
 errors
  whilst trying to build
  1.3.39, 1.3.4, 2.0.x 2.2.x this way.
 
  - Original Message - 
  From: Melanie Pfefer
 [EMAIL PROTECTED]
  To: Tomcat Users List users@tomcat.apache.org
  Sent: Thursday, March 27, 2008 12:31 PM
  Subject: Re: RES: url redirection
 
 
   Hi,
  
   thanks for your reply. what I want is to
 redirect
  
   http://zeus:8085/web/sec:jar:001
  
   to
  
  
   http://zeus:8086/src/web:sec:jar:001
  
   The first one is on apache
   the 2nd one is on tomcat
  
   thanks again
   --- Milanez, Marcus
 [EMAIL PROTECTED]
   wrote:
  
   Hi,
  
   I'm not completely sure about what you want,
 but
  you
   can redirect urls according to a given pattern
   between tomcat instances using jakarta
  connectors.
   Is that what you want? You can have further
 info
   here http://tomcat.apache.org/connectors-doc/
  
   Yours,
  
   Marcus
  
   -Mensagem original-
   De: Melanie Pfefer
   [mailto:[EMAIL PROTECTED]
   Enviada em: quinta-feira, 27 de março de 2008
  07:32
   Para: users@tomcat.apache.org
   Assunto: url redirection
  
   Hi,
  
   I have 2 web apps deployed on 2 tomcat
 servers.
  How
   to redirect urls that contains 'jar' string
 from
  one
   app to another?
  
   http://zeus:8085/web/sec:jar:001
   to
   http://zeus:8086/src/web:sec:jar:001
  
   thanks
  
  
  
  
  
 
 

__
   Sent from Yahoo! Mail.
   More Ways to Keep in Touch.
   http://uk.docs.yahoo.com/nowyoucan.html
  
  
  
 
 

-
   To start a new topic, e-mail:
   users@tomcat.apache.org To unsubscribe,
 e-mail:
   [EMAIL PROTECTED]
   For additional commands, e-mail:
   [EMAIL PROTECTED]
  
  
  
  
 
 

-
   To start a new topic, e-mail:
 
=== message truncated ===



  __
Sent from Yahoo! Mail.
More Ways to Keep in Touch. http://uk.docs.yahoo.com/nowyoucan.html

Re: RES: url redirection

2008-03-27 Thread Rainer Jung

Melanie Pfefer schrieb:

all I want is to redirect from apache to tomcat. That
I was able to do using rewrite rule
however, I want the redirection to be transparent (no
changes in url) so i thought of using P flag.


We should get terminology straight:

- redirect: change the URL and sent a 30X response back to the browser, 
indicating that the browser should instead make a new request to this 
changed URL. Browsers will handle redirects automatically, but the new 
URL will be visible to the users (and get used in bookmarks etc.)


- rewrite: internally rewrite a URL during processing without making the 
client aware of this.


- forward (in the sense of a reverse proxy): sending a request received 
by a server to another server and returning the response gotten from 
that server back to the client.


Caution: mod_rewrite can do redirect and rewrite and also interacts with 
forwarding.


I guess what you want is a combination of rewrite and forward: The 
client uses a URL which does not exist on the final server and you want 
to use an intermediate server to change this URL (rewrite) to the one 
known on the final server, sending the resulting request there and 
returning the final response back to the client.


The components you perfer to do this with are Tomcat as the final server 
(backend) and Apache httpd to rewrite and forward.


You can do the forwarding either with mod_jk or mod_proxy. You should 
have a working forwarding before getting into the rewrite business.


To do the rewrite, you use a RewriteRule with mod_rewrite and you need 
to add the pass through PT flag to let further modules (in the case of 
mod_jk) participate in request processing. The flag is important.


See passthrough in http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html.

HTH

Rainer



if ur method can do this please share how to do it.
thanks
--- ChrisS [EMAIL PROTECTED] wrote:


I worked with Solaris 10's apache and found that I
had to download the 
apache source code eventually and rebuild it myself.
I found a few bugs in 
2.2.8's configure scripts, what I am using now but I
got it to work, if you 
are up for it I could help out!


I never used the P proxy flag in httpd.conf, I used
jk_mod.1.2.6 (but this 
is jk_mod.1.2.7 really) then to get apache to
communicate with the tomcat 
nodes I set up a worker file included it in
httpd.conf, that with the jk_mod 
included in httpd's module section and I was
accessing Tomcat through two 
worker ports set up in apache. Is this what you are

trying to do?
Chris S

- Original Message - 
From: Melanie Pfefer [EMAIL PROTECTED]

To: Tomcat Users List users@tomcat.apache.org
Sent: Thursday, March 27, 2008 4:23 PM
Subject: Re: RES: url redirection



Hello
Actually I was able to define a rewrite rule in
apache:

RewriteRule ^/(.*web:jar.*)

http://zeus:8086/src/$1

[R=301,L]

now
http://zeus/web:jar:001
redirects to
http://zeus:8086/src/web:jar:001

But if I tried to change the flag to P (proxy) in
httpd.conf
the apache error file gives:
[Thu Mar 27 17:18:58 2008] [error] [client
172.21.194.71] File does not exist:
/usr/local/apache2/htdocs/src, referer:
http://zeus/web:jar:001

the tomcat gives:

Your request is:

http://zeus:8086/src/web:jar:001

Patj info is: web:jar:001
Session (1A578677550D1A75793540B152A8D6B6) has

been

added to the list of valid Sessions
MY path info in treeview is: web:jar:001


I suspect I should something on tomcat to all this
operation. right?

I am using Solaris 10 - apache 2.2.4 and tomcat 6


--- ChrisS [EMAIL PROTECTED]

wrote:

Melanie are you using FreeBSD or OpenBSD? I am

going

back a bit but I
remember using Zeus on OpenBSD.

The way I set up clustering recently was through

a

workers.properties file
which I stored in the apache/conf subdirectory.

To

start with you have to
make sure all the prerequisites are in place. If

you

are using a version of
Apache that supports it you need to DSO the

mod_jk

module into this (if you
haven't done this already) with
./configure
--with-apxs=/usr/local/apache/bin/apxs. This

won't

work unless
you have mod_ssl installed !make sure the version
you have supports it!. For
example if you are using an APACI version, you

may

face problems. If you do
have mod_ssl installed and are witnessing

problems

note the error whilst
trying to launch Apache. I witnessed numerous

errors

whilst trying to build
1.3.39, 1.3.4, 2.0.x 2.2.x this way.

- Original Message - 
From: Melanie Pfefer

[EMAIL PROTECTED]

To: Tomcat Users List users@tomcat.apache.org
Sent: Thursday, March 27, 2008 12:31 PM
Subject: Re: RES: url redirection



Hi,

thanks for your reply. what I want is to

redirect

http://zeus:8085/web/sec:jar:001

to


http://zeus:8086/src/web:sec:jar:001

The first one is on apache
the 2nd one is on tomcat

thanks again
--- Milanez, Marcus

[EMAIL PROTECTED]

wrote:


Hi,

I'm not completely sure about what you want,

but

you

can redirect urls according

Re: RES: url redirection

2008-03-27 Thread ChrisS
Ok so if you are using Two Tomcat nodes and you want to redirect to each of 
the Nodes in question through an Apache rewrite rule and give the 
transparency of the same URL. I am not sure you can do this


1. Are you doing this to load balance between the Two Tomcat instances.
2. You aren't bothered about loadbalancing between the Two Tomcat Nodes.

Either way I can only see that by using a different URL is your binding.
To give true transparency of URL(sameness), wouldn't it just be better to 
Loadbalance?


I would start by downloading the latest version of Apache 2.2.8. You may 
need to download Sun Studio 11 but hold fire on this. Lemme spark up the 
Solaris box, to remember the steps. The proxy through mod_jk is highly 
recommended on the sites I have researched I downloaded this version 1.2.26.


There was an issue with the Global Zone and the local zone using header 
files so Sun Studio 11 could be required, again it may not, Sun Studio 12 is 
beautiful it picks out weaknesses in the code itself. GNU Make should do the 
trick, so once everything is in place. Then comes the build, which I wrapped 
around the installation i.e path variables.


We could opt for the quicker option, if it works that is. Meaning I give you 
the mod_jk module ready compiled and you include it in your modules/libexec 
subdirectory.


Chris S

- Original Message - 
From: Melanie Pfefer [EMAIL PROTECTED]

To: Tomcat Users List users@tomcat.apache.org
Sent: Thursday, March 27, 2008 7:15 PM
Subject: Re: RES: url redirection



all I want is to redirect from apache to tomcat. That
I was able to do using rewrite rule
however, I want the redirection to be transparent (no
changes in url) so i thought of using P flag.

if ur method can do this please share how to do it.
thanks
--- ChrisS [EMAIL PROTECTED] wrote:


I worked with Solaris 10's apache and found that I
had to download the
apache source code eventually and rebuild it myself.
I found a few bugs in
2.2.8's configure scripts, what I am using now but I
got it to work, if you
are up for it I could help out!

I never used the P proxy flag in httpd.conf, I used
jk_mod.1.2.6 (but this
is jk_mod.1.2.7 really) then to get apache to
communicate with the tomcat
nodes I set up a worker file included it in
httpd.conf, that with the jk_mod
included in httpd's module section and I was
accessing Tomcat through two
worker ports set up in apache. Is this what you are
trying to do?
Chris S

- Original Message - 
From: Melanie Pfefer [EMAIL PROTECTED]

To: Tomcat Users List users@tomcat.apache.org
Sent: Thursday, March 27, 2008 4:23 PM
Subject: Re: RES: url redirection


 Hello
 Actually I was able to define a rewrite rule in
 apache:

 RewriteRule ^/(.*web:jar.*)
http://zeus:8086/src/$1
 [R=301,L]

 now
 http://zeus/web:jar:001
 redirects to
 http://zeus:8086/src/web:jar:001

 But if I tried to change the flag to P (proxy) in
 httpd.conf
 the apache error file gives:
 [Thu Mar 27 17:18:58 2008] [error] [client
 172.21.194.71] File does not exist:
 /usr/local/apache2/htdocs/src, referer:
 http://zeus/web:jar:001

 the tomcat gives:

 Your request is:
http://zeus:8086/src/web:jar:001
 Patj info is: web:jar:001
 Session (1A578677550D1A75793540B152A8D6B6) has
been
 added to the list of valid Sessions
 MY path info in treeview is: web:jar:001


 I suspect I should something on tomcat to all this
 operation. right?

 I am using Solaris 10 - apache 2.2.4 and tomcat 6


 --- ChrisS [EMAIL PROTECTED]
wrote:

 Melanie are you using FreeBSD or OpenBSD? I am
going
 back a bit but I
 remember using Zeus on OpenBSD.

 The way I set up clustering recently was through
a
 workers.properties file
 which I stored in the apache/conf subdirectory.
To
 start with you have to
 make sure all the prerequisites are in place. If
you
 are using a version of
 Apache that supports it you need to DSO the
mod_jk
 module into this (if you
 haven't done this already) with
 ./configure
 --with-apxs=/usr/local/apache/bin/apxs. This
won't
 work unless
 you have mod_ssl installed !make sure the version
 you have supports it!. For
 example if you are using an APACI version, you
may
 face problems. If you do
 have mod_ssl installed and are witnessing
problems
 note the error whilst
 trying to launch Apache. I witnessed numerous
errors
 whilst trying to build
 1.3.39, 1.3.4, 2.0.x 2.2.x this way.

 - Original Message - 
 From: Melanie Pfefer

[EMAIL PROTECTED]
 To: Tomcat Users List users@tomcat.apache.org
 Sent: Thursday, March 27, 2008 12:31 PM
 Subject: Re: RES: url redirection


  Hi,
 
  thanks for your reply. what I want is to
redirect
 
  http://zeus:8085/web/sec:jar:001
 
  to
 
 
  http://zeus:8086/src/web:sec:jar:001
 
  The first one is on apache
  the 2nd one is on tomcat
 
  thanks again
  --- Milanez, Marcus
[EMAIL PROTECTED]
  wrote:
 
  Hi,
 
  I'm not completely sure about what you want,
but
 you
  can redirect urls according to a given pattern
  between

Re: URL Redirection

2006-09-22 Thread Ashirvad Uniyal

Hello,

The images that are referenced using the '.' current directory operator 
are visible when the folder is renamed ROOT but not the other images for 
example please look for the src=/jpivot/toolbar/cube-up.png in the 
page source.


I want to reference these images aswell with the '.' operator but iam 
unable to change testpage.jsp as it uses the Window Component Framework 
(wcf). Could you please suggest how can i change the path in the 
testpage.jsp.


Thanks and regards,
-Ash


David Smith wrote:
I see the gif image is the only one referenced using the '.' current 
directory operator.  I've found it better to code image urls as 
${pageContext.request.contextPath}/images/zapisz.gif.  This will 
render the full path relative to the site and will also change 
automatically as the webapp's context path changes.


--David

Ashirvad Uniyal wrote:

David Smith wrote:
Ok. Can you offer a code snippet showing where you compose the url 
to the gif image?


--David

Ashirvad Uniyal wrote:

Hello,

If the application is renamed say for example Test or anything, 
everything works fine and the gif appear but they

just vanish if the application is renamed as ROOT.

Regards,
Ash

Caldarale, Charles R wrote:
From: Ashirvad Uniyal [mailto:[EMAIL PROTECTED] Subject: 
Re: URL Redirection


I renamed the application to ROOT and everything works fine 
except that all the images (gif) have all together vanished


How are you referencing the images? Do you have a hard-coded URL 
in the

generated HTML?

- Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE 
PROPRIETARY

MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the 
e-mail

and its attachments from all computers.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Hello,

After spending long time understanding this project i still have no 
clue.


All logic is contained in one file, testpage.jsp. Despite of the size 
of the application, this file is a relatively small file. It was 
possible to achieve through the Window Component Framework (WCF). 
This framework is a set of tags, which enables developing short 
application code based on JSP.


I have problem understanding the testpage.jsp and modifing it. Please 
find the snippet of the page souce of testpage.jsp, and the code of 
testpage.jsp respectively





table border=0 cellspacing=0 cellpadding=0 style=width:100%
trtd class=lewa lewa_listwa valign=middle style=height:45px

table border=0 cellspacing=0 cellpadding=0tr valign=middle
td style=padding-left:10px
table border=0 cellspacing=1 cellpadding=0 
id=toolbar01trtdinput type=image 
name=toolbar01.cubeNaviButton src=/jpivot/toolbar/cube-up.png 
border=0 title=Open OLAP Navigator width=24 
height=24/tdtdinput type=image 
name=toolbar01.mdxEditButton src=/jpivot/toolbar/mdx-edit-up.png 
border=0 title=Show MDX Editor width=24 
height=24/tdtdinput type=image 
name=toolbar01.sortConfigButton 
src=/jpivot/toolbar/sort-asc-up.png border=0 title=Config OLAP 
Table width=24 height=24/tdtddiv style=width: 
1ex/div/tdtdinput type=image name=toolbar01.levelStyle 
src=/jpivot/toolbar/level-style-up.png border=0 title=Show 
Parent Members width=24 height=24/tdtdinput type=image 
name=toolbar01.hideSpans src=/jpivot/toolbar/hide-spans-up.png 
border=0 title=Hide Spans width=24 height=24/tdtdinput 
type=image name=toolbar01.propertiesButton 
src=/jpivot/toolbar/properties-up.png border=0 title=Show 
Properties width=24 height=24/tdtdinput type=image 
name=toolbar01.nonEmpty src=/jpivot/toolbar/non-empty-down.png 
border=0 title=Suppress Empty Rows / Columns width=24 
height=24/tdtdinput type=image name=toolbar01.swapAxes 
src=/jpivot/toolbar/swap-axes-up.png border=0 title=Swap Axes 
width=24 height=24/tdtddiv style=width: 
1ex/div/tdtdinput type=image name=toolbar01.drillMember 
src=/jpivot/toolbar/navi-member-up.png border=0 title=Drill 
Member width=24 height=24/tdtdinput type=image 
name=toolbar01.drillPosition 
src=/jpivot/toolbar/navi-position-down.png border=0 title=Drill 
Position width=24 height=24/tdtdinput type=image 
name=toolbar01.drillReplace 
src=/jpivot/toolbar/navi-replace-up.png border=0 title=Drill 
Replace width=24 height=24/tdtdinput type=image 
name=toolbar01.drillThrough01 
src=/jpivot/toolbar/navi-through-up.png border=0 title=Drill 
Through width=24

Re: URL Redirection

2006-09-21 Thread Ashirvad Uniyal

Caldarale, Charles R wrote:
From: Ashirvad Uniyal [mailto:[EMAIL PROTECTED] 
Subject: Re: URL Redirection


I renamed the application to ROOT and everything works fine 
except that all the images (gif) have all together vanished



How are you referencing the images?  Do you have a hard-coded URL in the
generated HTML?

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

  

Hello,

If  the application is renamed say for example Test or anything 
everything works fine and the gif appear but they

just vanish if the application is renamed as ROOT.

Regards,
Ash


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: URL Redirection

2006-09-21 Thread Gregor Schneider

take a look into your access-logs for a 404-error. then you should see the
access-code where tomcat looks for the pics.
you'll have to change the links then.

btw., renaming your web-app to ROOT is the worst of all solutions: Since
this is a standard-app of tomcat, your client will pretty much likely
already have a context named ROOT.

cheers

greg
--
what's puzzlin' you, is the nature of my game


Re: URL Redirection

2006-09-21 Thread Ashirvad Uniyal

Hello,

If  the application is renamed say for example Test or anything, 
everything works fine and the gif appear but they

just vanish if the application is renamed as ROOT.

Regards,
Ash

Caldarale, Charles R wrote:
From: Ashirvad Uniyal [mailto:[EMAIL PROTECTED] 
Subject: Re: URL Redirection


I renamed the application to ROOT and everything works fine 
except that all the images (gif) have all together vanished



How are you referencing the images?  Do you have a hard-coded URL in the
generated HTML?

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

  



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: URL Redirection

2006-09-21 Thread Ashirvad Uniyal

David Smith wrote:
Ok. Can you offer a code snippet showing where you compose the url to 
the gif image?


--David

Ashirvad Uniyal wrote:

Hello,

If the application is renamed say for example Test or anything, 
everything works fine and the gif appear but they

just vanish if the application is renamed as ROOT.

Regards,
Ash

Caldarale, Charles R wrote:
From: Ashirvad Uniyal [mailto:[EMAIL PROTECTED] Subject: Re: 
URL Redirection


I renamed the application to ROOT and everything works fine except 
that all the images (gif) have all together vanished


How are you referencing the images? Do you have a hard-coded URL in the
generated HTML?

- Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE 
PROPRIETARY

MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Hello,

After spending long time understanding this project i still have no clue.

All logic is contained in one file, testpage.jsp. Despite of the size of 
the application, this file is a relatively small file. It was possible 
to achieve through the Window Component Framework (WCF). This framework 
is a set of tags, which enables developing short application code based 
on JSP.


I have problem understanding the testpage.jsp and modifing it. Please 
find the snippet of the page souce of testpage.jsp, and the code of 
testpage.jsp respectively





table border=0 cellspacing=0 cellpadding=0 style=width:100%
trtd class=lewa lewa_listwa valign=middle style=height:45px

table border=0 cellspacing=0 cellpadding=0tr valign=middle
td style=padding-left:10px
table border=0 cellspacing=1 cellpadding=0 
id=toolbar01trtdinput type=image 
name=toolbar01.cubeNaviButton src=/jpivot/toolbar/cube-up.png 
border=0 title=Open OLAP Navigator width=24 
height=24/tdtdinput type=image name=toolbar01.mdxEditButton 
src=/jpivot/toolbar/mdx-edit-up.png border=0 title=Show MDX Editor 
width=24 height=24/tdtdinput type=image 
name=toolbar01.sortConfigButton src=/jpivot/toolbar/sort-asc-up.png 
border=0 title=Config OLAP Table width=24 
height=24/tdtddiv style=width: 1ex/div/tdtdinput 
type=image name=toolbar01.levelStyle 
src=/jpivot/toolbar/level-style-up.png border=0 title=Show Parent 
Members width=24 height=24/tdtdinput type=image 
name=toolbar01.hideSpans src=/jpivot/toolbar/hide-spans-up.png 
border=0 title=Hide Spans width=24 height=24/tdtdinput 
type=image name=toolbar01.propertiesButton 
src=/jpivot/toolbar/properties-up.png border=0 title=Show 
Properties width=24 height=24/tdtdinput type=image 
name=toolbar01.nonEmpty src=/jpivot/toolbar/non-empty-down.png 
border=0 title=Suppress Empty Rows / Columns width=24 
height=24/tdtdinput type=image name=toolbar01.swapAxes 
src=/jpivot/toolbar/swap-axes-up.png border=0 title=Swap Axes 
width=24 height=24/tdtddiv style=width: 
1ex/div/tdtdinput type=image name=toolbar01.drillMember 
src=/jpivot/toolbar/navi-member-up.png border=0 title=Drill Member 
width=24 height=24/tdtdinput type=image 
name=toolbar01.drillPosition 
src=/jpivot/toolbar/navi-position-down.png border=0 title=Drill 
Position width=24 height=24/tdtdinput type=image 
name=toolbar01.drillReplace src=/jpivot/toolbar/navi-replace-up.png 
border=0 title=Drill Replace width=24 height=24/tdtdinput 
type=image name=toolbar01.drillThrough01 
src=/jpivot/toolbar/navi-through-up.png border=0 title=Drill 
Through width=24 height=24/tdtddiv style=width: 
1ex/div/tdtdinput type=image name=toolbar01.chartButton01 
src=/jpivot/toolbar/chart-up.png border=0 title=Show Chart 
width=24 height=24/tdtdinput type=image 
name=toolbar01.chartPropertiesButton01 
src=/jpivot/toolbar/chart-config-up.png border=0 title=Chart 
Config width=24 height=24/tdtddiv style=width: 
1ex/div/tdtdinput type=image 
name=toolbar01.printPropertiesButton01 
src=/jpivot/toolbar/print-config-up.png border=0 title=Configure 
Print Settings width=24 height=24/tdtda 
href=./Print?cube=01type=1img src=/jpivot/toolbar/pdf-up.png 
border=0 title=Print this Page via PDF width=24 
height=24/a/tdtda href=./Print?cube=01type=0img 
src=/jpivot/toolbar/excel-up.png border=0 title=Start Excel 
width=24 height=24/a/tdtddiv style=width: 
1ex/div/tdtdinput type=image name=toolbar01.chartResize 
src=/jpivot/toolbar/swap-axes

Re: URL Redirection

2006-09-21 Thread David Smith
Why is renaming a webapp to ROOT the worst solution?  It's a perfectly 
acceptable solution when you want to access your webapp from the top 
level and the default ROOT is just a placeholder anyway.


--David

Gregor Schneider wrote:
take a look into your access-logs for a 404-error. then you should see 
the

access-code where tomcat looks for the pics.
you'll have to change the links then.

btw., renaming your web-app to ROOT is the worst of all solutions: Since
this is a standard-app of tomcat, your client will pretty much likely
already have a context named ROOT.

cheers

greg



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: URL Redirection

2006-09-21 Thread David Smith
I see the gif image is the only one referenced using the '.' current 
directory operator.  I've found it better to code image urls as 
${pageContext.request.contextPath}/images/zapisz.gif.  This will 
render the full path relative to the site and will also change 
automatically as the webapp's context path changes.


--David

Ashirvad Uniyal wrote:

David Smith wrote:
Ok. Can you offer a code snippet showing where you compose the url to 
the gif image?


--David

Ashirvad Uniyal wrote:

Hello,

If the application is renamed say for example Test or anything, 
everything works fine and the gif appear but they

just vanish if the application is renamed as ROOT.

Regards,
Ash

Caldarale, Charles R wrote:
From: Ashirvad Uniyal [mailto:[EMAIL PROTECTED] Subject: 
Re: URL Redirection


I renamed the application to ROOT and everything works fine except 
that all the images (gif) have all together vanished


How are you referencing the images? Do you have a hard-coded URL in 
the

generated HTML?

- Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE 
PROPRIETARY

MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the 
e-mail

and its attachments from all computers.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Hello,

After spending long time understanding this project i still have no clue.

All logic is contained in one file, testpage.jsp. Despite of the size 
of the application, this file is a relatively small file. It was 
possible to achieve through the Window Component Framework (WCF). This 
framework is a set of tags, which enables developing short application 
code based on JSP.


I have problem understanding the testpage.jsp and modifing it. Please 
find the snippet of the page souce of testpage.jsp, and the code of 
testpage.jsp respectively





table border=0 cellspacing=0 cellpadding=0 style=width:100%
trtd class=lewa lewa_listwa valign=middle style=height:45px

table border=0 cellspacing=0 cellpadding=0tr valign=middle
td style=padding-left:10px
table border=0 cellspacing=1 cellpadding=0 
id=toolbar01trtdinput type=image 
name=toolbar01.cubeNaviButton src=/jpivot/toolbar/cube-up.png 
border=0 title=Open OLAP Navigator width=24 
height=24/tdtdinput type=image 
name=toolbar01.mdxEditButton src=/jpivot/toolbar/mdx-edit-up.png 
border=0 title=Show MDX Editor width=24 
height=24/tdtdinput type=image 
name=toolbar01.sortConfigButton 
src=/jpivot/toolbar/sort-asc-up.png border=0 title=Config OLAP 
Table width=24 height=24/tdtddiv style=width: 
1ex/div/tdtdinput type=image name=toolbar01.levelStyle 
src=/jpivot/toolbar/level-style-up.png border=0 title=Show Parent 
Members width=24 height=24/tdtdinput type=image 
name=toolbar01.hideSpans src=/jpivot/toolbar/hide-spans-up.png 
border=0 title=Hide Spans width=24 height=24/tdtdinput 
type=image name=toolbar01.propertiesButton 
src=/jpivot/toolbar/properties-up.png border=0 title=Show 
Properties width=24 height=24/tdtdinput type=image 
name=toolbar01.nonEmpty src=/jpivot/toolbar/non-empty-down.png 
border=0 title=Suppress Empty Rows / Columns width=24 
height=24/tdtdinput type=image name=toolbar01.swapAxes 
src=/jpivot/toolbar/swap-axes-up.png border=0 title=Swap Axes 
width=24 height=24/tdtddiv style=width: 
1ex/div/tdtdinput type=image name=toolbar01.drillMember 
src=/jpivot/toolbar/navi-member-up.png border=0 title=Drill 
Member width=24 height=24/tdtdinput type=image 
name=toolbar01.drillPosition 
src=/jpivot/toolbar/navi-position-down.png border=0 title=Drill 
Position width=24 height=24/tdtdinput type=image 
name=toolbar01.drillReplace 
src=/jpivot/toolbar/navi-replace-up.png border=0 title=Drill 
Replace width=24 height=24/tdtdinput type=image 
name=toolbar01.drillThrough01 
src=/jpivot/toolbar/navi-through-up.png border=0 title=Drill 
Through width=24 height=24/tdtddiv style=width: 
1ex/div/tdtdinput type=image name=toolbar01.chartButton01 
src=/jpivot/toolbar/chart-up.png border=0 title=Show Chart 
width=24 height=24/tdtdinput type=image 
name=toolbar01.chartPropertiesButton01 
src=/jpivot/toolbar/chart-config-up.png border=0 title=Chart 
Config width=24 height=24/tdtddiv style=width: 
1ex/div/tdtdinput type=image 
name=toolbar01.printPropertiesButton01 
src=/jpivot/toolbar/print-config-up.png border=0 title=Configure 
Print Settings width=24 height=24

Re: URL Redirection

2006-09-21 Thread Gregor Schneider

Hi David,

assuming the client gets his software delivered from different vendors, one
day changes his mind to make another app his default application, then what?
rename everything over again?

The best solution is, leave the web-app it's name and forward with a
index.jsp inside the ROOT-context to the required app since changing this
file is way easier than renaming the wep-apps.

Besides, if it's a real-world-app, I suggest having Apache HTTP in front so
that you can also use all those feature Tomcat lags, like url-rwriting etc.

Just my 0.02 €

Gregor
--
what's puzzlin' you, is the nature of my game


Re: URL Redirection

2006-09-21 Thread David Smith
Renaming everything is a very simple operation.  If the webapp is 
constructed correctly it should operate regardless of context path and 
make adjustments as necessary.  At most, some links between webapps will 
have to be updated to reflect the adjustments in path.


I also can't recommend Apache httpd in front unless the site is a mixed 
bag of technology -- perl, php, java, user client based html authoring, 
etc., ...


All I can say is I have a different opinion on this point.

--David

Gregor Schneider wrote:

Hi David,

assuming the client gets his software delivered from different 
vendors, one
day changes his mind to make another app his default application, then 
what?

rename everything over again?

The best solution is, leave the web-app it's name and forward with a
index.jsp inside the ROOT-context to the required app since changing this
file is way easier than renaming the wep-apps.

Besides, if it's a real-world-app, I suggest having Apache HTTP in 
front so
that you can also use all those feature Tomcat lags, like url-rwriting 
etc.


Just my 0.02 €

Gregor



--
David Smith
Network Operations Supervisor
Department of Entomology
Cornell University
2132 Comstock Hall
Ithaca, NY 14853
Phone: (607) 255-9571
Fax: (607) 255-0940


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: URL Redirection

2006-09-21 Thread Gregor Schneider

hi david,

On 9/21/06, David Smith [EMAIL PROTECTED] wrote:


At most, some links between webapps will
have to be updated to reflect the adjustments in path.



exactly, and you can save the time updating them

I also can't recommend Apache httpd in front unless the site is a mixed

bag of technology -- perl, php, java, user client based html authoring,
etc., ...



well, most systems in the wild use at least a mix of html and some dynamic
components (most of them java-based).
having this situation, it's kinda awkward with tomcat alone.

just to give you an example:

try to change the headers of static html (i.e. caching-directive) to improve
the performance of you web-app: with tomcat, you'll need to write some valve
which adjusts the headers accordingly, since afaik there is no possibility
to change them using some config-files in tomcat. same goes for url-rwriting
etc. here, apache in the frontend comes in handy. besides, from my own
experiences i figure that serving static content via apache http performs
slightly *cough* better than serving them via tomcat.

however, i think apache http PLUS tomcat for dynamic content is a great
combination which is likely to satisfy 99% of anyone's requirements.

anyways, getting off topic here, and your oppinion is very much appreciated
- as always ;)

cheers

gregor
--
what's puzzlin' you, is the nature of my game


Re: URL Redirection

2006-09-20 Thread Ashirvad Uniyal

Caldarale, Charles R wrote:
From: Ashirvad Uniyal [mailto:[EMAIL PROTECTED] 
Subject: URL Redirection


the problem is the client has to always type 
http://abc.com/Mondrian/index.jsp in the address bar, rather 
than typing only

http://abc.com/index.jsp.



Rename your application to ROOT (case sensitive).  Apps deployed as ROOT
become the default application.  Alternatively, you could have a
ROOT/index.jsp that forwards the request to the proper app name.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

  

Hello,

Thanks for the early reply.

I renamed the application to ROOT and everything works fine except that 
all the images (gif)

have all together vanished, could you please suggest what the problem is ?

Please let me know if I need to submit further information.
Thanks and regards,
Ash

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: URL Redirection

2006-09-20 Thread Caldarale, Charles R
 From: Ashirvad Uniyal [mailto:[EMAIL PROTECTED] 
 Subject: Re: URL Redirection
 
 I renamed the application to ROOT and everything works fine 
 except that all the images (gif) have all together vanished

How are you referencing the images?  Do you have a hard-coded URL in the
generated HTML?

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: URL Redirection

2006-09-20 Thread David Smith
Look at the paths to your gif files in the browser.  I suspect the paths 
were hard coded to the /Mondrian context.


--David

Ashirvad Uniyal wrote:

Caldarale, Charles R wrote:
From: Ashirvad Uniyal [mailto:[EMAIL PROTECTED] Subject: URL 
Redirection


the problem is the client has to always type 
http://abc.com/Mondrian/index.jsp in the address bar, rather than 
typing only

http://abc.com/index.jsp.



Rename your application to ROOT (case sensitive).  Apps deployed as ROOT
become the default application.  Alternatively, you could have a
ROOT/index.jsp that forwards the request to the proper app name.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

  

Hello,

Thanks for the early reply.

I renamed the application to ROOT and everything works fine except 
that all the images (gif)
have all together vanished, could you please suggest what the problem 
is ?


Please let me know if I need to submit further information.
Thanks and regards,
Ash

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



URL Redirection

2006-09-19 Thread Ashirvad Uniyal

Hello All,

There is a bug that i have to fix, please help.

There is an application made in Tomcat in the webapps\Mondrian 
directory, the application is already being used by the clients,
the problem is the client has to always type 
http://abc.com/Mondrian/index.jsp in the address bar, rather than typing 
only
http://abc.com/index.jsp. Please help me where to change the code so as 
to omit typing Mondrian every time in the address bar.


Thanks in advance,
Ash

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: URL Redirection

2006-09-19 Thread Mikolaj Rydzewski

Ashirvad Uniyal wrote:

There is a bug that i have to fix, please help.

Is there a bug?

You can deploy your app in the root context.

--
Mikolaj Rydzewski [EMAIL PROTECTED]



smime.p7s
Description: S/MIME Cryptographic Signature


RE: URL Redirection

2006-09-19 Thread Caldarale, Charles R
 From: Ashirvad Uniyal [mailto:[EMAIL PROTECTED] 
 Subject: URL Redirection
 
 the problem is the client has to always type 
 http://abc.com/Mondrian/index.jsp in the address bar, rather 
 than typing only
 http://abc.com/index.jsp.

Rename your application to ROOT (case sensitive).  Apps deployed as ROOT
become the default application.  Alternatively, you could have a
ROOT/index.jsp that forwards the request to the proper app name.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: URL Redirection

2006-09-19 Thread Markus Schönhaber
Ashirvad Uniyal wrote:
 There is an application made in Tomcat in the webapps\Mondrian
 directory, the application is already being used by the clients,
 the problem is the client has to always type
 http://abc.com/Mondrian/index.jsp in the address bar, rather than typing
 only
 http://abc.com/index.jsp. Please help me where to change the code so as
 to omit typing Mondrian every time in the address bar.

Typing the index.jsp-part should be unneccessary anyway. At least Tomcat 5.5 
contains an entry defining index.jsp as a welcome-file in the default 
server-wide conf/web.xml.
If you want to access your webapp without the need for it's name being present 
in the URL you could make it the ROOT context - as already suggested. Or you 
could create an index.jsp (or whatever you want to map as a welcome-file) in 
the ROOT webapp that does a redirect to your actual context.

Regards
  mks

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: URL Redirection in tomcat

2006-07-10 Thread santhoshs

Is there anybody to help me ???
-- 
View this message in context: 
http://www.nabble.com/URL-Redirection-in-tomcat-tf1867090.html#a5246817
Sent from the Tomcat - User forum at Nabble.com.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: URL Redirection in tomcat

2006-07-10 Thread 0 8

Look into mod_rewrite.

On 6/29/06, santhoshs [EMAIL PROTECTED] wrote:


Hi Everybody,

Am using Tomcat 5.0 . My requirement is to redirect the URL
http://username.mysite.com; to
http://username.site.com/application.do?login_name=username;. The URL
should be nice URL , in the sense the New URL should not be reflected in the
address bar.

My Question is whether should i use apache for this redirection or can i
achieve this using tomcat itself ? If so what should I do to achieve this ?

Thanks and Regards,
Santhosh
--
View this message in context: 
http://www.nabble.com/URL-Redirection-in-tomcat-tf1867090.html#a5101383
Sent from the Tomcat - User forum at Nabble.com.




-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: URL Redirection in tomcat

2006-07-10 Thread Hassan Schroeder

On 6/29/06, santhoshs [EMAIL PROTECTED] wrote:


Am using Tomcat 5.0 . My requirement is to redirect the URL
http://username.mysite.com; to
http://username.site.com/application.do?login_name=username;.



My Question is whether should i use apache for this redirection or can i
achieve this using tomcat itself ? If so what should I do to achieve this ?


You certainly don't need apache, but you do need to read the servlet
spec about welcome files and forwarding. :-)

Also, if the originating URL is the root of your site, where is the value
username coming from??

--
Hassan Schroeder  [EMAIL PROTECTED]

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



URL Redirection in tomcat

2006-06-29 Thread santhoshs

Hi Everybody,

Am using Tomcat 5.0 . My requirement is to redirect the URL
http://username.mysite.com; to
http://username.site.com/application.do?login_name=username;. The URL
should be nice URL , in the sense the New URL should not be reflected in the
address bar.

My Question is whether should i use apache for this redirection or can i
achieve this using tomcat itself ? If so what should I do to achieve this ?

Thanks and Regards, 
Santhosh
-- 
View this message in context: 
http://www.nabble.com/URL-Redirection-in-tomcat-tf1867090.html#a5101383
Sent from the Tomcat - User forum at Nabble.com.