You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Martin Bouman <M....@telecats.nl> on 2000/12/04 12:40:10 UTC

HOW TO: Install Apache 1.3.14, Tomcat 3.2 and Cocoon 1.8 on Windo ws NT

Hello everyone!	
A while ago I posted that I had managed to run Apache 1.3.14, Tomcat 3.2 and
Cocoon 1.8 on Windows NT.
I got some questions about this, so I decided to describe my installation
methods:
N.B: The information below is also attached in a Word 97 file (Install.doc),
because this might be difficult to read!
Apache Webserver 1.3.14
http://www.apache.org

1.	Start the installatieprogram and follow the instructions.
2.	Open in an editor the file 'httpd.conf' in de %APACHE%\conf
directory en make the following adjustments:

*	Add at ServerAdmin the emailaddrres of the webmaster
*	You may add at ServerName your existing DNS  (uncomment the line).

1.	The installation of Apache is now ready. Start your webserver
through Start --> Programs --> Apache Web Server --> Start Apache (to stop
choose Stop Apache). You can test the webserver by typing in in a browser
the following location: http://localhost . If everything went okay, you'll
see the standard openingscreen from Apache.
2.	If you'd like to run Apache on Windows NT/2000 as a service, follow
these steps: Choose Start --> Programs --> Apache Web Server --> Install
Apache as a service.

Tomcat 3.2 met Apache Webserver 1.3.14
http://jakarta.apache.org

1.	Unzip the Tomcat file (use the subdirs in the file) to your disk and
rename the directory 'jakarta-tomcat' to 'tomcat'.
2.	Make the following system variables in the NT Environment:
		TOMCAT_HOME = %TOMCAT%
		JAVA_HOME = %JDK%
