Altair EEvision™

Home

Installation with CGI


Altair EEvision needs to be installed on the Web Server only, no client-side installation is required. The EEvision GUI runs in any today's modern Web Browser (see listing). EEvision is available as a CGI-based extension to an existing Web Server (explained in this document) or as a standalone executable that includes a simple HTTP-Server by itself. EEvision CGI needs certain configurations of the Web Server to interact with EEvision.

Altair EEvision for CGI-based Web Server (compare with Standalone)

The EEvision software is delivered as a .zip or .tgz (tar ball) and after unpacking, the contents of its "web" directory is intended to be copied somewhere below the Web Server's document_root. Here, we use the keyword eevhome to refer to this installation directory. This directory serves the start URL for the EEvision GUI. Directly below that the EEvision GUI uses the data URL to access input data files and the srv/proxy.cgi URL for AJAX requests to provide interactive response. Here is an overview of these URLs and their corresponding physical locations in the Web Server's file system.

URLdesc.physical file/directory
https://server/eevhome/ the start URL /document_root/eevhome/
https://server/eevhome/eev.conf the GUI config /document_root/eevhome/eev.conf
https://server/eevhome/main.html the main GUI /document_root/eevhome/main.html
https://server/eevhome/srv/proxy.cgi CGI-program /document_root/eevhome/srv/proxy.cgi
https://server/eevhome/srv/upload.cgi CGI-program /document_root/eevhome/srv/upload.cgi
https://server/eevhome/srv/json.cgi CGI-program /document_root/eevhome/srv/json.cgi
https://server/eevhome/srv/debug.cgi CGI-program /document_root/eevhome/srv/debug.cgi
https://server/eevhome/srv/cleanup.cgi CGI-program /document_root/eevhome/srv/cleanup.cgi
https://server/eevhome/data/ Input Data /document_root/eevhome/data/ (EEV_DATA)
https://server/eevhome/doc/ documentation /document_root/eevhome/doc/

If the EEvision GUI is stated with an EDB file, e.g. with the URL "eevhome/main.html?edb=designdir/d.edb" or if a JSON request is started from an EDB file, like "eevhome/srv/json.cgi?edb=designdir/d.edb", then the EDB file, plus optional SVG image files, plus an optional eev.conf are read from these locations:

URLdesc.physical file/directory
https://server/eevhome/data/designdir/d.edb the EDB file /document_root/eevhome/data/designdir/d.edb
https://server/eevhome/data/designdir/*.svg Image files /document_root/eevhome/data/designdir/*.svg
https://server/eevhome/data/designdir/eev.conf 2nd config /document_root/eevhome/data/designdir/eev.conf

EEvision is proven to run under Apache, Tomcat and Jetty, but should run under any Web Server that provides a CGI interface. All configuration examples in this document below refer to Apache 2.4. The easiest installation is to keep the directory structure as it is and stay in sync with the URL structure. The software package includes "htaccess.sample" (at /document_root/eevhome/ and /document_root/eevhome/srv/) that stores Apache configuration rules that are required or useful to run on an Apache Web Server. For Web Servers other than Apache these configuration rules need to be translated. Please find the contents from the "htaccess.sample" in the gray boxes below.

Requirements for the Web Server configuration, (see Tomcat and Jetty configuration)

CGI-Programs in "srv"
<Files *.cgi>
    SetHandler cgi-script
    Options +ExecCGI
</Files>
The CGI-Programs are by default located in the srv directory. This is required to define the .cgi files there as CGI-Programs to be executed instead of delivered (when requested by a HTTP GET or POST). For Apache, the gray box on the right side in srv/.htaccess will do this.
<Files *.so>
    Require all denied
</Files>
<Files *.tcl>
    Require all denied
</Files>
<Files "guard">
    Require all denied
</Files>
<Files "license.dat">
    Require all denied
