You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Peter Alvin <pa...@awebabove.com> on 2003/06/03 05:35:59 UTC

How Directly Run Servlet W/O Redirect From Index.html?

When someone types:
 
    www.site.com
 
Apache serves index.html which I added an an immediate redirect to 
load the "real" site's homepage which is a Java servlet.  
 
Does anyone know how to configure Apache, DNS, or MOD_SSL to go 
directly to the servlet for the home page?
 
- Apache 1.3.27
- mod_ssl-2.8.12-1.3.27
- openssl-0.9.7a
 
Pietro da Alvin




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


Re: How Directly Run Servlet W/O Redirect From Index.html?

Posted by John Turner <to...@johnturner.com>.
AFAIK, this doesn't work.

Apache (mod_dir?) doesn't pick up that index.jsp is a valid directory index 
file prior to the URL being tested against JkMount.

John

On Tue, 03 Jun 2003 07:17:23 -0400, Tim Funk <fu...@joedog.org> wrote:

> add index.jsp as a default file to apache config
>
> DirectoryIndex index.jsp index.html more_cowbell.html
>
> -Tim
>
> Peter Alvin wrote:
>> When someone types:
>> www.site.com
>> Apache serves index.html which I added an an immediate redirect to load 
>> the "real" site's homepage which is a Java servlet.
>> Does anyone know how to configure Apache, DNS, or MOD_SSL to go directly 
>> to the servlet for the home page?
>> - Apache 1.3.27
>> - mod_ssl-2.8.12-1.3.27
>> - openssl-0.9.7a
>> Pietro da Alvin
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>



-- 
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/

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


Re: How Directly Run Servlet W/O Redirect From Index.html?

Posted by Peter Alvin <pa...@awebabove.com>.
mod_rewrite worked!  Here is the solution:
 
RewriteEngine on
RewriteRule ^/$ /home.htm [R] 
 
This is a problem I've been grappling with for a year!  Thanks 
everyone!
 
Pietro da Alvin
719-210-3858
 
Chi cerca trova (Who searches, finds)
Italian Proverb
 
 
On Tue, 03 Jun 2003 08:58:40 -0400, Tim Funk wrote:
>In tomcat 4.X a welcome file cannot be a servlet. It must be a file.
>(This rule changes with servlet api 2.4) So for now, you can be
>tricky, for example:
>
>I have a servlet mapped to *.cowbell.
>
>I create an (empty) file called index.cowbell. I also make sure my
>welcome file listing includes index.cowbell, and I make sure apache
>knows about index.cowbell via the DirectoryIndex.
>
>While index.cowbell, the file is not touched, index.cowbell the
>servlet will be invoked.
>
>-Tim
>
>Joël Wijngaarde [Us Media] wrote:
>>Can't you use a RewriteRule (see 
http://httpd.apache.org/docs-
>>2.0/mod/mod_rewrite.html) from within apache to rewrite the default
>>URL to an URL pointing at your servlet.
>>
>>Or maybe even a configure a filter in your web.xml doing the
>>redirect?
>>
>>- Joel
>>
>>On Tue, 2003-06-03 at 14:08, Tim Funk wrote:
>>
>>>Then your out of luck.
>>>
>>>-Tim
>>>
>>>Peter Alvin wrote:
>>>
>>>>Thank you.  I tried DirectoryIndex but it looks like that looks
>>>>for a file on the filesystem and all my webpages are all served
>>>>from the servlet.
>>>>
>>>>Pietro da Alvin 719-210-3858
>>>>
>>>>Chi cerca trova (Who searches, finds) Italian Proverb
>>>>
>>>>
>>>>On Tue, 03 Jun 2003 07:17:23 -0400, Tim Funk wrote:
>>>>
>>>>
>>>>>add index.jsp as a default file to apache config
>>>>>
>>>>>DirectoryIndex index.jsp index.html more_cowbell.html
>>>>>
>>>>>-Tim
>>>>>
>>>>>Peter Alvin wrote:
>>>>>
>>>>>
>>>>>>When someone types:
>>>>>>
>>>>>>www.site.com
>>>>>>
>>>>>>Apache serves index.html which I added an an immediate redirect
>>>>>to
>>>>>>load the "real" site's homepage which is a Java servlet.
>>>>>>
>>>>>>Does anyone know how to configure Apache, DNS, or MOD_SSL to go
>>>>>>directly to the servlet for the home page?
>>>>>>
>>>>>>- Apache 1.3.27 - mod_ssl-2.8.12-1.3.27 - openssl-0.9.7a
>>>>>>
>>>>>>Pietro da Alvin
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>----------------------------------------------------------------
>>>>>----
>>>>>>-
>>>>>>To unsubscribe, e-mail: tomcat-user-
>>>>>unsubscribe@jakarta.apache.org
>>>>>>For additional commands, e-mail: tomcat-user-
>>>>>>help@jakarta.apache.org
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>-----------------------------------------------------------------
>>>>>----
>>>>>To unsubscribe, e-mail: tomcat-user-
>>>>>unsubscribe@jakarta.apache.org For additional commands, e-mail:
>>>>>tomcat-user-
>>>>>help@jakarta.apache.org
>>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>------------------------------------------------------------------
>>>>---
>>>>To unsubscribe, e-mail: tomcat-user-
>>>>unsubscribe@jakarta.apache.org For additional commands, e-mail:
>>>>tomcat-user-
>>>>help@jakarta.apache.org
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>>-------------------------------------------------------------------
>>>--
>>>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>>>For additional commands, e-mail: tomcat-user-
>>>help@jakarta.apache.org
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
 




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


