Installing webMathematica (Mac OS X)

These steps have been tested with the following software:

- OS X Tiger (10.4.9)
- Mathematica 6.0
- webMathematica 2.3
- Apache Tomcat 5.5.23

Newer versions of OS X and these applications should work, but some steps may vary slightly.

Install Mathematica

  1. Use the CSUS-provided Mathematica disc (or download) and license key
  2. Drag "Mathematica" from installation disc (or disk image) to Applications folder
  3. Launch Mathematica
    • Organization Name: California State University at Sacramento
    • License key: XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXX

Download latest Tomcat

http://www.apache.org/dist/tomcat/tomcat-5/v5.5.23/bin/apache-tomcat-5.5.23.tar.gz


Install Tomcat

All commands executed in Terminal.app (/Applications/Utilities/)

  1. Check to see if /usr/local exists
    ls -d /usr/local
  2. If it's not there, create it
    sudo mkdir /usr/local
  3. Copy the Tomcat installation package to /usr/local
    sudo cp apache-tomcat-5.5.23.tar.gz /usr/local
  4. Move to /usr/local
    cd /usr/local
  5. Unpack the installation package
    sudo tar xvzf apache-tomcat-5.5.23.tar.gz
  6. Remove the installation package
    sudo rm apache-tomcat-5.5.23.tar.gz
  7. Create a symbolic link
    sudo ln -s apache-tomcat-5.5.23 tomcat
  8. Change ownership of tomcat directory
    sudo chown -R nobody:nobody tomcat
  9. Start Tomcat
    sudo /usr/local/tomcat/bin/startup.sh
  10. Test Tomcat - open browser and point to: http://localhost:8080

Install webMathematica

  1. Copy webMathematica.zip from the webMathematica CD to your hard disk (I put mine on the Desktop)
  2. Move to Desktop
    cd ~/Desktop
  3. Unpack webMathematica files
    unzip webMathematica.zip
  4. Copy webMathematica directory to Tomcat's webapps directory
    sudo cp -r webMathematica /usr/local/tomcat/webapps
  5. Update webMathematica configuration file MSP.conf (change "Mathematica 5.2.app" reference to "Mathematica.app" in the first line beginning with MathLinkArguments.MacOSX)
    sudo vi /usr/local/tomcat/webapps/webMathematica/WEB-INF/conf/MSP.conf
  6. Test webMathematica at http://localhost:8080/webMathematica/
  7. If you get any Java errors, restart Tomcat
    sudo /usr/local/tomcat/bin/shutdown.sh
    sudo /usr/local/tomcat/bin/startup.sh


Install StartupItem (optional, but helpful)

  1. Create the StartupItems directory
    sudo mkdir /Library/StartupItems/Tomcat
  2. Using a text editor, create /Library/StartupItems/Tomcat/Tomcat
    sudo vi /Library/StartupItems/Tomcat/Tomcat

    Add the following contents to /Library/StartupItems/Tomcat/Tomcat
  3. Create /Library/StartupItems/Tomcat/StartupParameters.plist
    sudo vi /Library/StartupItems/Tomcat/StartupParameters.plist

    Add the following to /Library/StartupItems/Tomcat/StartupParameters.plist
  4. Adjust the permissions for StartupItem contents
    sudo chmod 755 /Library/StartupItems/Tomcat
    sudo chmod 711 /Library/StartupItems/Tomcat/Tomcat
    sudo chmod 644 /Library/StartupItems/Tomcat/StartupParameters.plist
  5. Edit /etc/hostconfig and paste TOMCAT=-YES- at end of file
    sudo vi /etc/hostconfig
  6. Restart the computer and confirm that Tomcat is still running at http://localhost:8080

Uninstalling Tomcat

If you need to uninstall Tomcat, run the following:
sudo /usr/local/tomcat/bin/shutdown.sh
sudo rm -r /usr/local/apache-tomcat-5.5.23
sudo rm /usr/local/tomcat
sudo rm -r /Library/StartupItems/Tomcat

Note that this will also remove the webMathematica files from your computer, so backup /usr/local/tomcat/webapps/webMathematica before running the commands above.

-DMM