Copyright © 2014 Maplesoft, a division of Waterloo Maple Inc.
Copyright © 2014 Maplesoft, a division of Waterloo Maple Inc.
This installation guide is divided into two sections: MapleNet Server Installation and MapleNet Publisher Installation.
The MapleNet™ Server is the computer that processes MapleNet requests and performs the interactions with the Maple™ engine.
The MapleNet Publisher is the computer used to author MapleNet content.
The MapleNet Client is the computer that views the content using a web browser.
Refer to the appropriate section for the type of installation that you are completing.
Notes:
Return to the top of the MapleNet 18 Installation and Licensing Guide.
MapleNet client requirements:
Note: On 64-bit Windows, you must use a 32-bit browser with 32-bit Java. MapleNet does not support 64-bit browsers on Windows.
A publisher machine is responsible for creating and editing the content of web pages and uploading them to the server.
Note: A single machine can be both server and publisher.
MapleNet Publisher requirements:
Clients connect to a MapleNet server to access web pages and the associated MapleNet applets.
The MapleNet server runs as a servlet inside a compatible web server, such as Tomcat™.
MapleNet Server requirements:
Version |
Windows XP |
Windows 7 |
Windows 8.1 |
Windows Server® 2008 R2 |
Windows Server 2012 |
Version |
Apple OS® X 10.8 |
Apple OS® X 10.9 |
Note: The MapleNet Server is supported on a Macintosh server, but the MapleNet Publisher is not supported for Macintosh.
Vendor | Operating System Version |
Red Hat Enterprise Linux | 6 |
SUSE Linux Enterprise Desktop | 11 |
Ubuntu | 12.04 LTS, 13.10 |
CentOS | 6.5 |
Return to the top of the MapleNet 18 Installation and Licensing Guide.
The following software must be installed on the server computer prior to the installation of MapleNet.
Linux Note: This program uses Java Swing. Therefore, on Linux platforms, it needs to run on either an X-terminal or a virtual X environment, such as Xvfb.
Return to the top of the MapleNet 18 Installation and Licensing Guide.
Return to the top of the MapleNet 18 Installation and Licensing Guide.
Return to the top of the MapleNet 18 Installation and Licensing Guide.
Note: The Java Virtual Machine (JVM) is selected automatically by the installer. Alternatively, select the JVM from the list of known JVMs on the server or browse to find another JVM on disk.
Return to the top of the MapleNet 18 Installation and Licensing Guide.
The MapleNet server runs as a servlet under the control of the web server. It is started automatically when the web server is running. Licensing for MapleNet is via the license installed for Maple as described in Prerequisites.
Note: Prior versions of MapleNet had a separate program, maplenetserver, that ran in parallel with the web server. This is no longer the case.
In order to get Tomcat and MapleNet to startup on Server restart, the System Administrator should create a init.d script, say a file called maplenet with read/execute privileges, to start/stop the Tomcat process. This script must either call the maplenet_ctl script that is supplied or perform similar steps to those in the maplenet_ctl script.
After this file is created and tested the Administrator should create a symbolic link in the appropriate /etc/rc.X.d directory where X is the runlevel of the server. See your server documentation for how to setup startup scripts for particular runlevels.
Contents of an example maplenet script could be (but are not limited to):
# maplenet - start/stop script for invoking Tomcat
# with a MapleNet environment setup
# Also assume a 'maplenet' user has been created and is
# owner of the Tomcat and MapleNet directories
#
# Check that JAVA_HOME is set
#
if [ -z "$JAVA_HOME" ] ; then
#
# Change to point at your Java installation
export JAVA_HOME=/usr/local/java/jdk1.6.0_38
fi
#
# Point at the MapleNet startup script that sets
# - Xvfb and the DISPLAY setting for server side generated graphics
# - set maple environment
# - starts Tomcat with this environment and DISPLAY
#
# *** Change to point at your MapleNet installation ***
m_pgm=/usr/local/tomcat6/webapps/maplenet/WEB-INF/bin/maplenet_ctl
#
# logging if desired
m_log1=/usr/local/tomcat6/logs/maplenet_start.log
m_log2=/usr/local/tomcat6/logs/maplenet_stop.log
#
if [ -f $m_pgm ] ; then
#
RETVAL=0
#
case "$1" in
#
start)
# Run the maplenet_ctl script as user maplenet
date >> $m_log1
su - maplenet -c "$m_pgm -x -t -m start" >> $m_log1
;;
#
stop)
# Run the maplenet_ctl script as user maplenet
date >> $m_log2
su - maplenet -c "$m_pgm -x -t -m stop pass=spiffee" >> $m_log2
;;
#
*)
echo "maplenet - unknown option $1"
echo "Usage: maplenet [start|stop]"
exit 1
;;
esac
#
exit $RETVAL
else
# Incorrect configuration of this script
echo "Script $m_pgm is missing."
exit 1
fi |
MapleNet system files and sample web pages are installed in the <webapps> directory where <webapps> represents the web server's application directory. The following table lists the subdirectories and their contents.
Directory | Purpose |
<webapps>/maplenet | MapleNet root directory. All web pages accessed via the Internet are obtained relative to this directory. |
<webapps>/maplenet/admin | administration web pages to set and view the state of MapleNet |
<webapps>/maplenet/error | error pages used by JSPs |
<webapps>/maplenet/images | images used by the worksheet component and sample applications |
<webapps>/maplenet/jar | Java jar files used by all applications |
<webapps>/maplenet/js | JavaScript™ files required by the worksheet component and sample applications |
<webapps>/maplenet/samples | subdirectories for sample applets, Maplets, JSP and worksheets |
<webapps>/maplenet/temp | MapleNet temporary files |
<webapps>/maplenet/theme | stylesheets used by the worksheet component and sample applications |
<webapps>/maplenet/util | miscellaneous files used internally by MapleNet |
<webapps>/maplenet/WEB-INF | standard servlet subdirectory containing directory and files for the operation of MapleNet |
Any web page request to the web server of the form http://yourserver.com:port/maplenet/X will be obtained from <webapps>/maplenet/X if it exists. For example, if a browser requests the page http://yourserver.com:8080/maplenet/samples/index.html, then the server will attempt to download the page from <webapps>/maplenet/samples/index.html. Therefore, any user-created MapleNet applications should be located somewhere under the <webapps>/maplenet root directory. Typically, users will create one or more subdirectories under this root. The organization and naming of these subdirectories is left to the administrator and/or publisher. Access to these files is controlled by the web server in conjunction with the operating system settings for ownership and permissions.
Note: The web server hides the contents of the WEB-INF subdirectories, making them inaccessible externally. Do not store user files in this subdirectory.
When a web page accesses content under the MapleNet root directory for a resource that is a JSP (.jsp) or a worksheet (.mw,.mws), MapleNet will process the file and return the content via the web server.
Return to the top of the MapleNet 18 Installation and Licensing Guide.
The server settings are stored in the <webapps>/maplenet/WEB-INF/classes/maplenetserver.properties file and is automatically updated during installation. It contains an entry of the form maplenet.kernel.name.1=<identifier> and defines the Maple kernels that MapleNet can access. Each kernel has a corresponding set of kernel.<identifier>.<attribute> entries. Currently only a kernel connection to the same machine running MapleNet is supported. The default install has an entry named maplenet.kernel.name.1=localhost.
Note: For MapleNet 18, this is the only possible identifier.
An example set of kernel settings for localhost are:
kernel.localhost.active=true kernel.localhost.host=localhost kernel.localhost.listenport=50574 kernel.localhost.program_path=/usr/local/tomcat/webapps/maplenet/WEB-INF/bin/mserver_shell kernel.localhost.program_args=-noclient -jgui -z kernel.localhost.program_ini=ini/maplenet_init kernel.localhost.minimum=1 kernel.localhost.maximum=20 kernel.localhost.idle=1 kernel.localhost.concurrent=1 kernel.localhost.max_evaluating=1 kernel.localhost.request_timeout=20 kernel.localhost.evaluate_timeout=60 kernel.localhost.lock_timeout=300 |
The following table indicates the possible attributes and what each attribute controls.
Attribute | Description |
active | If true, this kernel will be used. If false, the rest of the kernel.<Identifier>.<attribute> entries for this <identifier> are ignored. The only valid values are true and false. |
host | The hostname of the computer where Maple resides. Currently, this must be localhost. |
listenport | The listening TCP/IP port number used internally by the MapleNet servlet to communicate when starting Maple kernels. Since Maple kernels themselves use ports starting at 50575, this port should be below that. Do not choose a port that would interfere with other software. In most cases, this value should not be changed. Note: This is not the web server (for example, Tomcat) listen port. |
program_path | The path to the kernel program. Windows: the path to the mserver.exe file usually found at \Program Files\Maple 18\bin\mserver.exe. Linux: the path to a shell script to start the required kernel found at <webapps>/maplenet/WEB-INF/bin/mserver_shell. |
program_args | Arguments required to start the Maple kernel correctly for MapleNet. The -noclient and -jgui arguments are mandatory. The -z argument prevents MapleNet web applications from accessing the local file system and is included to prevent users from compromising server security. Other Maple command line arguments can be added as discussed in Other Settings for Maple Kernel. |
program_ini | The relative path to a Maple initialization file that contains settings required for running MapleNet. This path is relative to the <webapps>/maplenet/WEB-INF directory. The default is ini/maplenet_init |
minimum | The minimum number of Maple kernels that are continually running. These kernels are started prior to any math requests from MapleNet so that incoming math requests are not delayed by starting Maple. The default is 1. |
maximum | The maximum number of Maple kernels allowed to run. This limit should be set to prevent the server from becoming overloaded with too many Maple connections. If maximum kernels are in use, any subsequent request for a new kernel raises an error that is sent back to the MapleNet application. |
idle | The surplus of Maple kernels that are started to wait for new math requests as other kernels become busy. Idle kernels are stopped if the number of kernels waiting exceeds the value of idle. This can occur as kernels are released by their math requests. |
Note: minimum, maximum, and idle define the pool of Maple kernels that are available to MapleNet.
concurrent | This value is for future use and should be left at 1. |
max_evaluating | This value is for future use and should be left at 1. |
request_timeout | The time in seconds that a MapleNet application will wait to obtain a Maple kernel from the pool. This timeout generally only occurs if there are maximum Maple kernels in use and a new request for a Maple kernel has to wait for one to become available. The default is 20. |
evaluate_timeout | The time in seconds that MapleNet will wait for an individual math calculation to complete in the Maple kernel. This is to prevent cases where the Maple kernel may not return a response in a reasonable amount of time. The default is 60. Note: This differs slightly from prior versions of MapleNet, which had an evaluation timeout for the entire math request as a whole. In fact, a math request could actually contain an array of calculations (that is, multiple Maple expressions). The timeout now applies to each individual expression. |
lock_timeout | The time in seconds that a locked Maple kernel can be inactive before being returned to the pool of Maple kernels for reuse. The timeout is measured from the time of the last evaluation performed by the kernel. Locked kernels are tied to a specific user session and are generally released by an application when the application is done. If an application that locks a Maple kernel is inactive for longer than this timeout, that application loses its hold on that kernel and the kernel is returned to the pool. Examples of applications that lock the kernel are Maplets, applets that specifically lock a MapleStatement connection, JSP pages that do not use the <maple:release> tag, and most worksheets. The default is 300 (5 minutes). |
The program_arg settings allow for arguments to be passed to Maple on each kernel startup. In order to include user defined Maple initializations or libraries, the Maple command line arguments -i <file> or -b <dir> may be used. The -i <file> option includes <file> as a Maple initialization file to read. Use an absolute path for <file> because the Maple kernel is started in the current directory of the Java Virtual Machine of the web server. The -b <dir> option tells Maple to look for additional user libraries in <dir>. Again, <dir> must be an absolute directory path.
When the MapleNet server starts, it attempts to create a pool of Maple kernels to be used by MapleNet applications. The size of the pool varies with demand on the server and is controlled by the parameters minimum (MIN), maximum (MAX) and idle (IDL). On startup, there will be at least MIN Maple kernels created. There could be more than MIN if IDL is larger than MIN. If MIN and IDL are both zero, no kernels are started. MapleNet then monitors the pool ensuring there are never fewer than MIN Maple kernels created and never more than MAX Maple kernels created. It also monitors the number of kernels in use and the number of kernels that are idle, awaiting the next MapleNet application.
The presence of idle kernels allows a new MapleNet application to begin without waiting for the startup time of a Maple kernel. Kernels are started and monitored in a separate thread to reduce overhead in the threads responding to MapleNet math requests.
The pool size is determined as follows. Let R be the number of kernels that are in use by MapleNet applications (running), and let W represent the number of kernels started but idle (waiting). Then the total number of kernels in the system is K = R + W. Then K is governed by the relationship 0 <= MIN <= K <= MAX.
Periodically, the server compares the idle kernels, W, to the idle setting, IDL, according to the following algorithm.
K=R+W
if K <MIN then
c=MIN-K
else
c=IDL-W
end if
if c>0 then
if K < MAX then
create a new kernel
set its state to idle
add kernel to the pool
W=W+1
end if
else if c < 0 then
remove oldest idle kernel from pool
stop kernel process
W=W-1
end if |
When a kernel has completed its calculation and is released by the application, the kernel's state is changed from active to idle and the periodic idle check adjusts the pool. This idle check occurs approximately every 5 seconds on the server or more frequently if the load on the server increases.
When a kernel is requested by a new MapleNet application, the system first tries to obtain an available idle kernel. If one is available, its state is changed to active (running). If no idling instance is available, and K < MAX, then a new kernel is started in the active state. If K = MAX, then the system will wait for up to request_timeout for another application to release its kernel. If this wait time is exceeded, an error is returned to the application. Under a heavily loaded system where many requests are received and waiting, the requests will be handled in the order received.
Return to the top of the MapleNet 18 Installation and Licensing Guide.
This component must be installed on computers where MapleNet content is to be authored and uploaded to the server. A single machine can be both server and publisher.
The publisher component of the MapleNet application is located in the Publisher directory of your installation disc. You can copy this directory to your network or copy the contents of the directory to another disc for distribution.
To install the publisher component of the MapleNet software:
When extracted, your directory structure should resemble the following.
Directory | Description |
doc | Location of Javadoc files describing the MapleNet classes, sample Java and HTML files. |
jar | Location of Java code files |
Publisher | Location of publishing documentation. The documents can be accessed by browsing to the index.html page |
Publisher/samples | Sample code for creating MapleNet content |
Note: To access the script files from any directory, the bin directory must be added to the path environment variable.
Note: MapleNet Publisher is not supported for Macintosh.
Return to the top of the MapleNet 18 Installation and Licensing Guide.
MapleNet, Maplet, Maple T.A., and Maplesoft are trademarks of Waterloo Maple Inc
© Maplesoft, a division of Waterloo Maple Inc. 2014. All rights reserved.
The use of general descriptive names, trade names, trademarks, etc., in this publication, even if the former are not especially identified, is not to be taken as a sign that such names, as understood by the Trade Marks and Merchandise Marks Act, may accordingly be used freely by anyone.
Java, JRE, NetBeans, and all Java-based marks are trademarks or registered trademarks of Oracle and/or its affiliates in the United States and other countries. Maplesoft is independent of Oracle Corporation.
Microsoft, Windows, Windows Server, and Internet Explorer are registered trademarks of Microsoft Corporation.
Macintosh, Mac OS, and Safari are registered trademarks of Apple Inc.
Firefox is a registered trademark of the Mozilla Foundation.
Google Chrome is a trademark of Google, Inc.
Tomcat is a trademark of The Apache Software Foundation.
All other trademarks are property of their respective owners.