</Files>
Options -Indexes
For data protection (optional), the Web Server should not deliver any contents from the CGI directory. For Apache, the gray box on the right side in srv/.htaccess will avoid this.
Set env variable ALTAIR_LICENSE_PATH (for Altair License only)
SetEnv ALTAIR_LICENSE_PATH 6200@serverName
The environment variable ALTAIR_LICENSE_PATH can be set, in order to identify the license server (only if the Altair License Manager is used). For Apache, the "SetEnv" in the gray box in srv/.htaccess will set this variable. If this variable is not defined, then EEvision will check default locations for ALTAIR_LICENSE_PATH.
Set env variable LM_LICENSE_FILE (for FlexNet only)
SetEnv LM_LICENSE_FILE 1700@serverName
The environment variable LM_LICENSE_FILE can be set, in order to identify the license server (only if the FlexNet license checker is used). For Apache, the "SetEnv" in the gray box in srv/.htaccess will set this variable. If this variable is not defined, then EEvision will check default locations for LM_LICENSE_FILE to find a license.dat file.
Data Transfer Compression (optional)
Depending on the environment, compressing the transferred data may speedup the start-up and response time of EEvision (but may slow down on other environments). Here is a table that shows all mime types used by EEvision. The column "compress" is checked if we suggest compression on wide area networks.
file name
extension
mime type default
compress
.html text/html
.css text/css
.js application/javascript
.svg image/svg+xml
.png image/png
.gif image/gif
.wasm application/wasm
.json application/json
.conf application/json
.sym .nlv text/x-nlv
CGI Programs
responses
text/plain
application/json

Most of those mime types already map to the file name extensions by default on most Web Servers (checked in the "default" column) and if so, they don't need to be additionally declared. For Apache, please check the htaccess.sample in the main directory for the correct Apache syntax.

Browser Caching: no ETag
<IfModule mod_headers.c>
    Header unset ETag
</IfModule>
Most Web Servers automatically support Browser Caching in various ways. However, Apache cannot provide both, ETag caching and Compression for the same resource. To keep Compression working, you MUST switch off ETags on Apache Servers, as shown in the gray box on the right side - to be put into the .htaccess file in the main directory. Please make sure, that your Apache server has the module "mod_headers" actually installed and activated. Alternatively, the "DeflateAlterETag Remove" should also work, if put into the Apache main configuration file. With disabled ETags, Apache will reliably provide the "Last-Modified" caching, based on Browser's "If-Modified-Since" requests.
Browser Caching (optional)
<IfModule mod_headers.c>
    Header always set Cache-Control \
        "must-revalidate, max-age=15"
</IfModule>
This "Cache-Control" header line will advice the receiving Browsers to re-validate each cached resource before using it, except within 15 seconds after the previous load of the resource. So the Browser should do "blind caching" for 15 seconds only, but after that it should validate each resource by sending a "If-Modified-Since" requests. For Apache, the gray box on the right side - to be put into .htaccess - will define this caching behavior.
Browser CORS (optional)
<IfModule mod_headers.c>
    Header always set \
        Access-Control-Allow-Origin "*"
</IfModule>
This "Access-Control-Allow-Origin" header line will advice the receiving Browsers to allow cross-origin resource sharing. For Apache, the gray box on the right side - to be put into .htaccess - will define this behavior.
Start Page (optional)
<IfModule mod_dir.c>
    DirectoryIndex fileselect.html
</IfModule>
If you want to make a certain html file your start page, you can define that to Apache as shown in the box on the right side - to be put into .htaccess in that directory. If so, Apache will deliver the fileselect.html (a simple file selection page) on the start URL https://server/eevhome.
HTTP Authentication (optional)
AuthType Basic
AuthName "Download Authentication"
AuthUserFile /var/www/https/.htpasswd
Require valid-user 
Most Web Servers provide HTTP (or better HTTPS) authentication, that can be used to limit the usage of EEvision to certain users. For Apache, the box on the right side (to be put into .htaccess) enables Apache's built-in mechanism for basic HTTP authentication (based on a password file).

CGI-programs located in a dedicated directory

If the CGI-Programs are required to be located in a directory different to "/document_root/eevhome/srv", say e.g. in "/var/www/cgi-bin", then all content of the srv directory must be moved to /var/www/cgi-bin (including srv/.htaccess on Apache). These URLs must correspond to physical locations as shown in the table below:

URLdesc.physical file/directory
https://server/eevhome/srv/proxy.cgi CGI-program /var/www/cgi-bin/proxy.cgi
https://server/eevhome/srv/upload.cgi CGI-program /var/www/cgi-bin/upload.cgi
https://server/eevhome/srv/json.cgi CGI-program /var/www/cgi-bin/json.cgi
https://server/eevhome/srv/debug.cgi CGI-program /var/www/cgi-bin/debug.cgi
https://server/eevhome/srv/cleanup.cgi CGI-program /var/www/cgi-bin/cleanup.cgi
Alias for CGI programs
ScriptAlias /eevhome/srv/  "/var/www/cgi-bin/"
<Directory "/var/www/cgi-bin">
    SetEnv EEV_DATA /document_root/eevhome/data/
    ....
