Release Notes ExperShop pour Enhydra 3

Ce document donne un exemple de configuration d'Enhydra 3.1 pour ExperShop :
Un minimum de connaissances concernant la configuration d'Enhydra 3.1 est nécessaire pour l'exploiter (en particulier, savoir ce que sont le multiserver Enhydra, à quoi ressemble multiserver.conf, etc...).

Exemple de script de lancement pour Enhydra

Ce script positionne des variables d'environnement utiles à l'application ExperShop avant de lancer Enhydra multiserver.
#!/bin/sh

export CLASSPATH=/usr/local/expershop/WEB-INF/lib/expershop.jar:/usr/local/expershop/WEB-INF/lib/openeas.jar:/usr/local/expershop/WEB-INF/lib/xapool.jar:/usr/local/expershop/WEB-INF/lib/log4j.jar:/usr/local/expershop/WEB-INF/lib/hsqldb.jar
/usr/local/enhydra3.1/bin/multiserver

## exemple plus complexe - avec variable d'environnement supplementaire
## export CMKEYDIR=/usr/local/CYBERMUT
## /usr/local/enhydra3.1/bin/multiserver -java-arg -Djava.library.path=/usr/local/ExperSHOP/etc/cmut/linux-intel

Exemple de multiserver.conf

# Enhydra Multiserver Config File
# ==================================
# This file contains the configuration options for the
# Enhydra Multiserver. Typically it is manipulated
# through the Multiserver Admin application, however,
# power users may wish to edit it by hand.
#
# Notes:
#  * The Multiserver only reads this file on startup.
#    It is thus necessary to stop and restart the server if
#    changes are made by hand.
#  * The order of the parameters in this file is not significant. 
#  * Quotes are not required to delimit strings but are advised.
#  * Array parameters are specified as a comma separated list.
#    The parameter name is identified as an array with a "[]"
#    suffix.
#

# Server Section -----------------------------------------------------
# ==============
# These options configure server-wide attributes.
#
# Server.ConfDir
# --------------
# This is where the application's config files are stored.
# Each Enhydra application has a configuration
# file that must be placed in this directory in order for the
# application to be visible by the Multiserver and the Multiserver
# admin application.
#
# Server.LogFile
# --------------
# This is the file where the server log is written.
#
# Server.LogToFile[]
# ------------------
# This is a comma separated list of message types to send to the log
# file specified in server.logFile.
#
# Server.LogToStderr[]
# --------------------
# This is a comma separated list of message types to send to standard error.
#
# Possible logger levels:
# -----------------------
# These levels will be familiar to anyone that has used the UNIX
# syslog functionality:
#
#   EMERGENCY
#	Panic condition.
#   ALERT
#	A condition that should be corrected immediately, such as
#	database corruption.
#   CRITICAL
#	Critical conditions such as had device errors.
#   ERROR
#	General errors that are not usually fatal, but must be
#	resolved.
#   WARNING
#	Warning condition that may need attention, although the
#	need is not immediate.
#   NOTICE
#	Conditions that are not error conditions, but may require
#	special handling such as infrequent conditions.
#   INFO
#	General informational conditions, knowledge of which will
#	help to keep the server in good order.
#   DEBUG
#	Messages that contain information normally of use only when
#	debugging an application.
#   CLASSLOAD
#       Information about the loading of application classes.  Very
#       useful debugging class path problems.
#   REQUEST
#       The StandardLoggingFilter logs hits to this facility if
#       this is specified (normally it writes to it's own file).
#   XMLC
#       Information about auto-compiling XMLC pages.
#   XMLC_DEBUG
#       Debug information about auto-compiling XMLC pages.
#
#
Server.ConfDir = "/usr/local/enhydra3.1/apps"
Server.LogFile = "/usr/local/enhydra3.1/logs/multiserver.log"
Server.LogToFile[] = EMERGENCY, ALERT, CRITICAL, ERROR, WARNING, INFO
Server.LogToStderr[] = EMERGENCY, ALERT, CRITICAL, ERROR, WARNING, INFO
#
# The above setting is for verbose output. When running as a daemon
# process you may want to print out only emergencies, for example:
#     Server.LogToStderr[] = EMERGENCY
#

