tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Schreider, Gernot" <gernot.schrei...@sap.com>
Subject Howto get Tomcat with Apache running on NT
Date Mon, 14 Aug 2000 12:58:18 GMT
This are my experiences how to get Tomcat 3.1 with Apache 1.3.12 on a NT
machine running.
I do hope that some people may benefit from this. I had some hard time to
get everything working.
I assume that Apache is already installed and running. 
I will not describe anything about compiling Tomcat since I haven't done
this.
I'll give you my config parameters according to my own installation. Adjust
these to your situation.
I hope some people may find this helpful, I always found working examples
very helpful.
Good luck !

Gernot Schreider

gernot.schreider@sap.com




>>>>>>>>>>
OS: NT 4.0 SP 5

###########
#Installing JAVA 
###########
get JDK1.3 from SUN http://java.sun.com/j2se/1.3/download-windows.html
install in c:\jdk1.3
set environment variable JAVA_HOME=c:\jdk1.3
add to your PATH variable  c:\jdk1.3\bin

#############
#Installing TOMCAT
#############
get tomcat 3.1 binaries from
http://jakarta.apache.org/builds/tomcat/release/v3.1/bin/
unzip in c:\jakarta-tomcat
set environment variable TOMCAT_HOME=C:\jakarta-tomcat
set environment variable
CLASSPATH=C:\jdk1.3\lib\tools.jar;c:\jdk1.3\jre\lib\rt.jar;c:\jdk1.3\jre\lib
\dt.jar;c:\jdk1.3\src.jar;C:\jakarta-tomcat\lib\webserver.jar;c:\jakarta-tom
cat\classes;C:\jakarta-tomcat\lib\jasper.jar;c:\jakarta-tomcat\lib\xml.jar;c
:\jakarta-tomcat\lib\servlet.jar

########################
# Install Apache Tomcat connection
########################
## install Apache JServlet module adapted to TOMCAT note : you do need this
version and not the dll from jsdk2.0 !
get ApacheModuleJServ.dll from
http://jakarta.apache.org/builds/tomcat/release/v3.1/bin/win32/i386/
copy to c:\jakarta-tomcat\bin
##configure tomcat.conf
#####
edit LoadModule directive

#tell Apache on win32 to load the Apache JServ communication module
LoadModule jserv_module c:\jakarta-tomcat\bin\ApacheModuleJServ.dll

comment out UNIX version

#LoadModule jserv_module libexec/mod_jserv.so

no editing of tomcat.properties needed
edit file server.xml 
<! --disable Tomcat as http server on port 8080 by commenting the next part
out
  Since we use Tomcat with Apache it is not needed that Tomcat serves on
Port 8080 as webserver
-->
<!--
<Connector className="org.apache.tomcat.service.SimpleTcpConnector">
            <Parameter name="handler"
value="org.apache.tomcat.service.http.HttpConnectionHandler"/>
            <Parameter name="port" value="8080"/>
        </Connector>
-->

set proper context path for examples
<Context path="/examples" docBase="c:\jakarta-tomcat\webapps\examples"
debug="0" reloadable="true" > 
</Context>

##################
## testing your installation
##################
In order to be able to serve jsp you need to have Apache and Tomcat running.
You can start Tomcat by opening a Command Prompt Window and invoke the
startup.bat in the tomcat/bin directory. Tomcat is now running and waiting
to serve requests.
You can stop Tomcat by invoking the shutdown.bat file.

I had an error when stopping Tomcat which was due to some classpath problem.
I could fix it with the classpath used as above described. If you get an
error when stopping tomcat like

