Tuesday, May 15, 2007

Setup Java Web Start

When I request to start java program by request the jnlp file, the web server return the contains of the file, intead the program.

I look to the document in Sun's web site and found the reason that I need set the MIME type for JNLP.

Following is the document I read.

http://java.sun.com/developer/technicalArticles/WebServices/JWS_2/JWS_White_Paper.pdf

Friday, May 11, 2007

Link Apache 2.2 and Tomcat 5.5 on Windows

1. Download & install Apache 2.2
2. Download & install Tomcat 5.5
3. Download Tomcat connector, my file is 'mod_jk-apache-2.2.4.so', rename it to 'mod_jk.so' and save in 'modules' directory under Apache installation directory.
4. create a file called 'workers.properties', Below is the contents.

# workers.properties.minimal -
#
# This file provides minimal jk configuration properties needed to
# connect to Tomcat.
#
# The workers that jk should create and work with
#
worker.list=ajp13w
#

# Defining a worker named ajp13w and of type ajp13
# Note that the name and the type do not have to match.
#
worker.ajp13w.type=ajp13
worker.ajp13w.host=localhost
worker.ajp13w.port=8009
#

# Defining a load balancer
#
worker.wlb.type=lb

worker.wlb.balance_workers=ajp13w
#

# Define status worker
#
worker.jkstatus.type=status


5. add following text at the bottom of httpd.conf file

# add by wangzj for tomcat
# Load mod_jk module
LoadModule jk_module modules/mod_jk.so
# Where to find workers.properties
JkWorkersFile "C:\Program Files\Apache Software Foundation\Jakarta Isapi Redirector\conf\workers.properties"
# Where to put jk shared memory
JkShmFile "C:\Program Files\Apache Software Foundation\Jakarta Isapi Redirector\log\mod_jk.shm"
# Where to put jk logs
JkLogFile "C:\Program Files\Apache Software Foundation\Jakarta Isapi Redirector\log\mod_jk.log"
# Set the jk log level [debug/error/info]
JkLogLevel info
# Select the timestamp log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
# Send servlet for context /examples to worker named worker1 JkMount /examples/servlet/* worker1
# Send JSPs for context /examples to worker named worker1
JkMount /examples/*.jsp worker1
# send context /THG to worker named ajp13w

JkMount /THG/* ajp13w


6. that is all.