# Enhydra Application Section -----------------------------------------
# ==========================
# Each Enhydra application is added to the Multiserver with the
# following syntax. Note that multiple applications can be
# defined, the only restriction is that the [APPLICATION_ID] must
# be unique.
#
# Application.[APPLICATION_ID].ConfFile
# -------------------------------------
# This is set to "filename.conf", which must exist in the directory
# defined by "Server.ConfDir".
#
# Application.[APPLICATION_ID].Description
# ----------------------------------------
# A description of the application. This is visible in the
# management console.
#
# Application.[APPLICATION_ID].Running = yes | no
# -----------------------------------------------
# This is basically the same as the start/stop buttons in the admin
# app. If the server has running = no, then it will not be instantiated,
# until the user of the admin app clicks on the "start" button.
#
Application.MultiserverAdmin.ConfFile = multiserverAdmin.conf
Application.MultiserverAdmin.Description = "Multiserver Management Console."
Application.MultiserverAdmin.Running = yes

# Servlet Section ----------------------------------------------------
# ===============
# The Multiserver is able to run standard servlets in addition to
# Enhydra applications. The following syntax is
# used to define a servlet. Note that multiple servlets
# can be defined, the only restriction is that the [SERVLET_ID]
# must be unique.
#
# Each servlet is defined with:
#
# Servlet.[SERVLET_ID].ClassName = entryClass
# Servlet.[SERVLET_ID].DocRoot = Document root for servlet.
# Servlet.[SERVLET_ID].Description = "A description of servlet"
# Servlet.[SERVLET_ID].Running = yes | no
#
# where the ".classname" parameter defines the class with the
# service() method and ".description" defines a description used
# by the admin tool. The ".docRoot" is the full path to the
# directory used as the document root for this servlet and
# ".running" indicated whether to automatically start the
# servlet when the Multiserver is started.
#
# Optionally a servlet can be further specified with the following
# options:
#
# Servlet.[SERVLET_ID].InitArgs
# -----------------------------
# This is a collection of name-value pairs that are passed to the
# servlet and initial arguments. Refer to the servlet documentation
# for more information.
# For example:
#	Servlet.[SERVLET_ID].InitArgs.LogFile = /tmp/log
#	Servlet.[SERVLET_ID].InitArgs.Max = 256
#	Servlet.[SERVLET_ID].InitArgs.Names[] = "Joe Bob", "Jane Bee"
#
# Servlet.[SERVLET_ID].ClassPath[]
# --------------------------------
# This is set to a comma-separated list of classpath elements. The
# class loader will be extended with these paths so that the
# servlet can successfully load any required classes.
#
# Application.[APPLICATION_ID].Running
# ------------------------------------
# This is basically the same as the start/stop buttons in the admin
# app. If the server has running = no, then it will not be instantiated,
# until the user of the admin app clicks on the "start" button.
#

# ExperShop main servlet
Servlet.ExperSHOP.ClassName = com.expershop.lite.ExperSHOP
Servlet.ExperSHOP.DocRoot = /home/httpd/html
Servlet.ExperSHOP.Description = "ExperSHOP servlet."
Servlet.ExperSHOP.ClassPath[] = /usr/local/expershop/WEB-INF/lib/expershop.jar,/usr/local/expershop/WEB-INF/lib/openeas.jar,/usr/local/expershop/WEB-INF/lib/xapool.jar,/usr/local/expershop/WEB-INF/lib/log4j.jar,/usr/local/expershop/WEB-INF/lib/hsqldb.jar
Servlet.ExperSHOP.Running = yes
Servlet.ExperSHOP.InitArgs.SHOPCONFIG = /usr/local/ExperSHOP/EShop.cfg

# ExperShop admin servlet
Servlet.ESAdminServlet.ClassName = com.expershop.lite.ESAdminServlet
Servlet.ESAdminServlet.DocRoot = /tmp
Servlet.ESAdminServlet.Description = "ESAdminServlet servlet."
Servlet.ESAdminServlet.ClassPath[] = /usr/local/expershop/WEB-INF/lib/expershop.jar,/usr/local/expershop/WEB-INF/lib/openeas.jar,/usr/local/expershop/WEB-INF/lib/xapool.jar,/usr/local/expershop/WEB-INF/lib/log4j.jar,/usr/local/expershop/WEB-INF/lib/hsqldb.jar
Servlet.ESAdminServlet.Running = yes
Servlet.ESAdminServlet.InitArgs.SHOPCONFIG = /usr/local/ExperSHOP/EShop.cfg

