aspose file tools*
The moose likes Tomcat and the fly likes error on making tomcat and apache work together Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "error on making tomcat and apache work together" Watch "error on making tomcat and apache work together" New topic
Author

error on making tomcat and apache work together

Jhun Hoon
Greenhorn

Joined: Nov 19, 2001
Posts: 28
Hi all, i have a problem here in connecting tomcat and apache. I'm using tomcat 4.0.3 and apache 1.3.9 running on winsxp. I've downloaded the mod_jk.dll from http://jakarta.apache.org/builds/jakarta-tomcat/release/v3.3.1/bin/win32/i386/mod_jk.dll. I've followed thoroughly the tomcat docs about connecting tomcat and apache. The apache seems to work allright, as it prints 'starting mod_jk 1.1' or something when it starts. After that, i create a 'test' directory inside %tomcat_home%\webapps, place a simple index.jsp inside and create a Web-inf\ too. http://myhost/test/index.jsp works perfectly. But the funny thing right now is the webapps\examples shipped with the default tomcat installtion wouldnt start(http://myhost/examples), and when i place index.html inside the webapps\test, i cant open the page too using url http://myhost/test/index.html. What could possibly go wrong here. Please help.
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

what is the error message you get in the browser, or in the DOS window (or the equivalent in XP, please tell me there is one)
Jhun Hoon
Greenhorn

Joined: Nov 19, 2001
Posts: 28
Oh, i forgot to mention the error message
It was 404 page not found error. When i took a look at the apache log file, it's obvious that the apache couldnt find my index.html(that resides at %TOMCAT_HOME%\webapps\test). The error message is something like "file E:\htdocs\test\index.html doesnt exist". I'm sure there's no problem related to the OS, since i've tested running apache-tomcat(j2sdk1.4.0, tomcat4.0.3, apache-wins-1.3.9) too at win98 with the same result. I've taken a look at the tomcat log files, but no errors found.
Any suggestions ?
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

apache is only configured to forward requests to tomcat if they match the pattern *.jsp

So no, it wouldn't find your HTML file under the tomcat directory. It would try to find it under the webroot of Apache.

I think.
Jhun Hoon
Greenhorn

Joined: Nov 19, 2001
Posts: 28
I dont think that apache only matches *.jsp or /servlet/* pattern. I've configured mod_jserv, combining apache-tomcat(3.x), and it works perfectly. The index.html that does not reside in document root of apache(it resides in tomcat's webapps/test) can be found by the apache. And, in my current situation(apache-tomcat-4.x-mod_jk), i cant even run the tomcat's examples, by issuing http://myhost/examples. http://myhost:8080/examples will work, though. Any more suggestions ?
Thanks a lot, Mike.
Jhun Hoon
Greenhorn

Joined: Nov 19, 2001
Posts: 28
My temporary approach is now to JkMount /test/servlet/* if i have a new webapps under a directory called test. I just dont get it. Using mod_jserv and tomcat-3.x, i could make apache to handle html docs that are in the tomcat dir. But now, i cant do it using mod_jk and tomcat-4.0.3.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: error on making tomcat and apache work together