Share

Configuring Tomcat

Product Documentation

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/autodeskinfrastructuremapserver2013/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:

  • Prefix /webserverextensions/apache2/conf/mapserver.conf

    Additional directives for configuring mod_jk are added in a #Tomcat Integration section at the end of the file.

  • Prefix /webserverextensions/apache2/conf/workers.properties

    This new configuration file is added for Tomcat integration.

  • Prefix /webserverextensions/tomcat/server.xml

    Additional directives to enable UTF-8 encoding of URLs are added to the default server.xml file.

  • Prefix /webserverextensions/tomcat/conf/Catalina/localhost/mapserver.xml

    This new Tomcat context file for Infrastructure Map Server points Tomcat to the www directory.

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

  • export LD_LIBRARY_PATH= Prefix /webserverextensions/lib: Prefix /lib
  • export JAVA_OPTS="-Djava.library.path=$LD_LIBRARY_PATH"

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

  • Edit apache2/mapserver.conf. Remove or comment out the following lines:
    AliasMatch ^/mapserver2013/mapviewerajax/([^\?])(.*)$ 
       "/opt/Autodesk/infrastructuremapserver2013/www/
       mapviewerphp/\$1\$2"
    AliasMatch ^/mapserver2013/mapviewerajax/(.*)$ 
       "/opt/Autodesk/infrastructuremapserver2013/www/
       mapviewerphp/ajaxviewer.php\$1"
    AliasMatch ^/mapserver2013/mapviewerdwf/([^\?])(.*)$ 
       "/opt/Autodesk/infrastructuremapserver2013/www/
       mapviewerphp/\$1\$2"
    AliasMatch ^/mapserver2013/mapviewerdwf/(.*)$ 
       "/opt/Autodesk/infrastructuremapserver2013/www/
       mapviewerphp/dwfviewer.php\$1"
    

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 /mapserver2013/mapviewerajax/ 
       http://[machine name or IP]:8008/mapserver2013/mapviewerjava/
       ajaxviewer.jsp
    Redirect /mapserver2013/mapviewerdwf/ 
       http://[machine name or IP]:8008/mapserver2013/mapviewerjava/
       dwfviewer.jsp
    

To start Tomcat

  1. Change to the following directory:

    /opt/Autodesk/autodeskinfrastructuremapserver2013/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:8008

    You should see the Tomcat welcome page.

    http://localhost:8008/mapserver2013/mapviewerjava/fake.jsp

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

    http://localhost:8008/mapserver2013/mapviewerjava/bufferui.jsp

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

    http://localhost:8008/mapserver2013/mapviewerajax/bufferui.jsp

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


Was this information helpful?