wood burning stoves 2.0*
The moose likes Tomcat and the fly likes Apache Not able to get html files & GIF files placed in the Tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Apache Not able to get html files & GIF files placed in the Tomcat" Watch "Apache Not able to get html files & GIF files placed in the Tomcat" New topic
Author

Apache Not able to get html files & GIF files placed in the Tomcat

madhu gun
Greenhorn

Joined: Nov 21, 2001
Posts: 25
Hi,
I have connected Apache 1.3.22 with Tomcat4.0. Apache is configured to listen
at port 80 and Tomcat at 8080(the HttpConnector is working fine both for static
and dynamic ,when Tomcat used as standalone) and port 8008(WarpConnector). and I am able to
get a page from a servlet of Tomcat, hopefully through Apache( i.e. when I call
http://localhost/examples/HelloWorldExample or http://localhost:80/examples/HelloWorldExample.
I get html response written by the servlet in Tomcat).But, the gifs in the Tomcat associated
with the above response are NOT displayed.In a nutshell , Apache is able to fetch servlet response from Tomcat
but NOT any .gif files from Tomcat.But the same works(gifs displayed) fine when I
use http://localhost:8080/examples/HelloWorldExample(Tomact StandAlone).
Secondly, I am Not able to get html files placed in the Tomcat(under web-app directory).
Pl.tell me ,what to do??
Thirdly, what I want to do is Make Apache serve the static and Tomcat servlets and jsp.
I have configured httpd.conf of Apache w.r.t. tomcat .Tomcat's server.xml
is NOT modified after installing Apache.
Can anybody help,
with regards
madhu
Bill Ciano
Greenhorn

Joined: Dec 17, 2001
Posts: 2
What OS are you running this in? I'm presently having a similar problem running under NT server...
madhu gun
Greenhorn

Joined: Nov 21, 2001
Posts: 25
Ciano,
I am using WindowsNT4.0 (SP4).So what to do?
regards
madhu
Ashik Uzzaman
Ranch Hand

Joined: Jul 05, 2001
Posts: 2370

Hi madhu, try to store ur images in examples/images directory of and access them by <img src = "/examples/images/somepic.gif"> by ur HTML pages or servlets.
------------------
Muhammad Ashikuzzaman (Fahim)
Sun Certified Programmer for the Java� 2 Platform
--When you learn something, learn it by heart!


Ashik Uzzaman
Senior Member of Technical Staff, Salesforce.com, San Francisco, CA, USA.
madhu gun
Greenhorn

Joined: Nov 21, 2001
Posts: 25
hi Ashik
The present settings as such are like that only.I verified and
got confirmed.Anything more I can do?
with regards
madhu
Ashik Uzzaman
Ranch Hand

Joined: Jul 05, 2001
Posts: 2370

Madhu, i access my servlet thru /examples/servlet/ServletName but u access only thru /examples/ServletName in Tomcat 4,0,1. So u r using webapps/examples/classess directory to store servlets while i m using webapps/examples/web-inf/classes as i frequently change servlets. So u can try my style first to test the servlers and images for temporary testing/storing....

------------------
Muhammad Ashikuzzaman (Fahim)
Sun Certified Programmer for the Java� 2 Platform
--When you learn something, learn it by heart!
[This message has been edited by Ashik uzzaman (edited December 20, 2001).]
madhu gun
Greenhorn

Joined: Nov 21, 2001
Posts: 25
Ashik,
Can u please confirm what u are saying!Becoz,I access my servlets thru /examples/ServletName only, while I am using webapps/examples/web-inf/classes directory only, to store servlets, NOT
webapps/examples/classes .I dont think/know that we can store servlets under webapps/examples/classes. (I am using Tomcat4.0.).I have the following lines in Apache server's httpd.conf file at the end.
LoadModule webapp_module modules/mod_webapp.so
AddModule mod_webapp.c
WebAppConnection warpConnection warp localhost:8008
#DocumentRoot /wsf
<VirtualHost localhost>
#DocumentRoot webapps/examples
ServerName localhost
#WebAppDeploy takes three arguments, <name> <connection> <uri-path>
WebAppDeploy examples warpConnection /examples
WebAppInfo /webapp-info
</VirtualHost>
#include C:/Program Files/Apache Tomcat 4.0/conf/tomcat.conf
#put path in double quotes.But Apache here works with only conf files.Not xml.
#include "C:/Program Files/Apache Tomcat 4.0/conf/server.xml"
with regards
madhu
[This message has been edited by madhu gun (edited December 20, 2001).]
[This message has been edited by madhu gun (edited December 20, 2001).]
[This message has been edited by madhu gun (edited December 21, 2001).]
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16305
    
  21

Actually, you really shouldn't even be TRYING to get Tomcat to serve the GIFs! Unless you expect people to access TOmcat directly as well as via Apache, it's more efficient AND simpler to have Apache serve them!
It's not a bad idea to put all the images in an apache-addressable directory and use the Apache Alias directory to reach them.
Remember, nobody ever said every item on a web page has to come from the same server (or even the same domain!). If it were otherwise, Akamai and DoubleClick would have gone out of business.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Apache Not able to get html files & GIF files placed in the Tomcat