LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Suse 9.1 - Can't get Tomcat work (https://www.linuxquestions.org/questions/linux-software-2/suse-9-1-cant-get-tomcat-work-227627/)

aSimpleTux 09-07-2004 05:21 AM

Suse 9.1 - Can't get Tomcat work
 
Hi Everybody!
I have a problem with Tomcat and Suse 9.1. I'm searching since 2 days in the web but can't find an answer. Hope somebody can help me here!

I installed with yast2 apache, php, tomcat (with connector) and all the stuff for a webserver. PHP is working fine, but i can't get jsp work with my apache.
I startet tomcat after installation with rctomcat start and "netstat -tpan | grep 80" says that it is running. But when i want to run a jsp file in htdocs (localhost) it is shown as a simple text file without compiling it! I don't know if htdocs is the right directory for jsp but i think it should.
I also tried port 8080 (firewall is configured) but nothing...
Does someone know what to do? Is htdocs the right place?
Would be very happy for any help!!!

jandersen78 09-27-2004 11:11 PM

It sounds like the JK connector isn't configured correctly. If you have the jsps in your htdocs directory and apache isn't configured to send those requests to tomcat (through the jk connector) you'll see that unparsed jsp code. Tomcat, even on port 8080 probably won't see this file because it's root directory by default isn't htdocs but rather its own webapps directory.

I haven't worked with SUSE but I just set up Apache, JK, and tomcat on a debian box with Apache1.3 (having done this previously on fedora with Apache 2) and there was a fair bit more to do beyond simply downloading the required packages.

Here's basically what I had left to do :

* create a conf file that is included in httpd.conf with these contents (adapted to your install):

Load mod_jk module
LoadModule jk_module /usr/lib/apache/1.3/mod_jk.so
# Declare the module for <IfModule directive>
AddModule mod_jk.c
# Where to find workers.properties
JkWorkersFile /etc/libapache-mod-jk/workers.properties
# Where to put jk logs
JkLogFile /var/log/apache/mod_jk.log
# Set the jk log level [debug/error/info]
JkLogLevel info
# Select the log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
# JkOptions indicate to send SSL KEY SIZE,
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
# JkRequestLogFormat set the request format
JkRequestLogFormat "%w %V %T"
# Send servlet for context /examples to worker named worker1
JkMount /examples/servlet/* local
# Send JSPs for context /examples to worker named worker1
JkMount /examples/*.jsp local
# Special directive provided by mod_jk that tells Apache to
# forward requests (maybe only JSP requests, I'm not sure) in
# these directories to Tomcat.ajp13 is the protocol used to
# talk to Tomcat.
JkMount /struts-examples/* local

* modify the workers.properties referenced above to create a worker called local as in the following:

# Tomcat and Java configuration
#
workers.tomcat_home=/usr/share/tomcat4
workers.java_home=/usr/lib/j2se/1.4
ps=/
worker.list=local
# Definition for local worker using AJP 1.3
#
worker.local.type=ajp13
worker.local.host=localhost
worker.local.port=8009

* check /etc/tomcat4/server.xml and make sure the ajp13 connector is uncommented
* run apachectl configtest and make sure it looks ok
* restart tomcat first so apache will be able to bind to the process: /etc/init.d/tomcat4 restart
* restart apache: apachectl restart


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