</Directory>
Apache needs a "ScriptAlias" for this as shown in the box on the right side (to be put into the Apache main configuration file). Additionally, the environment variable EEV_DATA must be added to define the location of the input data (dataRoot) for the CGI-programs. Alternatively, the SetEnv EEV_DATA ... can be added to the /var/www/cgi-bin/.htaccess".

Input Data (dataRoot) in a dedicated directory

If the Input Data (EDB files, SVG images, etc) is required to be located in a directory different to "/document_root/eevhome/data", say e.g. in "/extra/data", then the URLs below "data" must correspond to that physical location as shown in the table below:

URLdesc.physical file/directory
https://server/eevhome/data/ EDB files et al /extra/data/
https://server/eevhome/data/proj1/dn.edb EDB files et al /extra/data/proj1/dn.edb
Alias for dataRoot
Alias /eevhome/data/ "/extra/data/"
<Directory "/extra/data">
    Require all granted
</Directory>
Apache needs an "Alias" for this as shown in the box on the right side (to be put into the Apache main configuration file). Apache usually needs access rights explicitly specified by the "Require" keyword as shown in the gray box.
Additionally, the environment variable EEV_DATA must be added to define the location of the input data (dataRoot) for the CGI-programs.
<Directory "/document_root/eevhome/srv">
    SetEnv EEV_DATA  /extra/data/
</Directory>
If the CGI programs are still located in the default srv directory, then the gray box on the right side (to be put into the Apache main configuration file) defines the EEV_DATA relative to that srv directory. Alternatively, the SetEnv EEV_DATA ... can be added to the srv/.htaccess.
<Directory "/var/www/cgi-bin">
    SetEnv EEV_DATA  /extra/data/
</Directory>
If the CGI programs are located in the /var/www/cgi-bin directory, then the gray box on the right side (to be put into the Apache main configuration file) defines the EEV_DATA relative to that directory. Alternatively, the SetEnv EEV_DATA ... can be added to the /var/www/cgi-bin/.htaccess".

Temp Directory

EEvision may need a directory to store temporary internal data, which is defined by the EEV_TEMPDIR environment variable. If EEV_TEMPDIR is undefined, then on UNIX "/tmp" and on Windows Temp or TMP or "C:/tmp" is used; this directory should exist with write permissions for the service process.

Logging

On Unix environments, EEvision uses syslog facility "local0" to print notices, warnings and other messages. Please consult the Unix systems /etc/syslog.conf or /etc/rsyslog.conf how to configure them. The environment variable EEV_SYSLOG can be set to ERR, WARNING, NOTICE, INFO or DEBUG, to control the severity level of the logging. The default is NOTICE. For compatibility, the numbers 3, 4, 5, 6 or 7 can be used respectively. The EEV_SYSLOG variable must be set for the CGI-program analogous to the EEV_DATA variable.

On Windows environments, EEvision logs to a file defined by the EEV_LOGFILE environment variable - or to "eev.log" in the CGI directory, if EEV_LOGFILE is not defined. The environment variable EEV_SYSLOG is also supported on Windows to control the severity of the logging (which actually defines the verbosity).

Overview on environment variables

These environment variables should be set for the CGI programs, on Apache in the srv/.htaccess file (see srv/htaccess.sample in the release package). Non-ASCII characters won't work on Windows (but may work on UNIX if UTF-8 encoded).

