Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

error on making tomcat and apache work together

 
Jhun Hoon
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic