You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Richard da Silva <ro...@yahoo.com> on 2010/10/18 07:57:13 UTC

Tomcat Re-direct

Hi all,

I have an IDM (Identity Manager) instance running on an Apache Tomcat Server.

My Tomact version is  : 6.0.18

The http address which activates my IDM application is in the format :

https://idm.my.org/idm


The thing is : if the address is accidentally written as follows ---  https://idm.my.org  ---- then the Apache Tomcat Main Page is displayed.

Normally, this means nothing, and would not bother me. Except that, there might be some security concerns involved in directing using to the Server Main Menu.

My question is :  how can I configure the Tomcat to automatically RE-DIRECT to the appropriate webpage ?

In other words :  if  someone enters "https://idm.my.org", they will be auto-directed to "https://idm.my.org/idm"


Thanks

Richard da Silva


      

Re: Tomcat Re-direct

Posted by Pid <pi...@pidster.com>.
On 18/10/2010 06:57, Richard da Silva wrote:
> Hi all,
> 
> I have an IDM (Identity Manager) instance running on an Apache Tomcat Server.
> 
> My Tomact version is  : 6.0.18

The current release is 6.0.29.  Time to think about an upgrade.

> The http address which activates my IDM application is in the format :
> 
> https://idm.my.org/idm
> 
> The thing is : if the address is accidentally written as follows ---  https://idm.my.org  ---- then the Apache Tomcat Main Page is displayed.

You've left the default apps installed.

> Normally, this means nothing, and would not bother me. Except that, there might be some security concerns involved in directing using to the Server Main Menu.

I don't know what you mean by the last part of that statement.

> My question is :  how can I configure the Tomcat to automatically RE-DIRECT to the appropriate webpage ?
> 
> In other words :  if  someone enters "https://idm.my.org", they will be auto-directed to "https://idm.my.org/idm"

You can either rename the idm.war (or directory 'idm') to ROOT.war (or
'ROOT') and make it the default application, operating on:

 https://idm.my.org/

or, you can add a new ROOT application which contains a JSP or
index.html which performs a simple redirect.

The former is easier.


p

RE: Tomcat Re-direct

Posted by Richard da Silva <ro...@yahoo.com>.
Hi Rob,

thanks for your reply.

I already have a file ----  index.html ---- in my ROOTS webapps folder.

Should I modify this file, by adding that code you gave me?

Or should I create another file named "index.html",  which would contain that code you gave me?


The index-html file I have currently, contains the following code at the beginning :


<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    <title>Apache Tomcat</title>
    <style type="text/css">
    /*<![CDATA[*/
      body {
          color: #000000;
          background-color: #FFFFFF;
      font-family: Arial, "Times New Roman", Times, serif;
          margin: 10px 0px;
      }


etc, etc, etc, etc   (The rest of the file contains merely code relating to fonts, and style, and color, etc)


Should I replace this code with the one you gave me?  Or insert it somewhere there?

Thanks

Richard da Silva

--- On Mon, 10/18/10, Rob Gregory <Ro...@ibsolutions.com> wrote:

From: Rob Gregory <Ro...@ibsolutions.com>
Subject: RE: Tomcat Re-direct
To: "Tomcat Users List" <us...@tomcat.apache.org>
Date: Monday, October 18, 2010, 11:41 AM

It doesn't need to be a .jsp file, just place a static index.html file into the root webapp with the following content:-


<!doctype html public "-//w3c//dtd html 4.0 transitional//en" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html>
    <head>
       <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
       <title>eSeries</title>
       <script>window.location.replace("/idm");</script>      
    </head>
    <body>Please Wait...</body>
</html>

No configuration required.

Regards,
Rob

> -----Original Message-----
> From: Richard da Silva [mailto:roman_seaa@yahoo.com]
> Sent: 18 October 2010 09:39
> To: Tomcat Users List
> Cc: karl.sangabriel@gmail.com
> Subject: Re: Tomcat Re-direct
> 
> Thanks for your reply
> 
> Where is that "wt.jsp" file?
> 
> Also, my web-xml file looks like this :
> 
> 
> <web-app xmlns="http://java.sun.com/xml/ns/javaee"
>    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
> http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
>    version="2.5">
> 
>   <display-name>Welcome to Tomcat</display-name>
>   <description>
>      Welcome to Tomcat
>   </description>
> 
> </web-app>
> 
> 
> 
> Where exactly should I insert the code you gave me?
> 
> Thanks
> 
> Richard da Silva
> 
> --- On Mon, 10/18/10, Karl San Gabriel <ka...@gmail.com> wrote:
> 
> From: Karl San Gabriel <ka...@gmail.com>
> Subject: Re: Tomcat Re-direct
> To: "Tomcat Users List" <us...@tomcat.apache.org>
> Date: Monday, October 18, 2010, 11:20 AM
> 
> and put a javascript code in wt.jsp to redirect to https://idm.my.org/idm.
> 
> On 10/18/10, Karl San Gabriel <ka...@gmail.com> wrote:
> > How about changing <TOMCAT_HOME>\webapps\ROOT\WEB-INF\web.xml?
> > ===================
> >   <description>
> >      Welcome to Tomcat
> >   </description>
> >
> > <!-- JSPC servlet mappings start -->
> >
> >     <servlet>
> >         <servlet-name>org.apache.jsp.index_jsp</servlet-name>
> >         <!--<servlet-class>org.apache.jsp.index_jsp</servlet-class>-->
> >         <jsp-file>/wt/wt.jsp</jsp-file>
> >     </servlet>
> >
> >     <servlet-mapping>
> >         <servlet-name>org.apache.jsp.index_jsp</servlet-name>
> >         <url-pattern>/index.jsp</url-pattern>
> >     </servlet-mapping>
> >
> > ============
> >
> > Regards,
> > Karl
> >
> >
> >
> >
> > On 10/18/10, Richard da Silva <ro...@yahoo.com> wrote:
> >> Hi all,
> >>
> >> I have an IDM (Identity Manager) instance running on an Apache Tomcat
> >> Server.
> >>
> >> My Tomact version is  : 6.0.18
> >>
> >> The http address which activates my IDM application is in the format :
> >>
> >> https://idm.my.org/idm
> >>
> >>
> >> The thing is : if the address is accidentally written as follows ---
> >> https://idm.my.org  ---- then the Apache Tomcat Main Page is displayed.
> >>
> >> Normally, this means nothing, and would not bother me. Except that, there
> >> might be some security concerns involved in directing using to the Server
> >> Main Menu.
> >>
> >> My question is :  how can I configure the Tomcat to automatically
> >> RE-DIRECT
> >> to the appropriate webpage ?
> >>
> >> In other words :  if  someone enters "https://idm.my.org", they will be
> >> auto-directed to "https://idm.my.org/idm"
> >>
> >>
> >> Thanks
> >>
> >> Richard da Silva
> >>
> >>
> >>
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> 
> 
> 

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




      

RE: Tomcat Re-direct

Posted by Rob Gregory <Ro...@ibsolutions.com>.
It doesn't need to be a .jsp file, just place a static index.html file into the root webapp with the following content:-


<!doctype html public "-//w3c//dtd html 4.0 transitional//en" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html>
    <head>
       <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
       <title>eSeries</title>
       <script>window.location.replace("/idm");</script>  	
    </head>
    <body>Please Wait...</body>
</html>

No configuration required.

Regards,
Rob

