You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Kapil Sharma <ks...@wishstream.com> on 2002/07/07 01:03:03 UTC

Tomcat and static content

Hi,
I have got a problem. I am using apache 1.3.26+tomcat 1.3.1. Is there
any way to know that apache is serving all static content like
.html/.gif/.jpeg? My virtual host (in apache) is running very slow and
images are breaking..

Please help?

Cheers
kapil



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Tomcat and static content

Posted by Tim Funk <fu...@joedog.org>.
The apache access logs can tell you how long it took for a request to be 
served. All requests (whether they live in tomcat or not) are served by 
apache. So you'll need to check your access logs on the tomcat instance 
to see if only jsp's (or servlets are showing up) are being served by 
tomcat. If image requests are appearing in the tomcat logs - then tomcat 
is serving images. (Meaning apache is probably forwarding all requests 
to tomcat, which is inefficient)

Kapil Sharma wrote:
> Hi,
> Well I can see the images and pages request in apache access log. But it
> shows request for .jsp as well as images file. So I am still confused
> whether the images are served by tomcat or apache?
> 
> Cheers
> kapil
> 
> -----Original Message-----
> From: David Kavanagh [mailto:dak@dotech.com] 
> Sent: 07 July 2002 17:07
> To: Tomcat Users List
> Subject: Re: Tomcat and static content
> 
> 
> Kapil,
> You could look at the apache access log. It will tell when an image has 
> been served. There is now way (that I know of) to configure apache to 
> trap all image requests that would be handled by a tomcat context. Is 
> that what you are trying to do? If so, your web app needs to use paths 
> that are not within the web app context. You can set up aliases within 
> httpd.conf to make it easier to link images from the web app to some 
> convenient path on your httpd server.
> 
> Hope this helps.
> 
> David
> 
> Kapil Sharma wrote:
> 
> 
>>Can someone answer it please...
>>
>>kapil
>>
>>-----Original Message-----
>>From: Kapil Sharma [mailto:ksharma@wishstream.com]
>>Sent: 07 July 2002 00:03
>>To: 'Tomcat Users List'
>>Subject: Tomcat and static content
>>
>>
>>Hi,
>>I have got a problem. I am using apache 1.3.26+tomcat 1.3.1. Is there 
>>any way to know that apache is serving all static content like 
>>.html/.gif/.jpeg? My virtual host (in apache) is running very slow and 
>>images are breaking..
>>
>>Please help?
>>
>>Cheers
>>kapil
>>
>>
>>
>>--
>>To unsubscribe, e-mail: 
>><ma...@jakarta.apache.org>
>>For additional commands, e-mail: 
>><ma...@jakarta.apache.org>
>>
>>
>>
>>
>>--
>>To unsubscribe, e-mail:
> 
> <ma...@jakarta.apache.org>
> 
>>For additional commands, e-mail: 
>><ma...@jakarta.apache.org>
>>
> 
> 
> 
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 
> 
> 



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Tomcat and static content

Posted by Kapil Sharma <ks...@wishstream.com>.
Hi,
I have got the following lines in my mod_jk.conf-auto file:

# Static files
Alias /foo "/export/home/test/u2/current/foo"
 
<Directory "/export/home/test/u2/current/foo">
    Options Indexes FollowSymLinks
    DirectoryIndex index.jsp index.html index.htm logon.jsp
</Directory>

1: What is the meaning of alias here. This means that apache will deal
with this alias to serve static content?
2: Where can I define Indexes? How can I get rid of directory indexing?
I have already made <StaticInterceptor listings="false" /> change in
server.xml, but still indexing is enables?

kapil



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Tomcat and static content

Posted by Andrew Conrad <an...@msn.com>.
Modify your urlworkermap.properties so it serves only jsp files

Etc...

/*.jsp=ajp13

- Andrew


-----Original Message-----
From: Kapil Sharma [mailto:ksharma@wishstream.com] 
Sent: Sunday, July 07, 2002 12:06 PM
To: 'Tomcat Users List'
Subject: RE: Tomcat and static content


Hi,
Well I can see the images and pages request in apache access log. But it
shows request for .jsp as well as images file. So I am still confused
whether the images are served by tomcat or apache?

Cheers
kapil

-----Original Message-----
From: David Kavanagh [mailto:dak@dotech.com]
Sent: 07 July 2002 17:07
To: Tomcat Users List
Subject: Re: Tomcat and static content


Kapil,
You could look at the apache access log. It will tell when an image has
been served. There is now way (that I know of) to configure apache to
trap all image requests that would be handled by a tomcat context. Is
that what you are trying to do? If so, your web app needs to use paths
that are not within the web app context. You can set up aliases within
httpd.conf to make it easier to link images from the web app to some
convenient path on your httpd server.

Hope this helps.

David

Kapil Sharma wrote:

>Can someone answer it please...
>
>kapil
>
>-----Original Message-----
>From: Kapil Sharma [mailto:ksharma@wishstream.com]
>Sent: 07 July 2002 00:03
>To: 'Tomcat Users List'
>Subject: Tomcat and static content
>
>
>Hi,
>I have got a problem. I am using apache 1.3.26+tomcat 1.3.1. Is there 
>any way to know that apache is serving all static content like 
>.html/.gif/.jpeg? My virtual host (in apache) is running very slow and 
>images are breaking..
>
>Please help?
>
>Cheers
>kapil
>
>
>
>--
>To unsubscribe, e-mail: 
><ma...@jakarta.apache.org>
>For additional commands, e-mail: 
><ma...@jakarta.apache.org>
>
>
>
>
>--
>To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
>For additional commands, e-mail: 
><ma...@jakarta.apache.org>
>



--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>




--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Tomcat and static content

Posted by Kapil Sharma <ks...@wishstream.com>.
Hi,
Well I can see the images and pages request in apache access log. But it
shows request for .jsp as well as images file. So I am still confused
whether the images are served by tomcat or apache?

Cheers
kapil

-----Original Message-----
From: David Kavanagh [mailto:dak@dotech.com] 
Sent: 07 July 2002 17:07
To: Tomcat Users List
Subject: Re: Tomcat and static content


Kapil,
You could look at the apache access log. It will tell when an image has 
been served. There is now way (that I know of) to configure apache to 
trap all image requests that would be handled by a tomcat context. Is 
that what you are trying to do? If so, your web app needs to use paths 
that are not within the web app context. You can set up aliases within 
httpd.conf to make it easier to link images from the web app to some 
convenient path on your httpd server.

Hope this helps.

David

Kapil Sharma wrote:

>Can someone answer it please...
>
>kapil
>
>-----Original Message-----
>From: Kapil Sharma [mailto:ksharma@wishstream.com]
>Sent: 07 July 2002 00:03
>To: 'Tomcat Users List'
>Subject: Tomcat and static content
>
>
>Hi,
>I have got a problem. I am using apache 1.3.26+tomcat 1.3.1. Is there 
>any way to know that apache is serving all static content like 
>.html/.gif/.jpeg? My virtual host (in apache) is running very slow and 
>images are breaking..
>
>Please help?
>
>Cheers
>kapil
>
>
>
>--
>To unsubscribe, e-mail: 
><ma...@jakarta.apache.org>
>For additional commands, e-mail: 
><ma...@jakarta.apache.org>
>
>
>
>
>--
>To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
>For additional commands, e-mail: 
><ma...@jakarta.apache.org>
>



--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Tomcat and static content

Posted by David Kavanagh <da...@dotech.com>.
Kapil,
You could look at the apache access log. It will tell when an image has 
been served. There is now way (that I know of) to configure apache to 
trap all image requests that would be handled by a tomcat context. Is 
that what you are trying to do? If so, your web app needs to use paths 
that are not within the web app context. You can set up aliases within 
httpd.conf to make it easier to link images from the web app to some 
convenient path on your httpd server.

Hope this helps.

David

Kapil Sharma wrote:

>Can someone answer it please...
>
>kapil
>
>-----Original Message-----
>From: Kapil Sharma [mailto:ksharma@wishstream.com] 
>Sent: 07 July 2002 00:03
>To: 'Tomcat Users List'
>Subject: Tomcat and static content
>
>
>Hi,
>I have got a problem. I am using apache 1.3.26+tomcat 1.3.1. Is there
>any way to know that apache is serving all static content like
>.html/.gif/.jpeg? My virtual host (in apache) is running very slow and
>images are breaking..
>
>Please help?
>
>Cheers
>kapil
>
>
>
>--
>To unsubscribe, e-mail:
><ma...@jakarta.apache.org>
>For additional commands, e-mail:
><ma...@jakarta.apache.org>
>
>
>
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Tomcat and static content

Posted by Fredrik Viklund <fr...@biochem.kth.se>.
Kapil Sharma wrote:

> I have got a problem. I am using apache 1.3.26+tomcat 1.3.1. Is there
> any way to know that apache is serving all static content like
> .html/.gif/.jpeg? My virtual host (in apache) is running very slow and
> images are breaking..

I would try these things: (Bear in mind that I am a OpenBSD user and Tomcat
beginner, so this may be completely out of range.

1. Find the problem. Go directly to Tomcat (using its network port), without
passing through the Apache server. If this is faster, the problem is on the
Apache side, if it's still slow, the problem is on the Tomcat side.

2. If the problem is on Tomcat: Are the static pages also parsed by Tomcat. It
should be possible to set some extensions as static content and send them through
the server without parsing them for JSP code etc. I think this is defined in your
web.xml file. (I *said* I'm a beginner:-)

3. Anyway, if the problem can't be fixed in Tomcat, you could set your Apache to
forward only URL:s that end in .jsp to Tomcat.
I use URL rewriting to forward any http://jsp.my.server.com/url.html url to
http://my.server.com:8080/url.html
In that case you do the same, it is easy:
Modify your your Apache httpd.conf under the virutal hosts section for the Tomcat
server:
 RewriteEngine On
 RewriteCondition %{HTTP:Authorization} ^(.*)
 RewriteRule ^(.*\.jsp) http://your.server:8080$1
[e=HTTP_CGI_AUTHORIZATION:%1,t=application/x-httpd-cgi,l,P]

Then Authorization line is only needed if you are using logins or other features
that use HTTP authorization.
The last line is
 RewriteRule ^(.*) (etcetera)
if you want to forward everything to port 8080.

You will of course need to do "LoadModule rewrite_module
/usr/lib/apache/modules/mod_rewrite.so" or similar earlier in your httpd.conf,
but that is covered elsewhere in the Apache documentation.

Good luck.

    /Fredrik




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Tomcat and static content

Posted by Kapil Sharma <ks...@wishstream.com>.
Hi,
I can access the static web pages but it is very slow. Images are
loading very slow!!

kapil

-----Original Message-----
From: mls@VegInfo.com [mailto:mls@VegInfo.com] 
Sent: 07 July 2002 17:10
To: Tomcat Users List
Subject: Re: Tomcat and static content


Kapil Sharma wrote:
> Is there any way to know that apache is serving
> all static content like .html/.gif/.jpeg?

[ May be I am missing something fundamental in your question. ]

Can't you just access one of your static web pages from another computer
and see what you get? 

das

--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Tomcat and static content

Posted by ml...@VegInfo.com.
Kapil Sharma wrote:
> Is there any way to know that apache is serving 
> all static content like .html/.gif/.jpeg?

[ May be I am missing something fundamental in your question. ]

Can't you just access one of your static web pages from another
computer and see what you get? 

das

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Tomcat and static content

Posted by Kapil Sharma <ks...@wishstream.com>.
Can someone answer it please...

kapil

-----Original Message-----
From: Kapil Sharma [mailto:ksharma@wishstream.com] 
Sent: 07 July 2002 00:03
To: 'Tomcat Users List'
Subject: Tomcat and static content


Hi,
I have got a problem. I am using apache 1.3.26+tomcat 1.3.1. Is there
any way to know that apache is serving all static content like
.html/.gif/.jpeg? My virtual host (in apache) is running very slow and
images are breaking..

Please help?

Cheers
kapil



--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>