3.	Follow the substeps below:
*	Download at Tomcat 3.2 final the file 'mod_jk.dll' (the zip-file
with Netscape!) and put it in %APACHE%\modules.
*	Open in %APACHE%\conf 'httpd.conf' and remove all lines with
'ApJServMount' and add at the end of the file: Include
"%TOMCAT%/conf/mod_jk.config" (this file does not exist yet! You'll have to
use '/' and NOT '\'!)
*	If you have ever installed Tomcat 3.1 with ApacheModuleJServ.dll,
you'll have to remove that line from 'httpd.conf' (the 'Include' line).
*	If you have ever installed Tomcat 3.1 with Apache JServ, you'll have
to remove this line from 'httpd.conf': Include
"%ApacheJServ%\conf\jserv.conf"
*	You can configure Tomcat to use the (quick) Ajpv13 protocol by
opening in %TOMCAT%\conf 'server.xml' and add the following lines BENEATH
the same kind of lines for Ajp12:
			<Connector
className="org.apache.tomcat.service.PoolTcpConnector">
				<Parameter name="handler"
value="org.apache.tomcat.service.connector.Ajp13ConnectionHandler"/>
	  			<Parameter name="port" value="8009"/>
			</Connector>
*	Open via %TOMCAT%\conf  'workers.properties' and change the similar
lines into:
			workers.tomcat_home=%TOMCAT%
			workers.java_home=%JDK%
			ps=\ (Windows = \, Unix = /)
*	Start Tomcat by typing in a DOS-prompt at %TOMCAT\bin: 'startup'
AFTER having shutdown Apache. If everything went right, you'll get no
errors. Type 'shutdown' in the same prompt and close it afterwards.
*	Rename in %TOMCAT%\conf the file 'mod_jk.conf-auto' to
'mod_jk.config', open it and change the following similar lines only if you
have followed substep 5:
			JkMount /*.jsp ajp13
			JkMount /servlet/* ajp13
			JkMount /examples/servlet/* ajp13
			JkMount /examples/*.jsp ajp13
			JkMount /admin/servlet/* ajp13
			JkMount /admin/*.jsp ajp13
			JkMount /test/servlet/* ajp13
			JkMount /test/*.jsp ajp13
	To use the quick protocol...
*	Add to the same file at 'Root context mounts for Tomcat':
			JkMount /*.xml ajp13
	N.B.: Use 'ajp12' if you have not followed substep 5!
	This is to avoid the typing of the portnumber (8080)
(http://localhost/.... instead of  http://localhost:8080/....).
*	Extra (?!): Open the file 'uriworkermap.properties' via
%TOMCAT%\conf and change 'ajp12' in 'ajp13' at the uncommented lines.
1.	Follow this step to configure Tomcat as a service:
*	Open in %TOMCAT%\conf 'wrapper.properties' and change the following
similar lines:
			wrapper.tomcat_home=%TOMCAT%
			wrapper.java_home=%JAVA%
*	Download at Tomcat 3.2 final the file 'jk_nt_service.exe' and copy
it to %TOMCAT%\conf.
*	Open a DOS-prompt and go to %TOMCAT%\conf and start the following
command:
			jk_nt_service -I Tomcat wrapper.properties
	(You can remove the service by executing: jk_nt_service -R Tomcat)
	If everything went okay Tomcat is now listed at the NT Services.
*	There is however a small complication when running both services
(Apache en Tomcat) in 'Automatic' mode (I think...). Tomcat has to be
started before Apache. You can solve this in the following way by making
Apache depend on Tomcat:
			WATCH OUT!: You'll be making adjustments in the
register. Follow the instructions carefully!
			Choose Start => Run and type in 'regedit'. Go to
HKEY_LOCAL_MACHINE => SYSTEM => CurrentControlSet => Services.
			Find the webserver service (Apache) and select it.
			Click on Edit (menu) => (Add Value / New => String
Value).
			Enter as the name 'DependOnService'.
			Select this new name, click the right mousebutton
and choose Modify.
			Enter at Value Data the name of the Tomcat service
('Tomcat').
			Close the program and restart your PC.
*	To test if everything went okay you can open the NT Services and see
if  both services  have been started.
		Check 1: Stop the service of Tomcat. You'll be warned that
Apache will also be stopped.
		Check 2: Start the service of Apache. The Tomcat service has
been started as well.
		Open a browser and test Tomcat: http://localhost:8080/.

Cocoon 1.8 met Tomcat 3.2
http://xml.apache.org

1.	Unzip the file to your disk (use the subdirs in the file!).
2.	Copy all .jar files from %COCOON%\lib to %TOMCAT%\lib.
3.	Copy 'cocoon.jar' from %COCOON%\bin to %TOMCAT%\lib.
4.	Open 'server.xml' via %TOMCAT%\conf and add the following lines to
the context part (beneath the context part 'examples'):
				<Context path="/cocoon" 
					docBase="webapps/cocoon" 
					debug="0" 
					reloadable="true" >
				 </Context>
5.	Open via %TOMCAT%\conf the file 'mod_jk.config' and add the
following at the end of the file (you might make some adjustments (c:/)):
	
#######################################################
				# Manual configuration for the /cocoon
context starts.
	
#######################################################

				#
				# The following line makes apache aware of
the location of the /cocoon context
				#
				Alias /cocoon $TOMCAT_HOME/webapps/cocoon
				 <Directory "$TOMCAT_HOME/webapps/cocoon">
				     	Options Indexes FollowSymLinks
				 </Directory>

				#
				# The following line mounts all XML files to
tomcat
				# Vul 'ajp12' in als stap 4 deelstap 5 niet
is uitgevoerd!
				#
				JkMount /*.xml ajp13

				#
				# The following line prohibits users from
directly accessing WEB-INF
				#
				<Location /cocoon/WEB-INF/ >
				     	AllowOverride None
				     	deny from all
				 </Location>

				#
				# Use Directory too. On Windows, Location
doesn't work unless case matches
				#
				<Directory
"C:/tomcat/webapps/cocoon/WEB-INF/">
				    	AllowOverride None
				    	deny from all
				</Directory>

				#
				# The following line prohibits users from
directly accessing META-INF
				#
				<Location /cocoon/WEB-INF/ >
				     	AllowOverride None
				     	deny from all
				 </Location>

				#
				# Use Directory too. On Windows, Location
doesn't work unless case matches
					
				<Directory
"C:/tomcat/webapps/cocoon/WEB-INF/">
				    	AllowOverride None
				    	deny from all
				</Directory>
				 
	
#######################################################
				# Manual configuration for the /cocoon
context ends.
	
#######################################################
6.	Go to %TOMCAT%\webapps and create from there the following subdirs:
				.\cocoon
				.\cocoon\WEB-INF
				.\coccon\servlets
7.	Copy %COCOON%\src\WEB-INF\web.xml and
%COCOON%\conf\cocoon.properties to %TOMCAT%\webapps\cocoon\WEB-INF.
8.	Open the 'web.xml' you just copied and change the similar line:
	
<param-value>WEB-INF/cocoon.properties</param-value>
9.	Copy all subdirs and files from %COCOON%\samples to
%TOMCAT%\webapps\cocoon\servlets.
10.	Problem using Cocoon in a DOS-prompt (startup):
		You'll get an error. This is due to Tomcat and Cocoon using
the same kind of .jar files and those from Cocoon have to be loaded before
the ones from Tomcat. You can check this by typing 'startup' in a DOS-prompt
at %TOMCAT%\bin and looking at the classpath value in the original prompt.
		The jar files from step 2 have to be at front. 
		Is this is not the case than you can solve it like this:
		On Unix (and sometimes on Windows) the classpath is created
alfabetically so you can simply rename 'parser.jar' (%TOMCAT%\lib) to
'z_parser.jar', 'webserver.jar' tot 'z_webserver.jar', etc ('ant.jar',
'jasper.jar', 'jaxp.jar', but NOT 'servlet.jar'!).
		On Windows it may cost some more effort. The classpath is
created by looking at the date of the jar files. Those of Tomcat have to be
'renewed':
		Copy 'parser.jar' (%TOMCAT\lib) to a directory (i.e.
c:\Temp) and execute the following command in a DOS-prompt:
					jar xvf parser.jar
		Remove 'parser.jar', the manifest directory and execute the
following command:
					jar cvf parser.jar *.*
		You now have a 'new' version of 'parser.jar'. Copy
(overwrite) this file to %TOMCAT%\lib and clean up c:\Temp.
		You can do the same for: 'servlet.jar', 'webserver.jar',
'jasper.jar', 'jaxp.jar' and 'ant.jar'.
		Start Tomcat via a DOS-prompt and take another look at the
classpath. All the 'new' jars are standing at the end of the line. (Re)start
Apache.
11.	Problem starting service with Cocoon (if installed as a service):
		You'll get an error. This is due to Tomcat and Cocoon using
the same kind of .jar files and those from Cocoon have to be loaded before
the ones from Tomcat.
		The jar files from step 2 have to be at front and the jar
files from Cocoon must be loaded when starting Tomcat as a service. You can
solve it like this: 
		Stop both services and open 'wrapper.properties' via
%TOMCAT%\conf and add the following lines at  'Defining the classpath' ABOVE
the existing ones (Cocoon 1.8):
	
wrapper.class_path=$(wrapper.tomcat_home)\lib\xerces_1_2.jar
	
wrapper.class_path=$(wrapper.tomcat_home)\lib\xalan_1_2_D02.jar
	
wrapper.class_path=$(wrapper.tomcat_home)\lib\ant_1_1.jar
	
wrapper.class_path=$(wrapper.tomcat_home)\lib\bsf.jar
	
wrapper.class_path=$(wrapper.tomcat_home)\lib\bsfengines.jar
	
wrapper.class_path=$(wrapper.tomcat_home)\lib\fop_0_13_0.jar
	
wrapper.class_path=$(wrapper.tomcat_home)\lib\cocoon.jar
	
wrapper.class_path=$(wrapper.tomcat_home)\lib\servlet_2_2.jar
	
wrapper.class_path=$(wrapper.tomcat_home)\lib\stylebook-1.0-b2.jar
	
wrapper.class_path=$(wrapper.tomcat_home)\lib\turbine-pool.jar	
		N.B: Think about the 'z_' if you've followed step 10!
		(Re)start Tomcat resp. Apache.
12.	Start both services (Tomcat resp. Apache) and test the installation
via:
		http://localhost/cocoon/Cocoon.xml
13.	It is also possible to have cocoon files in a directory right
beneath your 'htdocs' tree from Apache. The following steps describe how to
do this with the directory 'samples':
*	Copy the directory 'samples' from %COCOON% to %APACHE%\htdocs.
*	Copy the directory 'WEB-INF' from %TOMCAT%\webapps\cocoon\ to
%APACHE%\htdocs\samples.
*	Open 'server.xml' via %TOMCAT%\conf and add the following contexts
at the right place (you may want to adjust something):
				<Context path="" 
				                 docBase="D:/Apache/htdocs" 
				                 debug="0" 
				                 reloadable="true"> 
				      </Context>

					<Context path="/samples" 
	
docBase="D:/Apache/htdocs/samples" 
				                 debug="0" 
				                 reloadable="true"> 
				      </Context>
*	Open 'mod_jk.config' via %TOMCAT%\conf and the following at the end
(you might make adjustments):
	
#######################################################
			# Manual configuration for the /samples context
starts.
	
#######################################################

			#
			# The following line makes apache aware of the
location of the /samples context
			#
			Alias /samples d:/Apache/htdocs/samples
			 <Directory "d:/Apache/htdocs/samples">
			     Options Indexes FollowSymLinks
			 </Directory>

			#
			# The following line mounts all JSP files to tomcat
			#
			JkMount /samples/servlet/* ajp13
			JkMount /samples/*.jsp ajp13

			#
			# The following line prohibits users from directly
accessing WEB-INF
			#
			<Location /samples/WEB-INF/ >
			     AllowOverride None
			     deny from all
			 </Location>

			#
			# Use Directory too. On Windows, Location doesn't
work unless case matches
			#
			<Directory "D:/Apache/htdocs/samples/WEB-INF/">
			    AllowOverride None
			    deny from all
			</Directory>

			#
			# The following line prohibits users from directly
accessing META-INF
			#
			<Location /samples/WEB-INF/ >
			     AllowOverride None
			     deny from all
			</Location>

			#
			# Use Directory too. On Windows, Location doesn't
work unless case matches
			#
			<Directory "D:/Apache/htdocs/samples/WEB-INF/">
			    AllowOverride None
			    deny from all
			</Directory>
			 
	
#######################################################
			# Manual configuration for the /samples context
ends.
	
#######################################################
*	Open 'httpd.conf' via %APACHE%\conf and change the following similar
line:
			DirectoryIndex index.html index.xml
It is now possible to invoke http://localhost/samples/ (after having
restarted both services), so 'index.xml' from this directory appears
automatically in contradiction to http://localhost/cocoon/servlets/index.xml
(index.xml MUST be typed!).

I hope this will help out a lot of people. If there are any questions,
remarks, etc., please feel free to mail me at martinb@telecats.nl.

Martin Bouman
 <<Install.doc>> 

Class Not Found in Init exception

Posted by "G.Nagarajan" <gn...@dkf.de>.
Hi,
Can anyone tell me why I get this error message. I am running tomcat with
IIS.

Thanks,
Nagaraj.

Context log: path="/test" Class Not Found in init
 java.lang.ClassNotFoundException: blank.html
	at
org.apache.tomcat.loader.AdaptiveClassLoader.loadClass(AdaptiveClassLoader.j
ava:450)
	at
org.apache.tomcat.loader.AdaptiveServletLoader.loadClass(AdaptiveServletLoad
er.java:141)
	at
org.apache.tomcat.core.ServletWrapper.initServlet(ServletWrapper.java:294)
	at
org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:445)
	at
org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:597)
	at
org.apache.tomcat.servlets.InvokerServlet.service(InvokerServlet.java:257)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at
org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:503)
	at org.apache.tomcat.core.ContextManager.service(ContextManager.java:559)
	at
org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection
(Ajp12ConnectionHandler.java:156)
	at
org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.java:338
)
	at java.lang.Thread.run(Unknown Source)