Re: How Directly Run Servlet W/O Redirect From Index.html?

Posted by Tim Funk <fu...@joedog.org>.
In tomcat 4.X a welcome file cannot be a servlet. It must be a file. (This 
rule changes with servlet api 2.4) So for now, you can be tricky, for example:

I have a servlet mapped to *.cowbell.

I create an (empty) file called index.cowbell. I also make sure my welcome 
file listing includes index.cowbell, and I make sure apache knows about 
index.cowbell via the DirectoryIndex.

While index.cowbell, the file is not touched, index.cowbell the servlet will 
be invoked.

-Tim

Joël Wijngaarde [Us Media] wrote:
> Can't you use a RewriteRule (see
> http://httpd.apache.org/docs-2.0/mod/mod_rewrite.html) from within
> apache to rewrite the default URL to an URL pointing at your servlet.
> 
> Or maybe even a configure a filter in your web.xml doing the redirect?
> 
> - Joel
> 
> On Tue, 2003-06-03 at 14:08, Tim Funk wrote:
> 
>>Then your out of luck.
>>
>>-Tim
>>
>>Peter Alvin wrote:
>>
>>>Thank you.  I tried DirectoryIndex but it looks like that looks for a 
>>>file on the filesystem and all my webpages are all served from the 
>>>servlet.    
>>> 
>>>Pietro da Alvin
>>>719-210-3858
>>> 
>>>Chi cerca trova (Who searches, finds)
>>>Italian Proverb
>>>
>>>
>>>On Tue, 03 Jun 2003 07:17:23 -0400, Tim Funk wrote:
>>>
>>>
>>>>add index.jsp as a default file to apache config
>>>>
>>>>DirectoryIndex index.jsp index.html more_cowbell.html
>>>>
>>>>-Tim
>>>>
>>>>Peter Alvin wrote:
>>>>
>>>>
>>>>>When someone types:
>>>>>
>>>>>www.site.com
>>>>>
>>>>>Apache serves index.html which I added an an immediate redirect to
>>>>>load the "real" site's homepage which is a Java servlet.
>>>>>
>>>>>Does anyone know how to configure Apache, DNS, or MOD_SSL to go
>>>>>directly to the servlet for the home page?
>>>>>
>>>>>- Apache 1.3.27 - mod_ssl-2.8.12-1.3.27 - openssl-0.9.7a
>>>>>
>>>>>Pietro da Alvin
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>--------------------------------------------------------------------
>>>>>-
>>>>>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>>>>>For additional commands, e-mail: tomcat-user-
>>>>>help@jakarta.apache.org
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>>---------------------------------------------------------------------
>>>>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>>>>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>>>>
>>>
>>>
>>>
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>>>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>>>
>>>
>>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


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