# Document root for all static HTML content
Servlet.HTML.ClassName = org.enhydra.servlet.servlets.FileServerServlet
Servlet.HTML.DocRoot = "/home/httpd/html"
Servlet.HTML.Running = yes

# Pour le paiement securise CyberMut
# Ceci est un exemple: inutile si vous n'utilisez pas Cybermut
Servlet.CyberMut.ClassName = com.expershop.pay.cmut.ESCgi2Servlet
Servlet.CyberMut.DocRoot = /home/httpd/html
Servlet.CyberMut.Description = "CyberMut return servlet."
Servlet.CyberMut.ClassPath[] = /usr/local/expershop/WEB-INF/lib/expershop.jar,/usr/local/expershop/WEB-INF/lib/openeas.jar,/usr/local/expershop/WEB-INF/lib/xapool.jar,/usr/local/expershop/WEB-INF/lib/log4j.jar,/usr/local/expershop/WEB-INF/lib/hsqldb.jar
Servlet.CyberMut.Running = yes
Servlet.CyberMut.InitArgs.SHOPCONFIG = /usr/local/ExperSHOP/EShop.cfg

# Connection Methods Section -----------------------------------------
# ==========================
# This section defines all the possible ways that the Multiserver will
# accept requests. Any number of connection methods are allowable
# so long as the [CONNECTION_ID] is unique. The [CONNECTION_ID]
# is used when associated with an application/servlet by defining
# a channel.
#
# Connection.[CONNECTION_ID].Type
# -------------------------------
# The connection type is set to any supported connection method.
# Possible types are:
#
# "http"
# This instructs the Multiserver to directly listen for http requests on the
# specified port. The port is specified with:
#	Connection.[CONNECTION_ID].Port = [port]
# The number of handler threads my be specified with:
#       Connection.[CONNECTION_ID].NumThreads = [num]   (optional)
# The number of socket requests to queue (after accept, before processing)
# may be specified with:
#       Connection.[CONNECTION_ID].QueueSize = [num]    (optional)
# The idle timeout period for a client connection, in seconds.  This is the
# amount of time to block without activity.
#       Connection.[CONNECTION_ID].ClientTimeout = [num]   (optional)
# The idle timeout period for a handler thread, in seconds.  Shorter timeouts
# minimize the number of threads (memory) while slowing response time for
# bursts of activity.
#       Connection.[CONNECTION_ID].ThreadTimeout = [num]   (optional)
#
# "https"
# This instructs the Multiserver to directly listen for secure-http requests
# on the specified port. The port is specified with:
#	Connection.[CONNECTION_ID].Port = [port]
# The number of handler threads my be specified with:
#       Connection.[CONNECTION_ID].NumThreads = [num]   (optional)
# The number of socket requests to queue (after accept, before processing)
# may be specified with:
#       Connection.[CONNECTION_ID].QueueSize = [num]    (optional)
#
Connection.HttpConn8001.Type = http
Connection.HttpConn8001.Port = 8001

Connection.HttpConn8002.Type = http
Connection.HttpConn8002.Port = 8002

# Channel Section ----------------------------------------------------
# ===============
# This section defines how applications/servlets are connected with
# connection methods. Each channel entry represents an entry point
# to an application than can be individually controlled. Note that
# like other IDs, each [CHANNEL_ID] must by unique.
#
# Each channel is defined with:
#
# Channel.[CONNECTION_ID].[CHANNEL_ID].Servlet = [APPLICATION_ID]
#    or
# Channel.[CONNECTION_ID].[CHANNEL_ID].Servlet = [SERVLET_ID]
#
#    and
# Channel.[CONNECTION_ID].[CHANNEL_ID].Url = [url prefix]
#    and
# Channel.[CONNECTION_ID].[CHANNEL_ID].Filters = [FILTER_ID],[FILTER_ID]
#    and
# Channel.[CONNECTION_ID].[CHANNEL_ID].Enabled = yes | no
# 
# 
# where the ".Servlet" parameter defines the application/servlet
# to connect to and the [CONNECTION_ID].[CHANNEL_ID] path defines
# the connection method to connect to.
# The Url should generally begin and end with a '/'.
# The ".Filters" is optional and defines a
# list of [FILTER_ID] that a channel is subject to. Filters are
# executed in the order that they are defined. The most common use
# of a filter is for logging purposes. In general, filters are an
# advanced topic that is discussed in the developers guide.

