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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
|
04-21-2006, 12:33 AM
|
#1
|
LQ Newbie
Registered: Oct 2005
Posts: 27
Rep:
|
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.
|
|
|
04-21-2006, 08:42 AM
|
#2
|
LQ Newbie
Registered: Oct 2005
Posts: 27
Original Poster
Rep:
|
Does anybody have any suggestions please?
|
|
|
04-21-2006, 09:49 AM
|
#3
|
Member
Registered: May 2003
Location: S.F. Bay Area
Distribution: Ubuntu 9.04 AMD64
Posts: 595
Rep:
|
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...
|
|
|
04-21-2006, 10:32 AM
|
#4
|
LQ Newbie
Registered: Oct 2005
Posts: 27
Original Poster
Rep:
|
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
|
|
|
04-21-2006, 01:21 PM
|
#5
|
Member
Registered: May 2003
Location: S.F. Bay Area
Distribution: Ubuntu 9.04 AMD64
Posts: 595
Rep:
|
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...
|
|
|
04-21-2006, 03:46 PM
|
#6
|
LQ Newbie
Registered: Oct 2005
Posts: 27
Original Poster
Rep:
|
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
|
|
|
04-21-2006, 04:40 PM
|
#7
|
Member
Registered: May 2003
Location: S.F. Bay Area
Distribution: Ubuntu 9.04 AMD64
Posts: 595
Rep:
|
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...
|
|
|
04-21-2006, 07:24 PM
|
#9
|
Member
Registered: May 2003
Location: S.F. Bay Area
Distribution: Ubuntu 9.04 AMD64
Posts: 595
Rep:
|
Ok, in $(CATALINAHOME)/examples, what do you see there other than test.jsp?
Peace...
|
|
|
04-21-2006, 07:32 PM
|
#10
|
LQ Newbie
Registered: Oct 2005
Posts: 27
Original Poster
Rep:
|
$(CATALINAHOME)/examples did not exist, I had to create it. Only test.jsp is in there...
|
|
|
04-21-2006, 07:36 PM
|
#11
|
Member
Registered: May 2003
Location: S.F. Bay Area
Distribution: Ubuntu 9.04 AMD64
Posts: 595
Rep:
|
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...
|
|
|
04-21-2006, 07:46 PM
|
#12
|
Member
Registered: May 2003
Location: S.F. Bay Area
Distribution: Ubuntu 9.04 AMD64
Posts: 595
Rep:
|
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...
|
|
|
04-21-2006, 08:05 PM
|
#13
|
LQ Newbie
Registered: Oct 2005
Posts: 27
Original Poster
Rep:
|
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..
|
|
|
04-21-2006, 08:42 PM
|
#14
|
Member
Registered: May 2003
Location: S.F. Bay Area
Distribution: Ubuntu 9.04 AMD64
Posts: 595
Rep:
|
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...
|
|
|
04-21-2006, 08:53 PM
|
#15
|
LQ Newbie
Registered: Oct 2005
Posts: 27
Original Poster
Rep:
|
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.
|
|
|
All times are GMT -5. The time now is 02:01 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|