LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   Tomcat Status 404 issue (http://www.linuxquestions.org/questions/linux-software-2/tomcat-status-404-issue-437331/)

FirmbIT 04-21-2006 12:33 AM

Tomcat Status 404 issue
 
Hello, I have just installed Tomcat on a server inside of /usr/share/tomcat5 and I have also installed the mod_jk module for Apache to connect to Tomcat to serve .jsp pages and servlets. The problem is, I am getting a status 404 on all pages I'm trying to serv on both the Tomcat 8080 port and Apache 80 port. I can't seem to figure out what It is I missed. Has anyone had this issue and know of a fix? Examples:

http://www.aprva.com/golgotha/ (servlet)
http://www.aprva.com:8080/golgotha/ (servlet)

http://www.aprva.com/test.jsp (simple jsp test page)
http://www.aprva.com:8080/test.jsp (simple jsp test page)

Thank you.

Oh, also if needed here is my httpd.conf and my workers.properties files:

httpd.conf -

Code:

LoadModule jk_module modules/mod_jk.so
JkWorkersFile /etc/httpd/conf/workers.properties

JkLogFile /var/log/httpd/mod_jk.log

JkLogLevel debug

JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "

JkMount /*.jsp ajp13
JkMount /servlet/* ajp13
JkMount /otherworker/*.jsp ajp13
JkMount /jsp-eg/*.jsp ajp13
JkMount /jsp-eg/*.html ajp13
JkMount /servlets-eg/*.html ajp13

JkMount /*.jsp testWorker
JkMount /servlet/* testWorker
JkMount /otherworker/*.jsp testWorker
JkMount /jsp-eg/*.jsp testWorker
JkMount /jsp-eg/*.html testWorker
JkMount /servlets-eg/*.html testWorker

workers.properties -

Code:

workers.tomcat_home=/usr/share/tomcat5/
workers.java_home=/usr/lib/jvm/java
ps=/
worker.list=ajp13 testWorker
worker.ajp13.port=8009
worker.ajp13.host=localhost
worker.ajp13.type=ajp13
worker.ajp13.lbfactor=1
worker.testWorker.port=8009
worker.testWorker.host=localhost
worker.testWorker.type=ajp13
worker.testWorker.lbfactor=1


FirmbIT 04-21-2006 08:42 AM

Does anybody have any suggestions please?

tomdkat 04-21-2006 09:49 AM

Quote:

Originally Posted by FirmbIT
Does anybody have any suggestions please?

One suggestion is to be patient. :)

It's been a while since I setup mod_jk or Tomcat so I'll need to go back and see what I did way back when. :)

In the meantime, search the Tomcat mailing list for "404" and see if your question is answered there.

I'll post what I find out here later on today. If you get an answer, please post it here to assist the community. :)

Peace...

FirmbIT 04-21-2006 10:32 AM

Ok, thanks I'll be waiting. I did search the Tomcat mailing list and was able to find someone who asked the same question but with no answer. Thanks

tomdkat 04-21-2006 01:21 PM

Ok, it looks like your worker.properties and httpd.conf files are clean, with a small exception being the "worker.list" parameter in worker.properties. According to the mod_jk2 doc, "worker.list" is a comma delimited list and yours is space delimited. I haven't found a mod_jk document to confirm this so I can't confirm if the comma delimiter applies to mod_jk as well.

More importantly, the 404 messages are coming from Tomcat, which is good since it means you're reaching it ok. :)

I'm thinking you don't have the Context for your web app setup correctly. If you can, post your server.xml file or make sure your Context contains the correct docBase.

I'm surprised that wasn't mentioned in the Tomcat mailing list.

Peace...

FirmbIT 04-21-2006 03:46 PM

Thanks for the response, it is appreciated. I have fixed the workers.properties file and restarted services accordingly but still the same error message. Here is my server.xml file as requested (it's big): http://aprva.com/server.xml

tomdkat 04-21-2006 04:40 PM

Thanks. Is your test.jsp file located in $(CATALINAHOME)/webapps? Can you put a test.jsp in $(CATALINAHOME/examples and see if http://www.aprva.com/examples/test.jsp works?

Peace...

FirmbIT 04-21-2006 05:50 PM

I just moved them into there and am now getting an internal server error:

http://www.aprva.com/webapps/test.jsp
http://www.aprva.com/examples/test.jsp
http://www.aprva.com/test.jsp

But not when I am on port 8080. I get the original error message on that port.

tomdkat 04-21-2006 07:24 PM

Ok, in $(CATALINAHOME)/examples, what do you see there other than test.jsp?

Peace...

FirmbIT 04-21-2006 07:32 PM

$(CATALINAHOME)/examples did not exist, I had to create it. Only test.jsp is in there...

tomdkat 04-21-2006 07:36 PM

EXCELLENT!!!! :D Ok, run this command:

$ find / -name numguess.jsp

I'm able to run that JSP example just fine, so if we find out where it's located on your machine, we can find out the path discrepancy and get your Context defined correctly.

Peace...

tomdkat 04-21-2006 07:46 PM

Ok, I just downloaded a Tomcat 4.1 tarball and uncompressed it. :)

Put your test JSP file in:

$(CATALINAHOME)/webapps/examples

Then we'll see if it runs.

Peace...

FirmbIT 04-21-2006 08:05 PM

Here is where numguess.jsp is:

/usr/share/tomcat5/webapps/examples/jsp/num/numguess.jsp

I moved test.jsp into /usr/share/tomcat5/webapps/examples and it is not working:

http://www.aprva.com/webapps/examples/test.jsp

I did restart services. /usr/share/tomcat5 is $(CATALINAHOME) by the way..

tomdkat 04-21-2006 08:42 PM

Quote:

Originally Posted by FirmbIT
Here is where numguess.jsp is:

/usr/share/tomcat5/webapps/examples/jsp/num/numguess.jsp

I moved test.jsp into /usr/share/tomcat5/webapps/examples and it is not working:

http://www.aprva.com/webapps/examples/test.jsp

I did restart services. /usr/share/tomcat5 is $(CATALINAHOME) by the way..

But we're making progress:

http://www.aprva.com:8080/examples/test.jsp

Check *that* out. :)

So, your test JSP app runs in Tomcat standalone.

Wait a minute, /usr/share/tomcat5? Tomcat is reporting itself as Tomcat 4.1. You should confirm you're running the version of Tomcat you need to be running.

Also, I believe mod_jk2 should be used with Tomcat 5.

Anywho, look in /var/log/httpd/mod_jk.log and in the Apache error log for messages that correspond to the "500 Internal Server Error" message that gets generated when using Apache as the front-end to Tomcat.

Have you restarted Apache during all this?

Peace...

FirmbIT 04-21-2006 08:53 PM

Nice! My servlet now also works on :8080

http://www.aprva.com:8080/golgotha/

Yes I have restarted apache. Ok, here is the error message I get when running

http://www.aprva.com/golgotha/

in the mod_jk.log:

Code:

[Fri Apr 21 21:52:38 2006] [31419:16384] [debug] map_uri_to_worker::jk_uri_worker_map.c (449): Attempting to map URI '/golgotha/' from 7 maps
[Fri Apr 21 21:52:38 2006] [31419:16384] [debug] map_uri_to_worker::jk_uri_worker_map.c (461): Attempting to map context URI '/servlets-eg/*.html'
[Fri Apr 21 21:52:38 2006] [31419:16384] [debug] map_uri_to_worker::jk_uri_worker_map.c (461): Attempting to map context URI '/otherworker/*.jsp'
[Fri Apr 21 21:52:38 2006] [31419:16384] [debug] map_uri_to_worker::jk_uri_worker_map.c (461): Attempting to map context URI '/jsp-eg/*.html'
[Fri Apr 21 21:52:38 2006] [31419:16384] [debug] map_uri_to_worker::jk_uri_worker_map.c (461): Attempting to map context URI '/jsp-eg/*.jsp'
[Fri Apr 21 21:52:38 2006] [31419:16384] [debug] map_uri_to_worker::jk_uri_worker_map.c (461): Attempting to map context URI '/servlet/*'
[Fri Apr 21 21:52:38 2006] [31419:16384] [debug] map_uri_to_worker::jk_uri_worker_map.c (461): Attempting to map context URI '/golgotha/'
[Fri Apr 21 21:52:38 2006] [31419:16384] [debug] map_uri_to_worker::jk_uri_worker_map.c (486): Found an exact match testWorker -> /golgotha/
[Fri Apr 21 21:52:38 2006] [31419:16384] [debug] jk_handler::mod_jk.c (1825): Into handler jakarta-servlet worker=testWorker r->proxyreq=0
[Fri Apr 21 21:52:38 2006] [31419:16384] [debug] wc_get_worker_for_name::jk_worker.c (111): did not find a worker testWorker
[Fri Apr 21 21:52:38 2006] [31419:16384] [info]  jk_handler::mod_jk.c (1979): Could not find a worker for worker name=testWorker

Hmm, but the .jsp pages don't seem to be working: http://www.aprva.com:8080/golgotha/j...carsSearch.jsp

Tomcat is a pain..


All times are GMT -5. The time now is 03:48 AM.