> -----Original Message-----
> From: Richard da Silva [mailto:roman_seaa@yahoo.com]
> Sent: 18 October 2010 09:39
> To: Tomcat Users List
> Cc: karl.sangabriel@gmail.com
> Subject: Re: Tomcat Re-direct
> 
> Thanks for your reply
> 
> Where is that "wt.jsp" file?
> 
> Also, my web-xml file looks like this :
> 
> 
> <web-app xmlns="http://java.sun.com/xml/ns/javaee"
>    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
> http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
>    version="2.5">
> 
>   <display-name>Welcome to Tomcat</display-name>
>   <description>
>      Welcome to Tomcat
>   </description>
> 
> </web-app>
> 
> 
> 
> Where exactly should I insert the code you gave me?
> 
> Thanks
> 
> Richard da Silva
> 
> --- On Mon, 10/18/10, Karl San Gabriel <ka...@gmail.com> wrote:
> 
> From: Karl San Gabriel <ka...@gmail.com>
> Subject: Re: Tomcat Re-direct
> To: "Tomcat Users List" <us...@tomcat.apache.org>
> Date: Monday, October 18, 2010, 11:20 AM
> 
> and put a javascript code in wt.jsp to redirect to https://idm.my.org/idm.
> 
> On 10/18/10, Karl San Gabriel <ka...@gmail.com> wrote:
> > How about changing <TOMCAT_HOME>\webapps\ROOT\WEB-INF\web.xml?
> > ===================
> >   <description>
> >      Welcome to Tomcat
> >   </description>
> >
> > <!-- JSPC servlet mappings start -->
> >
> >     <servlet>
> >         <servlet-name>org.apache.jsp.index_jsp</servlet-name>
> >         <!--<servlet-class>org.apache.jsp.index_jsp</servlet-class>-->
> >         <jsp-file>/wt/wt.jsp</jsp-file>
> >     </servlet>
> >
> >     <servlet-mapping>
> >         <servlet-name>org.apache.jsp.index_jsp</servlet-name>
> >         <url-pattern>/index.jsp</url-pattern>
> >     </servlet-mapping>
> >
> > ============
> >
> > Regards,
> > Karl
> >
> >
> >
> >
> > On 10/18/10, Richard da Silva <ro...@yahoo.com> wrote:
> >> Hi all,
> >>
> >> I have an IDM (Identity Manager) instance running on an Apache Tomcat
> >> Server.
> >>
> >> My Tomact version is  : 6.0.18
> >>
> >> The http address which activates my IDM application is in the format :
> >>
> >> https://idm.my.org/idm
> >>
> >>
> >> The thing is : if the address is accidentally written as follows ---
> >> https://idm.my.org  ---- then the Apache Tomcat Main Page is displayed.
> >>
> >> Normally, this means nothing, and would not bother me. Except that, there
> >> might be some security concerns involved in directing using to the Server
> >> Main Menu.
> >>
> >> My question is :  how can I configure the Tomcat to automatically
> >> RE-DIRECT
> >> to the appropriate webpage ?
> >>
> >> In other words :  if  someone enters "https://idm.my.org", they will be
> >> auto-directed to "https://idm.my.org/idm"
> >>
> >>
> >> Thanks
> >>
> >> Richard da Silva
> >>
> >>
> >>
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> 
> 
> 

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


Re: Tomcat Re-direct

Posted by Richard da Silva <ro...@yahoo.com>.
Thanks for your reply

Where is that "wt.jsp" file?

Also, my web-xml file looks like this :


<web-app xmlns="http://java.sun.com/xml/ns/javaee"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
   version="2.5">

  <display-name>Welcome to Tomcat</display-name>
  <description>
     Welcome to Tomcat
  </description>

</web-app>



Where exactly should I insert the code you gave me?

Thanks

Richard da Silva

--- On Mon, 10/18/10, Karl San Gabriel <ka...@gmail.com> wrote:

From: Karl San Gabriel <ka...@gmail.com>
Subject: Re: Tomcat Re-direct
To: "Tomcat Users List" <us...@tomcat.apache.org>
Date: Monday, October 18, 2010, 11:20 AM

and put a javascript code in wt.jsp to redirect to https://idm.my.org/idm.

On 10/18/10, Karl San Gabriel <ka...@gmail.com> wrote:
> How about changing <TOMCAT_HOME>\webapps\ROOT\WEB-INF\web.xml?
> ===================
>   <description>
>      Welcome to Tomcat
>   </description>
>
> <!-- JSPC servlet mappings start -->
>
>     <servlet>
>         <servlet-name>org.apache.jsp.index_jsp</servlet-name>
>         <!--<servlet-class>org.apache.jsp.index_jsp</servlet-class>-->
>         <jsp-file>/wt/wt.jsp</jsp-file>
>     </servlet>
>
>     <servlet-mapping>
>         <servlet-name>org.apache.jsp.index_jsp</servlet-name>
>         <url-pattern>/index.jsp</url-pattern>
>     </servlet-mapping>
>
> ============
>
> Regards,
> Karl
>
>
>
>
> On 10/18/10, Richard da Silva <ro...@yahoo.com> wrote:
>> Hi all,
>>
>> I have an IDM (Identity Manager) instance running on an Apache Tomcat
>> Server.
>>
>> My Tomact version is  : 6.0.18
>>
>> The http address which activates my IDM application is in the format :
>>
>> https://idm.my.org/idm
>>
>>
>> The thing is : if the address is accidentally written as follows ---
>> https://idm.my.org  ---- then the Apache Tomcat Main Page is displayed.
>>
>> Normally, this means nothing, and would not bother me. Except that, there
>> might be some security concerns involved in directing using to the Server
>> Main Menu.
>>
>> My question is :  how can I configure the Tomcat to automatically
>> RE-DIRECT
>> to the appropriate webpage ?
>>
>> In other words :  if  someone enters "https://idm.my.org", they will be
>> auto-directed to "https://idm.my.org/idm"
>>
>>
>> Thanks
>>
>> Richard da Silva
>>
>>
>>
>

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




      

