webMathematica >
webMathematica Tutorial

Optional Further Configuring

There are a number of additional features that can be obtained by optional extra installation steps. It is not necessary to carry them out to run your webMathematica server, but they are included in this section to provide extra information.

MSP Mathematica Application

The MSP Mathematica application contains various Mathematica packages and utilities such as documentation. It is already installed in the webMathematica layout so that webMathematica will operate without any extra steps. However, you may wish to use some of the functions or to view the webMathematica documentation in the Mathematica Documentation Center. In order to do this, you will need to install the application. This installation step is optional because it is not needed for webMathematica to run. Note that you can also find the documentation on the Wolfram Research web site at http://reference.wolfram.com/mathematica/webMathematica/tutorial/Overview.html.
The MSP Mathematica application is in archive form on the webMathematica Tools CD-ROM. Unpack the appropriate archive and place its contents into the AddOns/Applications directory in your Mathematica directory. It should then be possible to launch Mathematica and the webMathematica documentation to appear in the Documentation Center under Installed AddOns.
The MSP Mathematica application contains useful functions for formatting Mathematica expressions into HTML tables and select tags, in addition to utilities useful for using SVG.

Launching webMathematica Automatically

It is common for a web application, such as webMathematica, to be launched automatically whenever the server machine starts. This section will review the ways that this can be done. Of course this is typically done by the system administrator; the information here is something that can be used to adapt to the conventions of your own system. The instructions are different for Unix and Windows. These instructions will focus on launching Tomcat; if you use some other servlet container, you will need to consult its documentation.

Unix

Tomcat can be launched automatically by adding it to a system startup script. The description here is typical of a Linux RedHat system. It is a good idea to first study the instructions for setting up Tomcat on Unix.
A common way to launch is to add a script to the initialization directory init.d and making a link to the appropriate startup directory (for example rc3.d). The script will make definitions for starting and stopping Tomcat, making use of the tomcat user that was created. A sample script is shown below.
In addition, if you are using a virtual X server, such as Xvnc, you will need to launch this at system initialization time. A sample script for launching Xvnc is shown below.

Windows

The way to run programs automatically on Windows is to install them as a service.
Installing Tomcat as a service on Windows is quite easy, since the installer will give you the option of installing it as a service. If you did not choose this as an option when you first installed Tomcat, you can rerun the installer.
You can get extra information about the services you have installed by going to the Administrative Tools icon of the Control Panel. Here you will see a Services icon which you can open. The Services dialog that opens will show the services that have been installed on your machine. You should see one for Tomcat. The dialog will tell you if the service has started or not and will tell you how it is launched. Typically the installer makes it an Automatic startup type that causes it to launch when the computer is booted. Clicking the Tomcat entry and selecting Properties will give you a dialog, that allows you to configure the service.
Running Tomcat as a service works well if the JDK is 1.4. The JDK is found by searching for java.exe on the Windows path, so you need to make sure that the JDK you installed earlier is found.

Web Server Connections

In some configurations, the main accessible server is a regular web server such as the Apache HTTP server, the Microsoft Internet Information Server, or the Netscape Enterprise Server. It is possible to use such a server in conjunction with a servlet container. This type of configuration is more complicated, but can take advantage of many additional features, for example, authentication and URL rewriting, and is often suitable for an existing web infrastructure. This section gives a brief description of configuration for some typical arrangements. It is probably useful to configure your servlet container to work in a standalone mode before starting any of this work.
If you wish to use webMathematica in conjunction with a separate web server, you will need to make sure that all requests to webMathematica are forwarded to the webMathematica web application. This will make sure that requests for applet archives, HTML pages, and images are properly processed. If the server is only set to allow access to servlets, then these other resources will not be accessible.
If you just wish to test webMathematica running directly through a servlet container such as Tomcat, you may skip this section.

Apache and Tomcat

There are a number of ways for the Apache web server to communicate with Tomcat. One convenient way is to use an HTTP forwarding mechanism to send requests from the Apache web server to Tomcat. This can be arranged with the ProxyPass configuration directive. A sample configuration, that could be added to the Apache configuration file (typically called httpd.conf), is shown below.
The ProxyPass directive provides a mapping from a path to an external URL, and the ProxyPassReverse directive causes the responses to be modified so that the proxy is transparent. Any access to /webMathematica will be sent to port 8080 on the machine tomcatserver. The configuration also denies access to the kernel monitor via the proxy. The features of the kernel monitor are described in a later section.
For the ProxyPass directive to be effective, the modules mod_proxy and mod_proxy_http must be loaded, this can be done with the following configuration information in the Apache configuration file.
For more information on using Apache and Tomcat, you should consult the websites for Apache, http://httpd.apache.org, and Tomcat, http://jakarta.apache.org. Note that you can run Apache on both Windows and Unix machines, as well as Mac OS X machines. Another useful website is http://www.galatea.com/flashguides/apache-tomcat-4-win32.xml.

Microsoft Servers and Tomcat

If you wish to deploy Microsoft PWS or IIS as your web server, it is possible to use them with Tomcat as a servlet container.
Tomcat comes with instructions for configuring it as a servlet container for IIS and PWS. The configuration has to be done manually, and, although straightforward, it has a number of steps that must be followed carefully and involves editing the Windows registry by hand.
You need to make sure that you edit the workers.properties file, found in the Tomcat conf directory, to give values to workers.tomcat_home and workers.java_home. The required settings will be clear from the description in the file.