LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-21-2006, 12:33 AM   #1
FirmbIT
LQ Newbie
 
Registered: Oct 2005
Posts: 27

Rep: Reputation: 15
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

Last edited by FirmbIT; 04-21-2006 at 12:34 AM.
 
Old 04-21-2006, 08:42 AM   #2
FirmbIT
LQ Newbie
 
Registered: Oct 2005
Posts: 27

Original Poster
Rep: Reputation: 15
Does anybody have any suggestions please?
 
Old 04-21-2006, 09:49 AM   #3
tomdkat
Member
 
Registered: May 2003
Location: S.F. Bay Area
Distribution: Ubuntu 9.04 AMD64
Posts: 595

Rep: Reputation: 30
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...
 
Old 04-21-2006, 10:32 AM   #4
FirmbIT
LQ Newbie
 
Registered: Oct 2005
Posts: 27

Original Poster
Rep: Reputation: 15
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
 
Old 04-21-2006, 01:21 PM   #5
tomdkat
Member
 
Registered: May 2003
Location: S.F. Bay Area
Distribution: Ubuntu 9.04 AMD64
Posts: 595

Rep: Reputation: 30
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...
 
Old 04-21-2006, 03:46 PM   #6
FirmbIT
LQ Newbie
 
Registered: Oct 2005
Posts: 27

Original Poster
Rep: Reputation: 15
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
 
Old 04-21-2006, 04:40 PM   #7
tomdkat
Member
 
Registered: May 2003
Location: S.F. Bay Area
Distribution: Ubuntu 9.04 AMD64
Posts: 595

Rep: Reputation: 30
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...
 
Old 04-21-2006, 05:50 PM   #8
FirmbIT
LQ Newbie
 
Registered: Oct 2005
Posts: 27

Original Poster
Rep: Reputation: 15
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.
 
Old 04-21-2006, 07:24 PM   #9
tomdkat
Member
 
Registered: May 2003
Location: S.F. Bay Area
Distribution: Ubuntu 9.04 AMD64
Posts: 595

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

Peace...
 
Old 04-21-2006, 07:32 PM   #10
FirmbIT
LQ Newbie
 
Registered: Oct 2005
Posts: 27

Original Poster
Rep: Reputation: 15
$(CATALINAHOME)/examples did not exist, I had to create it. Only test.jsp is in there...
 
Old 04-21-2006, 07:36 PM   #11
tomdkat
Member
 
Registered: May 2003
Location: S.F. Bay Area
Distribution: Ubuntu 9.04 AMD64
Posts: 595

Rep: Reputation: 30
EXCELLENT!!!! 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...
 
Old 04-21-2006, 07:46 PM   #12
tomdkat
Member
 
Registered: May 2003
Location: S.F. Bay Area
Distribution: Ubuntu 9.04 AMD64
Posts: 595

Rep: Reputation: 30
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...
 
Old 04-21-2006, 08:05 PM   #13
FirmbIT
LQ Newbie
 
Registered: Oct 2005
Posts: 27

Original Poster
Rep: Reputation: 15
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..
 
Old 04-21-2006, 08:42 PM   #14
tomdkat
Member
 
Registered: May 2003
Location: S.F. Bay Area
Distribution: Ubuntu 9.04 AMD64
Posts: 595

Rep: Reputation: 30
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...
 
Old 04-21-2006, 08:53 PM   #15
FirmbIT
LQ Newbie
 
Registered: Oct 2005
Posts: 27

Original Poster
Rep: Reputation: 15
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..

Last edited by FirmbIT; 04-21-2006 at 08:54 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
tomcat jsp examples 404 treycarroll Linux - Software 1 04-21-2006 07:57 PM
Tomcat Issue varunbihani Linux - General 0 12-06-2004 05:35 AM
Current status of True Type fonts issue ronaldv General 4 10-12-2004 04:35 AM
TOMCAT init script not working on startup -- tomcat 4.x / Mandrake Linux 8.0 jmartinph Mandriva 0 03-08-2004 01:31 AM
PHP & Apache2 issue status? theetderks Linux - General 2 01-25-2004 05:34 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:41 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration