Configuring Tomcat

If you install Tomcat, the installation procedure places Tomcat and its supporting files.

If you used the --prefix=Prefix option with the build_apt.sh command, the files are installed in

Prefix /webserverextensions/tomcat

If you plan to use JSP for application development, you must install the Java JDK, 5.0 or higher. The installation files are available from http://java.sun.com/j2se/1.5.0/download.jsp.

Set the environment variable JAVA_HOME to the location of your Java installation. For the JDK 5.0, update 6, this is

/usr/java/jdk1.5.0_06/

If you have a different version of the JDK, it will be installed in a different location.

The installation procedure installs and configures Tomcat for serving Java Server Pages. The Tomcat files are installed in

/opt/Autodesk/autodeskinfrastructuremapserver2015/webserverextensions/tomcat

Tomcat is attached to Apache using mod_jk. For additional reference material, see

http://tomcat.apache.org/connectors-doc/generic_howto/quick.html

mod_jk is built from source as part of build_apt.sh and installed to the apache/modules directory.

mod_jk is installed to the webserverextensions/apache2/modules directory.

The following files are created and/or modified by build_apt.sh:

In addition to these files, the following environment variables are added before Tomcat is started:

Before starting Tomcat

  1. Disable the Apache aliases to mapviewerajax and mapviewerdwf for the PHP Viewer.
  2. Set up redirection for mapviewerajax and mapviewerdwf for the Java Viewer.

To disable the PHP aliases for mapviewerajax and mapviewerdwf

To set up the redirection for the Java Viewer

  1. Edit apache2/mapserver-tomcat.conf.
  2. Add the following to the end of the file.

    Note that each Redirect directive must be on one line in the file. Replace [machine name or IP] with the DNS name or IP address of the web server. Using localhost will not work.

    Redirect /mapserver2015/mapviewerajax/ 
       http://[machine name or IP]:8088/mapserver2015/mapviewerjava/
       ajaxviewer.jsp
    Redirect /mapserver2015/mapviewerdwf/ 
       http://[machine name or IP]:8088/mapserver2015/mapviewerjava/
       dwfviewer.jsp
    

To start Tomcat

  1. Change to the following directory:

    /opt/Autodesk/autodeskinfrastructuremapserver2015/webserverextensions/tomcat/bin/

  2. At the command prompt, type

    ./startup.sh

  3. To check if Tomcat has been installed successfully, test the following URLs:

    http://localhost:8088

    You should see the Tomcat welcome page.

    http://localhost:8088/mapserver2015/mapviewerjava/fake.jsp

    This tests that Apache/Tomcat integration is working. It should return a Tomcat 404 error.

    http://localhost:8088/mapserver2015/mapviewerjava/bufferui.jsp

    This tests that Java Web Extensions are working. It should display an HTML page titled “Create a Buffer”.

    http://localhost:8088/mapserver2015/mapviewerajax/bufferui.jsp

    This verifies that the redirect works properly. It should display the “Create a Buffer” page.