Re: Tomcat Re-direct

Posted by Karl San Gabriel <ka...@gmail.com>.
and put a javascript code in wt.jsp to redirect to https://idm.my.org/idm.

On 10/18/10, Karl San Gabriel <ka...@gmail.com> wrote:
> How about changing <TOMCAT_HOME>\webapps\ROOT\WEB-INF\web.xml?
> ===================
>   <description>
>      Welcome to Tomcat
>   </description>
>
> <!-- JSPC servlet mappings start -->
>
>     <servlet>
>         <servlet-name>org.apache.jsp.index_jsp</servlet-name>
>         <!--<servlet-class>org.apache.jsp.index_jsp</servlet-class>-->
> 		<jsp-file>/wt/wt.jsp</jsp-file>
>     </servlet>
>
>     <servlet-mapping>
>         <servlet-name>org.apache.jsp.index_jsp</servlet-name>
>         <url-pattern>/index.jsp</url-pattern>
>     </servlet-mapping>
>
> ============
>
> Regards,
> Karl
>
>
>
>
> On 10/18/10, Richard da Silva <ro...@yahoo.com> wrote:
>> Hi all,
>>
>> I have an IDM (Identity Manager) instance running on an Apache Tomcat
>> Server.
>>
>> My Tomact version is  : 6.0.18
>>
>> The http address which activates my IDM application is in the format :
>>
>> https://idm.my.org/idm
>>
>>
>> The thing is : if the address is accidentally written as follows ---
>> https://idm.my.org  ---- then the Apache Tomcat Main Page is displayed.
>>
>> Normally, this means nothing, and would not bother me. Except that, there
>> might be some security concerns involved in directing using to the Server
>> Main Menu.
>>
>> My question is :  how can I configure the Tomcat to automatically
>> RE-DIRECT
>> to the appropriate webpage ?
>>
>> In other words :  if  someone enters "https://idm.my.org", they will be
>> auto-directed to "https://idm.my.org/idm"
>>
>>
>> Thanks
>>
>> Richard da Silva
>>
>>
>>
>

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


Re: Tomcat Re-direct

Posted by Karl San Gabriel <ka...@gmail.com>.
How about changing <TOMCAT_HOME>\webapps\ROOT\WEB-INF\web.xml?
===================
  <description>
     Welcome to Tomcat
  </description>

<!-- JSPC servlet mappings start -->

    <servlet>
        <servlet-name>org.apache.jsp.index_jsp</servlet-name>
        <!--<servlet-class>org.apache.jsp.index_jsp</servlet-class>-->
		<jsp-file>/wt/wt.jsp</jsp-file>
    </servlet>

    <servlet-mapping>
        <servlet-name>org.apache.jsp.index_jsp</servlet-name>
        <url-pattern>/index.jsp</url-pattern>
    </servlet-mapping>

============

Regards,
Karl




On 10/18/10, Richard da Silva <ro...@yahoo.com> wrote:
> Hi all,
>
> I have an IDM (Identity Manager) instance running on an Apache Tomcat
> Server.
>
> My Tomact version is  : 6.0.18
>
> The http address which activates my IDM application is in the format :
>
> https://idm.my.org/idm
>
>
> The thing is : if the address is accidentally written as follows ---
> https://idm.my.org  ---- then the Apache Tomcat Main Page is displayed.
>
> Normally, this means nothing, and would not bother me. Except that, there
> might be some security concerns involved in directing using to the Server
> Main Menu.
>
> My question is :  how can I configure the Tomcat to automatically RE-DIRECT
> to the appropriate webpage ?
>
> In other words :  if  someone enters "https://idm.my.org", they will be
> auto-directed to "https://idm.my.org/idm"
>
>
> Thanks
>
> Richard da Silva
>
>
>

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