Appendix A
Environment Setup
In order to make
the system work, we have to install the following combination of software then
do the configuration:
·
Windows 2000
Professional
·
Microsoft Internet
Explorer V5.50.4134.0600
·
Nokia WAP Toolkit
2.0
·
Sun Java SDK SE V1.3
·
Apache Web Server
V1.3.12
·
Jakarta-Tomcat V3.1
·
Cocoon V1.7.4
Step 1. Basic Environment and
Utility Setup
Install
Windows 2000 Professional
Install
Microsoft Internet Explorer V5.50.4134.0600
Install
Nokia WAP Toolkit 2.0
Install
Sun Java SDK SE V1.3 under directory C:\Program Files, then its directory is
C:\Program Files\jdk1.3
Step 2. Setup Apache Web Server
C:\Program_Files\Apache
Group\Apache\conf\httpd.conf file to include your machine
DNS name or http://127.0.0.1 for local
machine. (remember to eliminate # sign before ServerName)# ServerName
allows you to set a host name which is sent back to clients for
# your server
if it's different than the one the program would get (i.e., use
#
"www" instead of the host's real name).
#
# Note: You
cannot just invent host names and hope they work. The name you
# define here
must be a valid DNS name for your host. If you don't understand
# this, ask
your network administrator.
# If your host
doesn't have a registered DNS name, enter its IP address here.
# You will
have to access it by its address (e.g., http://123.45.67.89/)
# anyway, and
this will make redirections work in a sensible way.
#
ServerName http://127.0.0.1/
Action|Start i.e
start Apache.http://127.0.0.1:80. You
should see the standard "If you can see this, it means that the
installation of the Apache web server software on this system was
successful" page.
Step 3. Setup Jakarta-Tomcat to serve Java Servlet
http://jakarta.apache.org/builds/tomcat/release/v3.1/bin/win32/i386/And grab the ApacheModuleJServ.dll file then
copy this file into the C:\Program Files\Apache Group\Apache\modules directory
httpd.conf file
to add the whole content of "C:/Program
Files/jakarta-tomcat/conf/tomcat-apache.conf"
file to the end of httpd.conf. See
code segment below. The tomcat-apache file
is automatically created when Jakarta-Tomcat starts. Note the quote sign
" " has to be added in the alias path of /examples and /test.
LoadModule
jserv_module modules/ApacheModuleJServ.dll
ApJServManual
on
ApJServDefaultProtocol
ajpv12
ApJServSecretKey
DISABLED
ApJServMountCopy
on
ApJServLogLevel
notice
ApJServDefaultPort
8007
AddType
test/jsp .jsp
AddHandler
jserv-servlet .jsp
Alias
/examples "C:\Program
Files\jakarta-tomcat\webapps\examples"
<Directory
"C:\Program Files\jakarta-tomcat\webapps\examples">
Options Indexes FollowSymLinks
</Directory>
ApJServMount
/examples/servlet /examples
<Location
/examples/WEB-INF/ >
AllowOverride None
deny from all
</Location>
Alias /test "C:\Program Files\jakarta-tomcat\webapps\test"
<Directory
"C:\Program Files\jakarta-tomcat\webapps\test">
Options Indexes FollowSymLinks
</Directory>
ApJServMount
/test/servlet /test
<Location
/test/WEB-INF/ >
AllowOverride None
deny from all
</Location>
ApJServMount
/servlet /ROOT
C:\Program
Files\jakarta-tomcat\bin\tomcat.bat to add env variables TOMCAT_HOME and JAVA_HOME. See
code segment below.
@echo off
rem A batch
file to start/stop tomcat server.
rem This batch
file written and tested under Windows NT
rem
Improvements to this file are welcome
rem Guess
TOMCAT_HOME if it is not present
set
TOMCAT_HOME=C:\Program Files\jakarta-tomcat
set
JAVA_HOME=C:\jdk1.2.2
if not
"%TOMCAT_HOME%" == "" goto gothome
SET
TOMCAT_HOME=.
if exist %TOMCAT_HOME%\bin\tomcat.bat
goto gothome
C:\Program_Files\jakarta-tomcat\bin
. Type tomcat
start. Jakarta-Tomcat will start up in another Command
Prompt window.http://127.0.0.1:8080/examples/servlets/ -
Note the 8080 port in the address.
xerces_1_0_3.jar, xalan_1_0_1.jar, fop_0_12_1.jar and servlet_2_2.jar
files, found in the C:\Program_Files\cocoon-1.7.4\lib to
the C:\Program_Files\jakarta-tomcat\lib
directory.C:\Program_Files\cocoon-1.7.4\bin\cocoon.jar file
to the C:\Program_Files\jakarta-tomcat\lib
directory.C:\Program_Files\jakarta-tomcat\bin\tomcat.bat to
add the five Cocoon .jar files to the Jakarta-Tomcat CLASSPATH env
variable. Note the "remed"
out set
CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\servlet.jar
line.
set
CLASSPATH=.
set
CLASSPATH=%TOMCAT_HOME%\classes
set
CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\xerces_1_0_3.jar
set
CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\xalan_1_0_1.jar
set
CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\fop_0_12_1.jar
set
CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\servlet_2_2.jar
set
CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\cocoon.jar
set
CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\webserver.jar
set
CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\jasper.jar
set
CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\xml.jar
rem set
CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\servlet.jar
set
CLASSPATH=%CLASSPATH%;%JAVA_HOME%\lib\tools.jar
if
"%cp%" == "" goto next
C:\Program_Files\jakarta-tomcat\conf\web.xml file
to add the Cocoon specific configuration directives.
<servlet-mapping>
<servlet-name>
jsp
</servlet-name>
<url-pattern>
*.jsp
</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<!-- Start
Cocoon Section -->
<servlet>
<servlet-name>org.apache.cocoon.Cocoon</servlet-name>
<servlet-class>org.apache.cocoon.Cocoon</servlet-class>
<init-param>
<param-name>properties</param-name>
<param-value>cocoon.properties</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>org.apache.cocoon.Cocoon</servlet-name>
<url-pattern>*.xml</url-pattern>
</servlet-mapping>
<!-- End Cocoon Section -->
C:\Program_Files\cocoon-1.7.4\conf\cocoon.properties file
to the C:\Program_Files\jakarta-tomcat\webapps\ROOT
directory.tomcat stop in a
Windows 2000 Command Prompt window which has been cded to C:\Program_Files\jakarta-tomcat\bin.
Stop Apache Web Server.http://127.0.0.1:8080/Cocoon.xml -
You should see the Cocoon V1.7.4 status page containing all of the
internal configuration information and settings specific to Cocoon.
C:\Program_Files\jakarta-tomcat\webapps\wmlPut WML/XML/XSL
files inside C:\Program_Files\jakarta-tomcat\webapps\wml directory (such
as index.wml, cda_xml.xsl, V3CFNPRA30103721.xml,…) cocoon.properties file
into the wml directory where XML/XSL
exists.C:\Program_Files\jakarta-tomcat\webapps\wml\WEB-INFC:\Program_Files\jakarta-tomcat\webapps\wml\WEB-INF\classesPut
needed Servlet
class files inside classes
directory (such as CDAServlet.class) .C:\Program_Files\jakarta-tomcat\conf\web.xml
file.
<!--
mime-mapping for all type of wml
file-->
<mime-mapping>
<extension>
wml
</extension>
<mime-type>
text/vnd.wap.wml
</mime-type>
</mime-mapping>
<mime-mapping>
<extension>
wmlc
</extension>
<mime-type>
application/vnd.wap.wmlc
</mime-type>
</mime-mapping>
<mime-mapping>
<extension>
wmls
</extension>
<mime-type>
text/vnd.wap.wmlscript
</mime-type>
</mime-mapping>
<mime-mapping>
<extension>
wmlsc
</extension>
<mime-type>
application/vnd.wap.wmlscriptc
</mime-type>
</mime-mapping>
<mime-mapping>
<extension>
wbmp
</extension>
<mime-type>
image/vnd.wap.wbmp
</mime-type>
</mime-mapping>
<!-- finish mapping for wml files
-->
<mime-mapping>
<extension>
txt
</extension>
<mime-type>
text/plain