Channel.HttpConn8001.AdminChannel.Servlet = MultiserverAdmin
Channel.HttpConn8001.AdminChannel.Url = /
Channel.HttpConn8001.AdminChannel.Enabled = yes

Channel.HttpConn8002.ExperSHOPChannel.Servlet = ExperSHOP
Channel.HttpConn8002.ExperSHOPChannel.Url = /servlet/com.expershop.lite.ExperSHOP
Channel.HttpConn8002.ExperSHOPChannel.Filters[] = StandardLogger
Channel.HttpConn8002.ExperSHOPChannel.Enabled = yes

Channel.HttpConn8002.ESAdminServletChannel.Servlet = ESAdminServlet
Channel.HttpConn8002.ESAdminServletChannel.Url = /servlet/com.expershop.lite.ESAdminServlet
Channel.HttpConn8002.ESAdminServletChannel.Filters[] = StandardLogger
Channel.HttpConn8002.ESAdminServletChannel.Enabled = yes

Channel.HttpConn8002.HTML.Enabled = yes
Channel.HttpConn8002.HTML.Servlet = HTML
Channel.HttpConn8002.HTML.Url = /

# For CyberMut secure payment return servlet
# This is just an example - forget this if not using CyberMut
Channel.HttpConn8002.CyberMutChannel.Servlet = CyberMut
Channel.HttpConn8002.CyberMutChannel.Url = /servlet/com.expershop.pay.cmut.ESCgi2Servlet
Channel.HttpConn8002.CyberMutChannel.Filters[] = StandardLogger
Channel.HttpConn8002.CyberMutChannel.Enabled = yes

# Filter Section -----------------------------------------------------
# ==============
# This section is allows filters to be defined and subsequently used
# on a channel declaration. Note that each [FILTER_ID] must be unique.
#
# WARNING: It is the responsability of the administrator to ensure that
# the CLASPATH is set up prior to running the Multiserver such that the filter
# (and any classes it needs) will be found. The location of the filter
# class on disk is not specified.
#
# Each filter is defined with:
#
# Filter.[FILTER_ID].ClassName = entryClass
# Filter.[FILTER_ID].Description = "A description of filter"
#
# where the ".classname" parameter defines the class with the
# service() method and ".description" defines a description used
# by the admin tool.
#
# Optionally a filter can be further specified with the following option:
#
# Filter.[FILTER_ID].InitArgs
# -----------------------
# This is a collection of name-value pairs that are passed to the
# servlet and initial arguments. Refer to the developers guide
# for more information.
# For example:
#	Filter.[FILTER_ID].InitArgs.configFile = /tmp/filter_config
#	Filter.[FILTER_ID].InitArgs.myParam = myValue
#

#
# This filter is used to log the requests as they are made to the server
# (aka "hits"). If the key REQUEST is present in Server.LogToFile or
# Server.LogToStderr (above), then a simple summary of the request and
# response will be sent to the standard logging facility. This kind of
# logging is usefull for quick debugging of an application. If the key
# REQUEST is not present, then data is not sent to the standard logging
# facility.
# If the initial argument "logFile" (optional, below) is set, then this filter
# will append data about the requests to the specified file, in a standard
# format that tools like Web Analyzer can read. If no logFile is specified,
# then data is not written to the file.
# This filter is applied to individual channels, so only the channels
# that need logging pay the overhead.
#
Filter.StandardLogger.ClassName = org.enhydra.servlet.filter.StandardLoggingFilter
Filter.StandardLogger.Description = "Standard Enhydra Logging."
Filter.StandardLogger.InitArgs.logFile = "/usr/local/enhydra3.1/logs/access.log"