Revision: 1.12
Date: 2002/11/01
Latest Version: http://spacemapper.sf.net/mn8/instalation.html
Editor: Remus Pereni <remus@nolimits.ro>

Back to: Overview

MN8 Instalation Notes

Table of Contents
1. Requirements
2. Installing MN8
3. Running MN8
4. Installing MN8 in a servlet container
    4.1. Tomcat 3.3.x
    4.2. Tomcat 4.0.x
    4.3. Configuring the MN8 servlet runner


1. Requirements

MN8 requires Java runtime environment (JRE) version 1.3. or higher (not tested with 1.4 yet) and the Java Developer Kit (J2SDK) for building MN8 from sources.

Depending on your operating system there might be multiple flavors of Java:

top

2. Installing MN8

  1. Unpack the archive in the desired directory, this directory will become the MN8 home directory
  2. Edit in the MN8 home directory the mn8config.xml file from the config subdirectory and adjust any of your preferences
  3. Edit the mn8.sh or mn8.bat file and set up the correct paths to your Java home and MN8 home

Windows 95, 98, Me users will have to increase the environment memory allocated for the mn8.bat file to at least 2048.

This can be done following the next procedure: select the mn8.bat file, right-click then properties, and select the memory tab. Increase the value from the Environment memory to 2048.

top

3. Running MN8

Just invoke mn8.sh under Unix flavors (Solaris, Linux, Mac OS X) or mn8.bat under Windows

top

4. Installing MN8 in a servlet container

4.1. Tomcat 3.3.x

Version 3.3.1 is the current production quality release. It continues the refactoring that was begun in version 3.2 and carries it to its logical conclusion. Version 3.3 provides a much more modular design and many performance improvements. It implements the Servlet 2.2 (the minimum required by MN8) and JSP 1.1 specifications.

Assuming that you already have Tomcat installed in a directory TOMCAT_HOME, you have to copy the webapps directory from the MN8_HOME/extras/servlet/tomcat/3.x/ directory to TOMCAT_HOME.

Copy all the jar files from the MN8_HOME/lib directory to TOMCAT_HOME/webapps/mn8/WEB_INF/lib directory.

Copy in the same directory the mn8-xx.jar from MN8_HOME.

If everything is right, after restarting the Tomcat server, by pointing your browser to: http://localhost:8080/mn8/ you should be able to run your MN8 scripts inside a web server.

For more Tomcat configuration options or how to integrate it with other web servers please consult the Tomcat documentation.

top

4.2. Tomcat 4.0.x

Version 4.0.3 is the current production quality release. Tomcat 4.0 is the next generation of Tomcat. The 4.0 servlet container (Catalina) has been developed from the ground up for flexibility and performance. Version 4.0 implements the final released versions of the Servlet 2.3 and JSP 1.2 specifications. As required by the specifications, Tomcat 4.0 also supports web applications built for the Servlet 2.2 and JSP 1.1 specifications with no changes.

Assuming that you already have Tomcat installed in a directory TOMCAT_HOME, you have to copy the webapps directory from the MN8_HOME/extras/servlet/tomcat/4.x/ directory to TOMCAT_HOME.

Copy all the jar files from the MN8_HOME/lib directory to TOMCAT_HOME/webapps/mn8/WEB_INF/lib directory.

Copy in the same directory the mn8-xx.jar from MN8_HOME.

If everything is right, after restarting the Tomcat server, by pointing your browser to: http://localhost:8080/mn8/ you should be able to run your MN8 scripts inside a web server.

For more Tomcat configuration options or how to integrate it with other web servers please consult the Tomcat documentation.

top

4.3. Configuring the MN8 servlet runner

The behavior of the MN8 based servlets can be tuned with the following configuration files:

  1. WEB_INF/web.xml Configuration file for the mn8Runner servlet. Here you can set the initial parameters of the servlet, parameters like the debug or verbose mode, the location of the MapInfo file and so on.
  2. WEB_INF/classes/conf/mn8config.xml Configuration file for the MN8 interpreter. Here you can specify, for instance, the concept paths MN8 should take in consideration.
  3. WEB_INF/mn8MapInfo.xml. Configuration file for mapping diverse URL's to concepts.

When a request is received on the context mn8Runner is mapped, it will first try to see if there is such a file available. If there is and has an extension of mn8 it will get interpreted and the result returned to the user.

If non of the above conditions are meet the runner will try to see if there are mapping informations available (mn8MapInfo.xml). A map entry associates a regular expression with a concept and a couple of parameters. Here is how a mn8MapInfo.xml file looks.

    <?xml version="1.0"?>
    <map.info>  
        <map>
            <path>.*\..*</path>
            <concept name="_SYSTEM_"/>
        </map>
        <map>
            <path>.*/</path>
            <concept name="FSViewerServlet">
                <parameters>
                    <param>{$catalina.base}/webapps/mn8/dirStyle.xsl</param>
                </parameters>
            </concept>
        </map>
    </map.info>
     
    

As you can see every request which ends in / (a directory) it is automatically mapped to the FSViewerServlet concept with one additional parameter, a file URL to a file the concept requires.

Any request is mapped to the main method of the concept with the ServletRequest as the first parameter, ServletResponse as the second, and if there are any additional parameters available in the map entry will be passed along to the main method.

A concept can be mapped using the concept name as in the example above, in which case the concepts should be situated in the concept path or by path. In the above case this would look like:

    <?xml version="1.0"?>
    <map.info>  
        <map>
            <path>.*\..*</path>
            <concept name="_SYSTEM_"/>
        </map>
        <map>
            <path>.*/</path>
            <concept path="/usr/mn8/scripts/FSViewerServlet.mn8">
                <parameters>
                    <param>{$catalina.base}/webapps/mn8/dirStyle.xsl</param>
                </parameters>
            </concept>
        </map>
    </map.info>
     
    

In example the one concept name is _SYSTEM_ . This will inform the servlet runner that if a request is received which match the respective path, if it is a file it will be served without any intervention.

The order of the map entries is important. If the servlet runner is not able to find an exact mn8 script file request it will try to get a match for the request walking the map info file from top to the bottom.

top


© 2001