You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Rob W. van Swol" <va...@nlr.nl> on 2001/09/27 11:39:00 UTC

Question: how to serve static pages with Apache

Hi,

I have set up Tomcat 4.0 with Apache 1.3.11 using mod_webapp. I have
included the following in httpd.conf:

LoadModule webapp_module libexec/mod_webapp.so
AddModule mod_webapp.c
WebAppConnection warpConnection      warp  localhost:8008
WebAppDeploy     examples  warpConnection  /examples
WebAppInfo /webapp-info

wepapp-info shows my configuration and even the examples work, but only
when I point my browser to the servlets directly (and also the directory
is shown, although by tomcat because there is no index.html in the
examples directory). However, Apache cannot find the static pages! I
already tried to put the follwing also in  httpd.conf:

Alias /examples "/PATH-to/tomcat/webapps/examples"
<Directory "/PATH-to/tomcat/webapps/examples">
    Options Indexes FollowSymLinks
</Directory>

but this doesn't work either. Any ideas?

Regards
Rob
-- 
_____________________________________________________________

Rob W. van Swol
National Aerospace Laboratory NLR       Tel. +31 527 248252
P.O. Box 153                            Fax  +31 527 248210
8300 AD Emmeloord                       E-Mail vanswol@nlr.nl
The Netherlands                         http://www.neonet.nl/


Re: Apache, Tomcat, mod_webapp and Static files

Posted by David Smith <dn...@cornell.edu>.
Mod_webapp forwards all requests for a directory to the app and as of right 
now, there is no "send jsp's to TC, but serve out the rest local".  As I 
understand it from Pier's past posts, this is in the future without a 
definite time table.  For now, best bet is to either place the static content 
in a separate dir not forwarded by mod_webapp or use mod_jk instead.  Mod_jk 
uses wild cards to selectively forward only some requests while leaving 
others.

--David Smith

On Friday 09 November 2001 02:54 pm, you wrote:
> I still would like to know how to have Apache handle the static
> files while Tomcat handles the dynamic ones.
>
> Bob
> ----- Original Message -----
> From: "Bob Byron" <ja...@radit.com>
> To: <to...@jakarta.apache.org>
> Sent: Thursday, November 08, 2001 5:47 PM
> Subject: Apache, Tomcat, mod_webapp and Static files
>
> > I have Apache configured to delivier a number
> > of websites using the VirtualHost.  I have since
> > added a webapp to one site using the
> > WebAppDeploy directive.  Problem is that
> > all files are now delivered from Tomcat.  Is
> > there a gude somewhere on how to have
> > Apache deliver the static files and have Tomcat
> > deliver the jsp's?
> >
> > Thanks,
> > Bob Byron
> >
> >
> > --
> > To unsubscribe:   <ma...@jakarta.apache.org>
> > For additional commands: <ma...@jakarta.apache.org>
> > Troubles with the list: <ma...@jakarta.apache.org>
>
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Apache, Tomcat, mod_webapp and Static files

Posted by James Williamson <ja...@nameonthe.net>.
Hi Paul,

You can actually do this in Apache, webapp sets itself up as the default
handler for all files under the context you've set it to (I wrote about this
a while back). To have static files (i.e. .html) processed by Apache you can
override mod_webapp by doing something like this:

AddHandler default-handler .gif .jpeg .html

This does however depend on your Apache configuration (i.e. which order
handlers are called), but normally you should be OK.

Regards,

James

----- Original Message -----
From: Paul Devisser <pa...@stonylakesolutions.com>
To: Tomcat Users List <to...@jakarta.apache.org>
Sent: Friday, November 09, 2001 8:06 PM
Subject: Re: Apache, Tomcat, mod_webapp and Static files