Re: How Directly Run Servlet W/O Redirect From Index.html?

Posted by John Turner <to...@johnturner.com>.
Yes, you can use mod_rewrite.  Most people are not proficient enough to do 
so.

John

On 03 Jun 2003 14:17:25 +0200, Joël "Wijngaarde [Us Media] 
<jo...@usmedia.nl> wrote:

> Can't you use a RewriteRule (see
> http://httpd.apache.org/docs-2.0/mod/mod_rewrite.html) from within
> apache to rewrite the default URL to an URL pointing at your servlet.
>
> Or maybe even a configure a filter in your web.xml doing the redirect?
>
> - Joel
>
> On Tue, 2003-06-03 at 14:08, Tim Funk wrote:
>> Then your out of luck.
>>
>> -Tim
>>
>> Peter Alvin wrote:
>> > Thank you.  I tried DirectoryIndex but it looks like that looks for a 
>> > file on the filesystem and all my webpages are all served from the > 
>> servlet.    >  > Pietro da Alvin
>> > 719-210-3858
>> >  > Chi cerca trova (Who searches, finds)
>> > Italian Proverb
>> > > > On Tue, 03 Jun 2003 07:17:23 -0400, Tim Funk wrote:
>> > >>add index.jsp as a default file to apache config
>> >>
>> >>DirectoryIndex index.jsp index.html more_cowbell.html
>> >>
>> >>-Tim
>> >>
>> >>Peter Alvin wrote:
>> >>
>> >>>When someone types:
>> >>>
>> >>>www.site.com
>> >>>
>> >>>Apache serves index.html which I added an an immediate redirect to
>> >>>load the "real" site's homepage which is a Java servlet.
>> >>>
>> >>>Does anyone know how to configure Apache, DNS, or MOD_SSL to go
>> >>>directly to the servlet for the home page?
>> >>>
>> >>>-Apache 1.3.27 - mod_ssl-2.8.12-1.3.27 - openssl-0.9.7a
>> >>>
>> >>>Pietro da Alvin
>> >>>
>> >>>
>> >>>
>> >>>
>> >>>
>> >>>--------------------------------------------------------------------
>> >>>-
>> >>>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>> >>>For additional commands, e-mail: tomcat-user-
>> >>>help@jakarta.apache.org
>> >>>
>> >>>
>> >>>
>> >>
>> >>
>> >>
>> >>---------------------------------------------------------------------
>> >>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>> >>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>> >>
>> > > > > > > ------------------------------------------------------------- 
>>
>>
>> --------
>> > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>> > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>> > > >
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org



-- 
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/

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


Re: How Directly Run Servlet W/O Redirect From Index.html?

Posted by "Joël Wijngaarde [Us Media]" <jo...@usmedia.nl>.
Can't you use a RewriteRule (see
http://httpd.apache.org/docs-2.0/mod/mod_rewrite.html) from within
apache to rewrite the default URL to an URL pointing at your servlet.

Or maybe even a configure a filter in your web.xml doing the redirect?

- Joel

On Tue, 2003-06-03 at 14:08, Tim Funk wrote:
> Then your out of luck.
> 
> -Tim
> 
> Peter Alvin wrote:
> > Thank you.  I tried DirectoryIndex but it looks like that looks for a 
> > file on the filesystem and all my webpages are all served from the 
> > servlet.    
> >  
> > Pietro da Alvin
> > 719-210-3858
> >  
> > Chi cerca trova (Who searches, finds)
> > Italian Proverb
> > 
> > 
> > On Tue, 03 Jun 2003 07:17:23 -0400, Tim Funk wrote:
> > 
> >>add index.jsp as a default file to apache config
> >>
> >>DirectoryIndex index.jsp index.html more_cowbell.html
> >>
> >>-Tim
> >>
> >>Peter Alvin wrote:
> >>
> >>>When someone types:
> >>>
> >>>www.site.com
> >>>
> >>>Apache serves index.html which I added an an immediate redirect to
> >>>load the "real" site's homepage which is a Java servlet.
> >>>
> >>>Does anyone know how to configure Apache, DNS, or MOD_SSL to go
> >>>directly to the servlet for the home page?
> >>>
> >>>- Apache 1.3.27 - mod_ssl-2.8.12-1.3.27 - openssl-0.9.7a
> >>>
> >>>Pietro da Alvin
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>--------------------------------------------------------------------
> >>>-
> >>>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> >>>For additional commands, e-mail: tomcat-user-
> >>>help@jakarta.apache.org
> >>>
> >>>
> >>>
> >>
> >>
> >>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> >>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> >>
> > 
> > 
> > 
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> > 
> > 
> > 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
-- 
Us Media
Stadhouderskade 115
1073 AX Amsterdam

