| Assumption |
We assume the IIS 4.0 on the
Windows NT 4.0 SP5 is installed with the following parameters. |
| Web Server
Home Page |
http://netspread.com/ |
| IIS Site
Document Root |
d:\inetpub\wwwroot\netspread\web |
|
|
|
| Install
Java 2 SDK 1.3 |
The Java 2 SDK 1.3.0 or 1.2.2 is
required for Tomcat to serve Java Server Pages. If you do not have
it on your NT servers, go to http://java.sun.com/j2se/1.3/download-windows.html
and download the software and install it on your NT servers. We
assume that you install it on the following directory. |
| Java Install
Home |
c:\jdk1.3 |
| Java HotSpot
Server VM 2.0 |
It is
recommended that you install the Java HotSpot Server VM 2.0 for
better performances. You can download it from http://www.javasoft.com/products/hotspot/2.0/download.html
and install it with the Java 2 SDK 1.3 above. You choose HotSpot
Server as default VM. |
| |
|
| Install
Tomcat 3.1 |
You download Tomcat 3.1 from
http://jakarta.apache.org/builds/tomcat/release/v3.1/bin/jakarta-tomcat.zip
and also need to download the ISAPI redirector dll from
http://jakarta.apache.org/builds/tomcat/release/v3.1/bin/win32/i386/isapi_redirect.dll. You
unpack the jakarta-tomcat.zip into a directory that will hold
<Tomcat Home> and copy the isapi_redirect.dll to <Tomcat
Home>\bin\iis\i386. The <Tomcat Home> and the dll are shown
as follows. |
| Tomcat
Home |
d:\inetpub\wwwroot\netspread\tomcat |
| Redirector
Location |
d:\inetpub\wwwroot\netspread\tomcat\bin\iis\i386\isapi_redirect.dll |
|
|
|
| Setup
Environment Variables |
There are two system environment
variables you have to setup if you plan to run Tomcat in application
mode. It is recommended since you need them when testing Tomcat
services. Find the system applet in the Control Panel, click the
Environment tab and add the following two variables with the
corresponding values. |
| JAVA_HOME |
c:\jdk1.3 |
| TOMCAT_HOME |
d:\inetpub\wwwroot\netspread\tomcat |
|
|
|
| Run
Tomcat as NT Service |
It is recommended to run Tomcat
as a NT service. So the next time the NT reboot the Tomcat service
will be automatically started up. You have to download the NT
service binary and its wrapper file from the following
locations. |
| NT Service
Binary Rev1.1 |
http://jakarta.apache.org/cvsweb/index.cgi/~checkout~/jakarta-tomcat/bin/nt_service/jk_nt_service.exe
|
| Wrapper File
Rev 1.1 |
http://jakarta.apache.org/cvsweb/index.cgi/~checkout~/jakarta-tomcat/src/etc/wrapper.properties?rev=1.1 |
| Location of
Binary & Wrapper File |
You copy the
jk_nt_service.exe and the wrapper.properties files into
d:\inetpub\wwwroot\netspread\tomcat\bin |
| Change the
Wrapper File |
You have to change the
wrapper.properties file for the following two parameters,
wrapper.tomcat_home and wrapper.java_home, their values are shown as
follows. |
| wrapper.tomcat_home |
d:\inetpub\wwwroot\netspread\tomcat |
| wrapper.java_home |
c:\jdk1.3 |
| Install Tomcat
Service |
Open a dos window in directory
d:\inetpub\wwwroot\netspread\tomcat\bin, issue
command jk_nt_service -i Tomcat wrapper.properties to add the
Tomcat service into NT services. You can remove the Tomcat
service by command jk_nt_service -r Tomcat. |
| Start Tomcat
Service |
You start the Tomcat service by command net start
Tomcat and shutdown the Tomcat service by command net stop
Tomcat You can also start/shutdown the Tomcat service by using
the service applet in the Control Panel. |
| Automatic
Startup |
In the service applet in the Control Panel, select the
Tomcat service and setup its startup type as automatic. |
| |
|
| Configure
IIS 4.0 |
The final step is to add some
entries in registry for Apache Software Foundation, create jakarta
virtual directory and add ISAPI redirect filter. You can get a
graphic view of the resulted registry
here. |
| Edit
Registry |
On a dos window, issue command
regedit. The Registry Editor for Windows is launched. Find
HKEY_LOCAL_MACHINE/SOFTWARE node. |
|
You right click the SOFTWARE
node and select new key. You change the child node name to
"Apache Software Foundation". |
|
You right click the new Apache
Software Foundation node and select new key. You change the child
node name to "Jakarta Isapi Redirector". |
|
You right click the new Jakarta
Isapi Redirector node and select new key. You change the child node
name to "1.0". |
|
You right click the new 1.0 node
and select new string value. You change the string
name to "extension_uri". You double click the named string and
change its value data to "/jakarta/isapi_redirect.dll". |
|
You right click
the new 1.0 node and select new string value. You change the string
name to "log_file". You double click the named string and change
its value data
to "d:\inetpub\wwwroot\netspread\tomcat\isapi.log". |
|
You right click
the new 1.0 node and select new string value. You change the string
name to "log_level". You double click the named string and
change its value data to "error". You can choose log level as
"inform", "debug", "emerg" too. |
|
You right click
the new 1.0 node and select new string value. You change the string
name to "worker_file". You double click the named string and
change its value data
to "d:\inetpub\wwwroot\netspread\tomcat\conf\workers.properties". |
|
You right click
the new 1.0 node and select new string value. You change the string
name to "worker_mount_file". You double click the named string
and change its value data
to "d:\inetpub\wwwroot\netspread\tomcat\conf\uriworkermap.properties". |
| Create Virtual
Directory |
Launch Microsoft
Internet Service Manager. Add a new virtual directory for site
netspread. The name of the virtual directory must be "jakarta", its
physical path is
"d:\inetpub\wwwroot\netspread\tomcat\bin\iis\i386". Grant the
virtual directory the execute privilege. |
| Install ISAPI
Filter |
Right click on
the site netspread and select properties and click the ISAPI Filters
tab. You add a new filter to the site. The filter name is "jakarta"
and the dll is located in
directory "d:\inetpub\wwwroot\netspread\tomcat\bin\iis\i386" -
the same one as the virtual directory. You apply and save the
changes. |
| |
|
| Test
Tomcat |
|
| Step 1.
Tomcat Service |
Make sure the Tomcat service is up and running. If it
is not running, you open a dos window and cd into
d:\inetpub\wwwroot\netspread\tomcat\bin, and issue command: startup.
You will see Tomcat running in application mode. If not, you have to
check the Java 2 SDK and Tomcat installation and the two environment
variables. If application mode is running and you can shut it down
by command: shutdown. If only Tomcat service does not run, you have
to check the wrapper.properties file, make sure the
wrapper.tomcat_home and wrapper.java_home are correct and they are
the same as the two environment variables. |
| Step 2. IIS
Filter Up |
You have to shutdown IIS server and start it up
again. The better way is to use the service applet in the Control
Panel. Find the "World Wide Web Publishing Services" and stop and
start it. Then you refresh the site netspread on the Internet
Service Manager and go to the ISAPI Filters tab and check the status
of the "jakarta" filter. It should have a green up arrow. If it has
a red down arrow, you have to double check all related entries in
the registry and the virtual directory setup. Make sure you
have the correct registry entries for Tomcat ISAPI redirector and
the virtual directory is executable. If you make any
changes, repeat the step 2 until the IIS Filter is up. |
|
|
|
| Add
Guide Context |
The Netspread Community Guide�
has three modules, the Guide Applet, the Guide Servlet, and the
Guide Source. The Guide Applet is a full blown application that is
launched within a web page and provides an Equal Rights Environment
that offers every user the capabilities to behave as customer,
vendor, publisher, workflow coordinator, processing manager, etc. in
one shared environment. Two files are involved when setting up the
Guide Applet on your web servers: guide10.htm and guide10.jar. The
Guide Servlet is a Java servlet running inside a Java Servlet/JSP
container, like Tomcat, and it processes requests from the Guide
Applets or browsers. The Guide Source is a schema in Oracle 8i
database. At least one Guide Source is required. One Guide Servlet
can maintain connections to one or more Guide Sources, and one Guide
Source can serve one or more Guide Servlets. We assume two Guide
Sources have been setup respectively in accounts "netspread" and
"netspread2" in the Oracle 8i database "nspread". |
| Guide
Applet |
The two files
for the Guide Applet are located in the directory
"d:\inetpub\wwwroot\netspread\web\spread". |
| Guide
Servlet |
The guide.jar
that contains GuideServlet.class is located in the directory
"d:\inetpub\wwwroot\netspread\tomcat\webapps\community\web-inf\lib".
All other files related to the Guide Servlet are located in the
directory
"d:\inetpub\wwwroot\netspread\tomcat\webapps\community\web-inf". The
file guide.pty describes the properties for the Guide Servlet. The
license file and log file specified in the guide.pty are also
located in the same directory as the guide.pty, as well as the file
web.xml, required by Tomcat. Notice the tag <load-on-startup>,
it will ensure the Guide Servlet will be initialized right after the
Tomcat service is started up. The contents of guide.pty and web.xml
are shown as follows. |
| guide.pty
file |
##### Always keep this line
########################################## # # NAME #
guide.pty # # DESCRIPTION # Specify the log file, license
key file, connection pool properties # for the guide servlet
packaged in the jar file guide.jar. # # The associated files
are: # guide.jar - the jar file that contains
GuideServlet.class; # guide.pty - this file that defines the
servlet properties; # guide.lic - the license key file required
to run the servlet; # guide.log - the log file that the servlet
writes to; # # NOTES # The full path of this file should be
registered as # parameter 'pfile' in the associated servlet
container # of the guide
servlet. # ##################################################################### loglevel=101 logfile=\ d:/inetpub/wwwroot/netspread/tomcat/webapps/community/web-inf/guide.log housekeeping.interval=3600 maxinactive.interval=36000 redirect=http://netspread.com/spread/guide10.htm #
Each guide servlet must have license file specified # which
contains a license key for the guide servlet # and possibly a
license key for each guide source listed in this
file. guide.license.file=\ d:/inetpub/wwwroot/netspread/tomcat/webapps/community/web-inf/guide.lic guide.source.1=production production.count=5 production.maxcount=1024 production.readonly=false production.username=netspread production.password=********* #
To use thin
driver production.serverid=jdbc:oracle:thin:@royals:1521:nspread #production.serverid=jdbc:oracle:thin:@royals:1521:guide2 #
To use oci8 driver, require Oracle 8.1.6 client installed #
production.serverid=jdbc:oracle:oci8:@nspread production.restricted=false #
Each guide source can optionally have a separated license file. #
The optional license file is used when this servlet share the #
same guide source with another servlet. If the other servlet #
license file contains the guide source license key, copy the
file # to the path specified below. If the guide source name is
different, # specify the guide source name you want to use for
this. #production.license.file=\ #d:/inetpub/wwwroot/netspread/tomcat/webapps/community/guide.lic #production.license.key=production.license.key guide.source.2=test test.count=2 test.maxcount=6 test.readonly=false test.username=netspread2 test.password=********** test.serverid=jdbc:oracle:thin:@royals:1521:nspread test.restricted=false |
| web.xml file |
<?xml version="1.0"
encoding="ISO-8859-1"?> <!DOCTYPE web-app PUBLIC "-//Sun
Microsystems, Inc.//DTD Web Application
2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2.2.dtd"> <web-app> <servlet> <servlet-name> GuideServlet </servlet-name> <servlet-class> GuideServlet </servlet-class> <init-param> <param-name>pfile</param-name> <param-value> d:/inetpub/wwwroot/netspread/tomcat/webapps/community/web-inf/guide.pty </param-value> </init-param> <load-on-startup> 100 </load-on-startup> </servlet> <servlet-mapping> <servlet-name> GuideServlet </servlet-name> <url-pattern> /guide </url-pattern> </servlet-mapping> </web-app> |
| Configure
Context |
Normally, you do not have
to change the web.xml file. But you have to make changes in the file
server.xml in the directory
"d:\inetpub\wwwroot\netspread\tomcat\conf". The first change is to
remove the connector that serves the port 8080.You do not need it
any more because Tomcat provides services through ajp12 on port 8007
where the IIS redirector will send request to. The second is to add
a new context with path "/community". Notice that the property of
reloadable = "false" so that Tomcat will have a better performance.
It is recommended for production deployments. |
| server.xml |
<?xml version="1.0"
encoding="ISO-8859-1"?> <Server> <!-- Debug
low-level events in XmlMapper startup --> <xmlmapper:debug
level="0" /> <!-- This is quite flexible; we can either
have a log file per module in Tomcat (example: ContextManager) or
we can have one for Servlets and one for Jasper, or we can just
have one tomcat.log for both Servlet and Jasper. If you omit
"path" there, then stderr should be used. verbosityLevel values
can be: FATAL ERROR WARNING
INFORMATION DEBUG --> <Logger name="tc_log"
path="logs/tomcat.log" customOutput="yes" /> <Logger
name="servlet_log" path="logs/servlet.log" customOutput="yes"
/> <Logger name="JASPER_LOG"
path="logs/jasper.log" verbosityLevel="INFORMATION"
/> <!-- Add "home" attribute if you want tomcat to be based
on a different directory "home" is used to create work and to
read webapps, but not for libs or CLASSPATH. Note that
TOMCAT_HOME is where tomcat is installed, while ContextManager home
is the base directory for contexts, webapps/ and
work/ --> <ContextManager debug="0" workDir="work"
home="d:\inetpub\wwwroot\netspread\tomcat"> <!--
ContextInterceptor className="org.apache.tomcat.context.LogEvents"
/--> <ContextInterceptor
className="org.apache.tomcat.context.AutoSetup"
/> <ContextInterceptor
className="org.apache.tomcat.context.DefaultCMSetter"
/> <ContextInterceptor
className="org.apache.tomcat.context.WorkDirInterceptor"
/> <ContextInterceptor
className="org.apache.tomcat.context.WebXmlReader"
/> <ContextInterceptor
className="org.apache.tomcat.context.LoadOnStartupInterceptor"
/> <!-- Request processing --> <RequestInterceptor
className="org.apache.tomcat.request.SimpleMapper" debug="0"
/> <RequestInterceptor
className="org.apache.tomcat.request.SessionInterceptor"
/> <RequestInterceptor
className="org.apache.tomcat.request.SecurityCheck"
/> <RequestInterceptor
className="org.apache.tomcat.request.FixHeaders"
/> <Connector
className="org.apache.tomcat.service.SimpleTcpConnector"> <Parameter
name="handler"
value="org.apache.tomcat.service.connector.Ajp12ConnectionHandler"/> <Parameter
name="port" value="8007"/> </Connector> <Context
path="/community" docBase="webapps/community" debug="0"
reloadable="false" >
</Context> </ContextManager> </Server> |
| Configure Worker
Map |
The file
workers.properties and uriworkermap.properties are located in the
directory "d:\inetpub\wwwroot\netspread\tomcat\conf".There is no
change in the file workers.properties, we list it here for your
reference. You have to add new context to the file
uriworkermap.properties. You use exact match for the Guide Servlet,
shown as follows. |
| workers.properties |
# # Simple worker configuration
file # worker.list=ajp12 worker.ajp12.port=8007 worker.ajp12.host=localhost # |
| uriworkermap.properties |
/community/guide=ajp12 |
| Oracle Jdbc
Driver |
The Guide Servlet uses
Oracle Jdbc driver to connect to the Oracle 8i database. We assume
that the Oracle 8.1.6 Jdbc driver, classes12.zip is copied to the
directory "d:\inetpub\wwwroot\netspread\tomcat\lib" on your NT
server and the Oracle 8i database is located on a remote server
"royals". You have to add a line in the file wrapper.properties for
the following parameter. You have to remove the Tomcat service from
the NT services and add it into the NT services again and restart
it. You also have to add this driver and guide.jar into the
CLASS_PATH environment variable. |
| wrapper.class_path |
$(wrapper.tomcat_home)\lib\classes12.zip |
| CLASS_PATH |
d:\inetpub\wwwroot\netspread\tomcat\lib\classes12.zip; d:\inetpub\wwwroot\netspread\tomcat\webapps\community\web-inf\lib\guide.jar; |
|
|
|
| Test Guide
Service |
You start to test the
guide service from the page http://netspread.com/demo.html
which will guide you to launch the full blown Guide Applet as
typical corporation desktop applications, but from an icon on a web
page instead of the one on a desktop. Try to save "The 007 Model
Home" even though it is under the contract with Uncle Sam who wants
it to be a multi-family complex. Have fun!!! |
|
|
|
| Reference |
|
| Gal Shachor and the
Tomcat development team members. |
"Tomcat IIS How To" "Working with the
Jakarta NT Service" "Tomcat User's Guide" "Developing
Applications with
Tomcat" |