Environment
Variable
Default
on UNIX
Default
on Windows
Description
EEV_DATA ../data../data The location of the input data (dataRoot directory) - absolute, or relative to the location of the CGI programs.
EEV_TEMPDIR /tmpTemp or TMP or C:/tmp The location of a writable directory for temporary files. The Temp and TMP refer to environment variables.
EEV_SYSLOG NOTICENOTICE The severity level of the logging.
EEV_LOGFILE eev.log The name of the log file.
EDB_PASSWD The optional password for the EDB file. If the EDB file is encrypted, then a password is needed to decrypt and read the EDB file.
LM_LICENSE_FILE exedir/license.dat:
exedir/../license.dat:
/usr/local/flexlm/license.dat
exedir/license.dat;
exedir/../license.dat;
C:/flexlm/license.dat
Only if the FlexNet license checker is used: The location paths for the license.dat. The colon or semicolon separates the file names that are executed from left to right.
ALTAIR_LICENSE_PATH 6200@localhost 6200@localhost Only if the Altair License checker is used: The location path to the Altair License Manager - or to the Altair license.dat. The colon or semicolon separates the entries that are executed from left to right.
Notes for LM_LICENSE_FILE:
In the table above, the "default" values apply in addition to LM_LICENSE_FILE. The exedir stands for the directory of the executable, which is "/document_root/eevhome/srv". This means, after checking the locations in the environment variables LM_LICENSE_FILE (and DCONCEPT_LICENSE_FILE), EEvision will also check for /document_root/eevhome/srv/license.dat, then for /document_root/eevhome/license.dat, and finally for /usr/local/flexlm/license.dat (on UNIX) or for C:/flexlm/license.dat (on Windows).

Debug the Installation

Environment:
        EEV_DATA
        EEV_TEMPDIR
        EEV_SYSLOG   = 7
        EEV_LOGFILE
        EDB_PASSWD
        LM_LICENSE_FILE
getcwd()          --> /var/www/html/eevision/srv
GetDataRoot()     --> ../data
SyslogPrio()      --> 7=DEBUG
GetTempDir()      --> /tmp
MakeTempDir('D')  --> /tmp/eev.DKndjWT []
MakeTempFile('F') --> /tmp/eev.FNAxSrx []
                      [Sun, 06 Oct 2019 21:14:37 GMT]
tmpfile()         --> OK

a HTML GET request to /eevhome/srv/debug.cgi displays the relevant environment variables with values and performs some checks and displays their results (in plain/text), as e.g. in the gray box on the right.

Cleanup Temp Files

Reading temp directory /tmp
Statistics:
      6 files/dirs older than  0 weeks
     48 files/dirs older than  1 weeks
    357 files/dirs older than  2 weeks
     35 files/dirs from other programs

a HTML GET request to /eevhome/srv/cleanup.cgi displays some hints about temp files and temp directories created by EEvision on the Web Server. These hints are displayed (in plain/text), as e.g. in the gray box on the right. If this Cleanup program is invoked with a parameter "weeks", then all EEvision temp files or directories older than the given number of weeks are deleted. E.g. /eevhome/srv/cleanup.cgi?weeks=2 will delete the 357 files/dirs older than 2 weeks.


Architecture

Each Browser tab that loads the EEvision main GUI from "https://server/eevhome/main.html" also starts a "guard" process on the Web Server. The life-time of the "guard" process is bound to the life-time of the main.html page in the Browser. This is also the life-time of the interactive session. Such a session is bound to one dedicated EDB file (that defines the borders for interactive exploration within such session). The small and lightweight CGI-program proxy.cgi creates and terminates the "guard" process and performs all communication to it via AJAX POST requests to https://server/eevhome/srv/proxy.cgi.

[Architecture]

Altair License checker

The new EEvision packages come with Altair License Units. They require an Altair License Manager to run; please check out the corresponding Altair License documentation. The "guard" process in the srv directory usually needs the environment variable ALTAIR_LICENSE_PATH pointing to the Altair License Server. Each interactive EEvision session requires Altair License Units for the life-time of the session (which is the time, the Browser tab with main.html is open).

FlexNet License checker

The legacy EEvision packages still support the FlexNet License mechanism. They require an License Manager (lmgrd) to run; please check out the corresponding FlexNet documentation. For FlexNet related installation notes, please read The FlexNet Installation Guide. The "guard" process in the srv directory usually needs the environment variable LM_LICENSE_FILE pointing to the FlexNet License Manager. Each interactive EEvision session requires a FlexNet floating license for the life-time of the session (which is the time, the Browser tab with main.html is open).

Trust-based Customer specific License checker

In certain cases, an alternative license checker can be established by the EEvision customer. If so, then the eev.conf's "license" entry must define the URL path to the customer's license web service to provide license cookies. EEvision will add two URL parameters "salt" and "widget" and will access the customer's license web service via a HTTP GET, like:

https://server/path_to_customer_license_service?salt=123456789&widget=nlvEq7


Copyright © 2019–2024 by Altair Engineering Inc.
All rights reserved.