t: +31 20 428 6868
f: +31 20 470 6905
w: http://www.usmedia.nl


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


Re: How Directly Run Servlet W/O Redirect From Index.html?

Posted by Tim Funk <fu...@joedog.org>.
Then your out of luck.

-Tim

Peter Alvin wrote:
> Thank you.  I tried DirectoryIndex but it looks like that looks for a 
> file on the filesystem and all my webpages are all served from the 
> servlet.    
>  
> Pietro da Alvin
> 719-210-3858
>  
> Chi cerca trova (Who searches, finds)
> Italian Proverb
> 
> 
> On Tue, 03 Jun 2003 07:17:23 -0400, Tim Funk wrote:
> 
>>add index.jsp as a default file to apache config
>>
>>DirectoryIndex index.jsp index.html more_cowbell.html
>>
>>-Tim
>>
>>Peter Alvin wrote:
>>
>>>When someone types:
>>>
>>>www.site.com
>>>
>>>Apache serves index.html which I added an an immediate redirect to
>>>load the "real" site's homepage which is a Java servlet.
>>>
>>>Does anyone know how to configure Apache, DNS, or MOD_SSL to go
>>>directly to the servlet for the home page?
>>>
>>>- Apache 1.3.27 - mod_ssl-2.8.12-1.3.27 - openssl-0.9.7a
>>>
>>>Pietro da Alvin
>>>
>>>
>>>
>>>
>>>
>>>--------------------------------------------------------------------
>>>-
>>>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>>>For additional commands, e-mail: tomcat-user-
>>>help@jakarta.apache.org
>>>
>>>
>>>
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>>
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> 
> 


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


Re: How Directly Run Servlet W/O Redirect From Index.html?

Posted by Peter Alvin <pa...@awebabove.com>.
Thank you.  I tried DirectoryIndex but it looks like that looks for a 
file on the filesystem and all my webpages are all served from the 
servlet.    
 
Pietro da Alvin
719-210-3858
 
Chi cerca trova (Who searches, finds)
Italian Proverb


On Tue, 03 Jun 2003 07:17:23 -0400, Tim Funk wrote:
>add index.jsp as a default file to apache config
>
>DirectoryIndex index.jsp index.html more_cowbell.html
>
>-Tim
>
>Peter Alvin wrote:
>>When someone types:
>>
>>www.site.com
>>
>>Apache serves index.html which I added an an immediate redirect to
>>load the "real" site's homepage which is a Java servlet.
>>
>>Does anyone know how to configure Apache, DNS, or MOD_SSL to go
>>directly to the servlet for the home page?
>>
>>- Apache 1.3.27 - mod_ssl-2.8.12-1.3.27 - openssl-0.9.7a
>>
>>Pietro da Alvin
>>
>>
>>
>>
>>
>>--------------------------------------------------------------------
>>-
>>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tomcat-user-
>>help@jakarta.apache.org
>>
>>
>>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>




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


Re: How Directly Run Servlet W/O Redirect From Index.html?

Posted by Tim Funk <fu...@joedog.org>.
add index.jsp as a default file to apache config

DirectoryIndex index.jsp index.html more_cowbell.html

-Tim

Peter Alvin wrote:
> When someone types:
>  
>     www.site.com
>  
> Apache serves index.html which I added an an immediate redirect to 
> load the "real" site's homepage which is a Java servlet.  
>  
> Does anyone know how to configure Apache, DNS, or MOD_SSL to go 
> directly to the servlet for the home page?
>  
> - Apache 1.3.27
> - mod_ssl-2.8.12-1.3.27
> - openssl-0.9.7a
>  
> Pietro da Alvin
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> 
> 


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