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

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

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.

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}

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,

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

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$

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

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

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

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

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/(.*)

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

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?

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

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

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

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 ?

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

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

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:

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

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

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

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

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

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

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: > >

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

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

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

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

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

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 -->

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

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 <%

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 <

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

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

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

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]

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

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

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

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.

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