Re: Regarding Tomcat url redirection
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
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: Upgrade query
Kalaivani, On 5/13/24 06:13, GANESAN, Kalaivani wrote: I have a question regarding upgrading to 9.0.86. The current version is 9.0.8 and needs to be upgraded to 9.0.86. We have apache tomcat running in our openptk servers. Do you have any detailed steps on the process? We have downloaded apache-tomcat-9.0.86.tar.gz. https://tomcat.apache.org/upgrading.html ? -chris - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Upgrade query
Hi, I have a question regarding upgrading to 9.0.86. The current version is 9.0.8 and needs to be upgraded to 9.0.86. We have apache tomcat running in our openptk servers. Do you have any detailed steps on the process? We have downloaded apache-tomcat-9.0.86.tar.gz. Thanks, Kalaivani G This e-mail is sent by Suncorp Group Limited ABN 66 145 290 124 or one of its related entities "Suncorp". Suncorp may be contacted at Level 23, 80 Ann Street, Brisbane or on 13 11 55 or at suncorp.com.au. Important Notice: This email may contain an individual's personal information (including sensitive information). Our handling of this information is subject to privacy laws. As an authorised recipient, please ensure that you take reasonable steps to protect and ensure the security of the information. The content of this e-mail is the view of the sender or stated author and does not necessarily reflect the view of Suncorp. The content, including attachments, is a confidential communication between Suncorp and the intended recipient. If you are not the intended recipient, any use, interference with, disclosure or copying of this e-mail, including attachments, is unauthorised and expressly prohibited. If you have received this e-mail in error please contact the sender immediately and delete the e-mail and any attachments from your system. ?
Re: Regarding Tomcat url redirection
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
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