> We experienced a similar problem.  Our solution was to place the static
> pages in the document root .../www/html while having the webapp utilize
> something like /webapp/
>
> Using paths such as /images to serve up graphics and such, Apache serves
the
> static, while only passing anything with a /webapp/ url to Tomcat.  Not
the
> prettiest of solutions, but it seemed the simpliest.
>
> Paul Devisser
>
> ----- Original Message -----
> From: "Bob Byron" <bb...@radit.com>
> To: "Tomcat Users List" <to...@jakarta.apache.org>
> Sent: Friday, November 09, 2001 2:54 PM
> Subject: Re: Apache, Tomcat, mod_webapp and Static files
>
>
> > I still would like to know how to have Apache handle the static
> > files while Tomcat handles the dynamic ones.
> >
> > Bob
> > ----- Original Message -----
> > From: "Bob Byron" <ja...@radit.com>
> > To: <to...@jakarta.apache.org>
> > Sent: Thursday, November 08, 2001 5:47 PM
> > Subject: Apache, Tomcat, mod_webapp and Static files
> >
> >
> > > I have Apache configured to delivier a number
> > > of websites using the VirtualHost.  I have since
> > > added a webapp to one site using the
> > > WebAppDeploy directive.  Problem is that
> > > all files are now delivered from Tomcat.  Is
> > > there a gude somewhere on how to have
> > > Apache deliver the static files and have Tomcat
> > > deliver the jsp's?
> > >
> > > Thanks,
> > > Bob Byron
> > >
> > >
> > > --
> > > To unsubscribe:   <ma...@jakarta.apache.org>
> > > For additional commands: <ma...@jakarta.apache.org>
> > > Troubles with the list: <ma...@jakarta.apache.org>
> >
> >
> > --
> > To unsubscribe:   <ma...@jakarta.apache.org>
> > For additional commands: <ma...@jakarta.apache.org>
> > Troubles with the list: <ma...@jakarta.apache.org>
> >
>
>
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>
>


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Apache, Tomcat, mod_webapp and Static files

Posted by Paul Devisser <pa...@stonylakesolutions.com>.
We experienced a similar problem.  Our solution was to place the static
pages in the document root .../www/html while having the webapp utilize
something like /webapp/

Using paths such as /images to serve up graphics and such, Apache serves the
static, while only passing anything with a /webapp/ url to Tomcat.  Not the
prettiest of solutions, but it seemed the simpliest.

Paul Devisser

----- Original Message -----
From: "Bob Byron" <bb...@radit.com>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Friday, November 09, 2001 2:54 PM
Subject: Re: Apache, Tomcat, mod_webapp and Static files


> I still would like to know how to have Apache handle the static
> files while Tomcat handles the dynamic ones.
>
> Bob
> ----- Original Message -----
> From: "Bob Byron" <ja...@radit.com>
> To: <to...@jakarta.apache.org>
> Sent: Thursday, November 08, 2001 5:47 PM
> Subject: Apache, Tomcat, mod_webapp and Static files
>
>
> > I have Apache configured to delivier a number
> > of websites using the VirtualHost.  I have since
> > added a webapp to one site using the
> > WebAppDeploy directive.  Problem is that
> > all files are now delivered from Tomcat.  Is
> > there a gude somewhere on how to have
> > Apache deliver the static files and have Tomcat
> > deliver the jsp's?
> >
> > Thanks,
> > Bob Byron
> >
> >
> > --
> > To unsubscribe:   <ma...@jakarta.apache.org>
> > For additional commands: <ma...@jakarta.apache.org>
> > Troubles with the list: <ma...@jakarta.apache.org>
>
>
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>
>


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Apache, Tomcat, mod_webapp and Static files

Posted by Bob Byron <bb...@radit.com>.
I still would like to know how to have Apache handle the static
files while Tomcat handles the dynamic ones.

Bob
----- Original Message ----- 
From: "Bob Byron" <ja...@radit.com>
To: <to...@jakarta.apache.org>
Sent: Thursday, November 08, 2001 5:47 PM
Subject: Apache, Tomcat, mod_webapp and Static files


> I have Apache configured to delivier a number
> of websites using the VirtualHost.  I have since
> added a webapp to one site using the 
> WebAppDeploy directive.  Problem is that 
> all files are now delivered from Tomcat.  Is
> there a gude somewhere on how to have
> Apache deliver the static files and have Tomcat
> deliver the jsp's?
> 
> Thanks,
> Bob Byron
> 
> 
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Apache, Tomcat, mod_webapp and Static files

Posted by Bob Byron <ja...@radit.com>.
I have Apache configured to delivier a number
of websites using the VirtualHost.  I have since
added a webapp to one site using the 
WebAppDeploy directive.  Problem is that 
all files are now delivered from Tomcat.  Is
there a gude somewhere on how to have
Apache deliver the static files and have Tomcat
deliver the jsp's?

Thanks,
Bob Byron


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>