Stop tomcat
XmlMapper: Debug level: 2
XmlMapper: new className org.apache.tomcat.service.SimpleTcpConnector
Connector org.apache.tomcat.service.SimpleTcpConnector@648e1b
XmlMapper: org.apache.tomcat.service.SimpleTcpConnector.setProperty(
handler, org.apache.tomcat.service.http.HttpConnectionHandler)
XmlMapper: org.apache.tomcat.service.SimpleTcpConnector.setProperty( port,
8008)
XmlMapper: Calling
org.apache.tomcat.service.SimpleTcpConnector.setContextManager
org.apache.tomcat.core.ContextManager
XmlMapper: Calling org.apache.tomcat.core.ContextManager.addServerConnector
org.apache.tomcat.service.SimpleTcpConnector@648e1b
XmlMapper: pop Connector org.apache.tomcat.service.SimpleTcpConnector:
org.apache.tomcat.service.SimpleTcpConnector@648e1b
XmlMapper: new className org.apache.tomcat.service.SimpleTcpConnector
Connector org.apache.tomcat.service.SimpleTcpConnector@7c4bec
XmlMapper: org.apache.tomcat.service.SimpleTcpConnector.setProperty(
handler, org.apache.tomcat.service.connector.Ajp12ConnectionHandler)
XmlMapper: org.apache.tomcat.service.SimpleTcpConnector.setProperty( inet,
155.56.16.4)
XmlMapper: org.apache.tomcat.service.SimpleTcpConnector.setProperty( port,
8007)
XmlMapper: Calling
org.apache.tomcat.service.SimpleTcpConnector.setContextManager
org.apache.tomcat.core.ContextManager
XmlMapper: Calling org.apache.tomcat.core.ContextManager.addServerConnector
org.apache.tomcat.service.SimpleTcpConnector@7c4bec
XmlMapper: pop Connector org.apache.tomcat.service.SimpleTcpConnector:
org.apache.tomcat.service.SimpleTcpConnector@7c4bec
java.net.ConnectException: Connection refused: no further information
	at java,net.PlainSocketImpl.socketConnect<Native Method>
	at java,net.PlainSocketImpl.doConnect<Unknown Source>
	at java,net.PlainSocketImpl.connectToAddress<Unknown Source>
	at java,net.PlainSocketImpl.connect<Unknown Source>
	at java,net.Socket.<init><Unknown Source>
	at java,net.Socket.<init><Unknown Source>
	at org.apache.tomcat.startup.Tomcat.stopTomcat<Tomcat.java:208>
	at org.apache.tomcat.startup.Tomcat.execute<Tomcat.java:130>
	at org.apache.tomcat.startup.Tomcat.main<Tomcat.java:163>

I am quite sure that this is due to some classpath problems. However no one
from this mailing list really could help me.
Do use a classpath similar as describe above.


Since in tomcat.conf we have configured 

ApJServMount /examples /root

any URL starting with /examples will be handled by Tomcat. So we can test
our jsp examples by invoking 
http://localhost/examples/jsp/index.html and selecting any of the example
.jsp pages.

If you have your Apache server configured such that your webservers real
name is used instead of localhost you have to use
http://<yourserver>/examples/jsp/index.html 

I recommed using localhost though for Tomcat to listen to. By doing so your
webserver (Apache) may handle authority stuff and forwards authenticated
requests to Tomcat locally.


If it is not working try to look in the various log files.

##############
## mod_jserv.log file 
##############
This log file can be found in the Apache log directory. Typically in
c:\apache group\apache\logs.
The Apache module ApacheModuleJServ.dll writes to this file. If Apache
cannot connect Tomcat you will see a message like

[14/08/2000 12:36:20:696] (EMERGENCY) ajp12: can not connect to host
127.0.0.1:8007
[14/08/2000 12:36:20:696] (EMERGENCY) ajp12: connection fail
[14/08/2000 12:36:20:696] (ERROR) an error returned handling request via
protocol "ajpv12"

This means Tomcat is not running or cannot be reached on port 8007. 

#########
## jserv.log
#########
This is the log file for the Java portion of ApacheModuleJServ. 
Configuration for this is in tomcat.properties file.


#########################
## jasper.log, tomcat.log servlet.log
#########################

Tomcat writes to this log files, once you see entries in these files Tomcat
is running.
Configuration for these log files is in server.xml. Default location is in
directory TOMCAT_HOME/logs.








Mime
View raw message