webMathematica >

Setting Up a Servlet Container

There are many different servlet containers, but one that is particularly convenient is Tomcat, which can be obtained from http://jakarta.apache.org. Since Tomcat is a common way to run webMathematica, there is information on installing and setting it up on Unix, Windows, and Mac OS X.
webMathematica has been tested with Tomcat as well as other containers listed at http://www.wolfram.com/products/webmathematica/technology/. If you have a particular interest or experience in running webMathematica with other containers, please contact Wolfram Research. However, if you do not have expertise with these other containers, using Apache Tomcat is recommended.

Setting Up Java

It is recommended that you use a modern version of Java, such as Java SE 6. For Linux, Linux x64, Solaris SPARC, Solaris x64, Solaris x86, Windows, and Windows x64, this is available from the Sun Java site at http://java.sun.com/javase/downloads/index.jsp. The Sun Java site provides detailed installation instructions for the different platforms. These are all relatively simple; typically, you download and execute an installer. If you are using Java SE 5 or higher, you can use either a JRE or JDK to run webMathematica. If you are using an older version of Java, you need the JDK. For Mac OS X, J2SE 5.0 is already installed. For other platforms, modern versions of Java are available from the appropriate vendors; a list of useful links is maintained in the Appendix: Java.

Unix

Windows

Mac OS X

Mac OS X 10.5 ships with J2SE 5.0 and Java SE 6. Mac OS X 10.4 ships with J2SE 5.0. You may find that an updated version can be obtained via the software update mechanism (see also http://www.apple.com/java/). If you update your Java, you can ensure that you are always using the most recent version of the JDK by setting up the JAVA_HOME environment variable properly; this is shown below.
JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Home
export JAVA_HOME

Setting Up Tomcat

Unix

Download information for current versions of Tomcat is given at http://www.wolfram.com/products/webmathematica/resources/?tab=Updates. A variety of archive formats are available; one of these should be unpacked in some central location, for example /usr/local. You may also wish to change the name of the top-level directory. The actual location of Tomcat and the name of the top-level directory are entirely up to you. Sample shell instructions for these steps are shown below (note that tar xvfz archive will give you more information on what files are being extracted). Other versions of Tomcat are available from the Apache website, http://jakarta.apache.org.
At this point, you should be able to connect to Tomcat via a URL such as http://localhost:8080. If this does not return the Tomcat front page, then something is wrong with your setup. If you look at the log files, it may help you track down your problem. Make sure that you have set your JAVA_HOME variable as described in the installing Java for Unix section.

Windows

Download information for current versions of Tomcat is given at http://www.wolfram.com/products/webmathematica/resources/?tab=Updates. A convenient way to install Tomcat is to download the self-installing executable. You should launch the installer and follow the instructions it provides. If you choose not to use the self-installing executable, then unpack the binary distribution into a convenient location. Other versions of Tomcat are available from the Apache website, http://jakarta.apache.org.
The installer adds a Start Menu Group from which you can run Tomcat. You should test it via a URL such as http://localhost:8080. If Tomcat does not run correctly, you should open a command prompt window, change directories ("cd") to the bin directory (in the main top-level directory of Tomcat) and try running the tomcat5.exe executable file (this can also be accomplished by double-clicking on the file via the Windows Explorer). Previous versions of Tomcat used a startup.bat batch file. Starting and stopping Tomcat from the Start Menu is very convenient (this is also a new feature of Tomcat 4.1), but for running Tomcat as a production server under Windows you may wish to run it as a Windows Service. This is described in the section on launching Tomcat automatically on Windows.

Mac OS X

[server1]$ sudo chown -R tomcat tomcat
tomcat
bin
conf
logs
webapps
[server1]$ su Tomcat
[server1]$ cd Tomcat/bin
[server1]$ ./startup.sh
At this point, you should be able to connect to Tomcat via a URL such as http://localhost:8080. If this does not return the Tomcat front page, then something is wrong with your setup. If you look at the log files, it may help you track down your problem. Make sure that you have set your JAVA_HOME variable as described in the installing Java for Mac OS X section.
Download information for current versions of Tomcat is given at http://www.wolfram.com/products/webmathematica/resources/?tab=Updates. A variety of archive formats are available; one of these should be unpacked in some central location, for example, /Library. You may also wish to change the name of the top-level Tomcat directory. The actual location of Tomcat and the name of the top-level directory are entirely up to you. /Library is useful because it can be viewed via the Finder. Other versions of Tomcat are available from the Apache website, http://jakarta.apache.org.
[server1]$ cd /Library
[server1]$ sudo /usr/bin/gnutar xfz jakarta-tomcat-5.5.27.tar.gz
[server1]$ sudo mv jakarta-tomcat-5.5.27 tomcat