AllegroGraph 3.0 Java Installation

Table of Contents

Installation

Windows

Linux

Mac OS X

Solaris

FreeBSD

Updater

The AllegroGraph server application

Security considerations

Contents of the eval-in-server permission file

Prolog select queries

Installation

AllegroGraph is distributed without Java. We assume that Sun's Java is already installed. The Java interface to AllegroGraph requires Java version 1.4.2 or later.

Windows

There are 32 and 64-bit versions of AllegroGraph available for Windows. Select the appropriate one for the version of Windows you are running. The 32-bit version of AllegroGraph will run on the 64-bit version of Windows, but the 64-bit version of AllegroGraph will not run on the 32-bit version of Windows.

After downloading the installer executable, just run it. It will guide you through the installation. AllegroGraph runs as a service. The installation will start the service and run the AllegroGraph console application, that allows you to see messages from the server. The console displays an icon in the system tray. Just double-click on the icon to show the window containing server messages.

The AllegroGraph service, by default, runs as the Local System account. If you wish to run the server as a particular user, with reduced priviledges, you can do so by running the services Windows program (in the Control Panel). Once there, right click on the AllegroGraph Server entry and select properties. On the Log On tab you can change the Log on as values with an account and password. You must restart the service for the change to take effect.

Linux

There are two Linux versions of AllegroGraph: 32-bit (x86) and 64-bit (x86-64). Select the appropriate one for the version of Linux you are running. The 32-bit version of AllegroGraph may run on 64-bit Linux, but the the 64-bit version of AllegroGraph will not run on the 32-bit version of Linux.

On Linux, AllegroGraph is distributed both as an RPM and a tar.gz file. If you do not have root permissions, then we recommend the tar.gz installation package.

For the RPM installation, the files are located in the /usr/lib/agraph/ directory. The server executable is /usr/lib/agraph/AllegroGraphServer. The RPM package also installs a script for starting and stopping AllegroGraph with system startup and shutdown, /etc/rc.d/init.d/agraph. AllegroGraph is set to start at the end of the Linux boot process. See the section Security considerations for important information.

For the tar.gz installation, just unpack the files anywhere that does not already have an existing agraph-3.0 directory. Once unpacked, the the executable is agraph-3.0/AllegroGraphServer.

If you do not have root permissions and still want to use the RPM package, then you can install into an alternate directory by doing the following:

% rm -fr ~/rpmdb  
% mkdir ~/rpmdb  
% rpm --dbpath $HOME/rpmdb --initdb  
% rm -fr ~/agraph  
% mkdir ~/agraph  
% rpm -ivh --nodeps \  
   --relocate /usr/lib/agraph=$HOME/agraph/agraph \  
   --relocate /etc/sysconfig/agraph=$HOME/agraph/sysconfig/agraph \  
   --relocate /etc/rc.d/init.d/agraph=$HOME/agraph/init.d/agraph \  
   --dbpath $HOME/rpmdb agraph-3.0-1.x86_64.rpm  
Preparing...         ########################################### [100%]  
   1:agraph          warning: user agraph does not exist - using root  
warning: user agraph does not exist - using root  
...  
warning: user agraph does not exist - using root  
########################################### [100%]  
warning: user agraph does not exist - using root  
warning: user agraph does not exist - using root  
error reading information on service agraph: No such file or directory  
error: %post(agraph-3.0-1.x86_64) scriptlet failed, exit status 1  
% 

Despite the warnings and error at the end, the files you need to run AllegroGraph will be in $HOME/agraph.

Mac OS X

There are two Mac OS X versions of AllegroGraph, one for 32 and 64-bit x86. The 64-bit version runs only on Mac OS X 10.5 or later.

If you require PPC support, please contact Franz for the most up-to-date information.

On Mac OS X, AllegroGraph is distributed as a DMG file. Open the DMG and open the AllegroGraph.pkg file. Follow the prompts to install the software. AllegroGraph is installed into /Applications/AllegroGraph. The server is called AllegroGraphServer.

Solaris

We support Solaris AMD64. Currently, there is no support for SPARC (32 or 64-bit). For information on SPARC releases contact [email protected].

On Solaris, AllegroGraph is distributed as a compressed tar archive. You may extract the files anywhere you wish. The tar archive contains a directory name agraph-version, where version is the version of AllegroGraph you downloaded. The server executable is called AllegroGraphServer in this directory.

FreeBSD

On FreeBSD, AllegroGraph is distributed as a compressed tar archive. You may extract the files anywhere you wish. The tar archive contains a directory name agraph-version, where version is the version of AllegroGraph you downloaded. The server executable is called AllegroGraphServer in this directory.

Updater

From time to time we release updates or fixes to the Java Edition. When we do, you can find descriptions of them on this page: http://agraph.franz.com/support/patches/log/.

In the AllegroGraph installation directory there is an application called updater when you can run to download the latest patches. When you do, the output of the program will look something like this:

peep% ./updater  
;; Connecting to http://www.franz.com/ftp/pub/patches/.  
;; Reading CRC cache...done.  
;; Checking for new update.fasl.  
;; Retrieving list of available patches.  
;; Checking which patches need to be downloaded.  
downloading: update/agraph/2.2/DESCRIPTIONS  
downloading: update/agraph/2.2/pfo013.001 (compressed)  
;; Creating CRC cache (please wait)...done.  
 
***** NOTE: You must restart the AllegroGraph server for the newly  
      downloaded updates to be installed.  
 
peep% 

In the above case, the line of interest is the one that references update/agraph/2.2/pfo013.001.

Remember to restart your server after running the updater. Updates are loaded at server start time only.

The AllegroGraph server application

The AllegroGraph server application executable is called AllegroGraphServer and it resides in the installation directory of AllegroGraph. Previous to AllegroGraph version 3.0, the server accepted user-settable parameters in the form of command line arguments. These parameters now also reside in a configuration file, agraph.cfg, in the AllegroGraph installation directory. The current, valid command line arguments and configuration file options are described later in this section.

On Windows, the startup directory for the service is somewhere in the Windows system directory. For this reason we recommend that absolute pathnames be used to open databases. Naming databases with relative pathnames from the Windows system directory would be tricky, and unnecessary.

On Mac OS X and other UNIX platforms, the startup directory is what ever directory is current when you start the server.

The configuration file is read when the server starts. The initial version of the configuration file looks like this:

;; This file contains the configuration options for AllegroGraph.  
;; Please refer to the installation documentation for the Java  
;; server for information on valid values for these options.  
;;  
;; Comments start with a semicolon (;).  
(  
;; Please do not change the following line:  
(:agraph-server-config 3)  
;; User-settable options start here:  
:direct nil  
:http-port -1  
:http-init-file nil  
:http-only nil  
:idle-life 86400  
:eval-in-server-file nil  
:client-select-queries nil  
:index -1  
:init-file "sys:aginit.cl"  
:lease -1  
:limit -1  
:log-file "sys:agraph.log"  
:no-direct nil  
:no-java nil  
:port 4567  
:port2 4568  
:res -1  
:repl-port nil  
:standalone t  
:timeout 60  
:error-log nil  
:users 50  
:verbose t  
)  
;;END OF CONFIG 

The format of each entry is option-name and option-value. The option-name must start with a colon (:). The option-value is specific to the option, but nil means off or no value, and the value t means the option is on. Some options take numerical or string arguments.

If you edit the file take care to leave the syntax as is. The parentheses and colons are significant. Whitespace, however, is not significant.

You should ignore any option not listed here, unless instructed by an AllegroGraph support engineer:

The command line arguments are listed below. Each configuration file option has a corresponding command line argument of the same name. The :port option becomes --port when it appears on the command line.

The command line arguments which are not configuration file options are:

Security considerations

On Linux, AllegroGraph is installed to run as the user agraph. On other UNIX platforms, AllegroGraph will run as the user logged in when the server is run. On Windows, AllegroGraph runs as a service with system privileges. In each case, it is important that you consider what access these permissions grant to the users on your local area network.

On Linux, AllegroGraph is installed to run as the user agraph. On other UNIX platforms, AllegroGraph will run as the user logged in when the server is run. On Windows, AllegroGraph runs as a service with system privileges. In each case, it is important that you consider what access these permissions grant to the users on your local area network.

When the current version of AllegroGraph runs as a server (both direct and HTTP), we assume a secure environment where protection from malicious attack is not an issue. But even in such an environment, it is wise to take precautions against accidental unintended actions and effects.

The Java method evalInServer() and the Lisp client function eval-in-server are provided for the convenience of applications and support engineers. These functions allow server behavior which was not anticipated in the client/server interface. But at the same time, they allows a wide range of actions that may be undesirable. For example, a client call can redefine any of the internal functions of the AllegroGraph implementation, or call the function run-shell-command to execute an arbitrary system command.

To prevent accidental misuse, the Java method evalInServer() and the Lisp client function eval-in-server are disabled in the standard AllegroGraph installation. The functions are enabled by supplying a file containing patterns of allowed operations.

Contents of the eval-in-server permission file

Each line in the file may be a comment, a regular expression, or an exact match string.

When a string argument arrives at the server for evaluation, it is matched against all the patterns in the file. If none match, then the call is rejected and the string has no effect. If the string matches one of the exact match strings or one of the regular expressions, then the string is parsed into a Lisp expression and the Lisp expression is evaluated. The evaluation may produce side effects on the server and the file system. Any values returned by the evaluation, are returned to the client.

For best security, one should always use the most restrictive form of a regular expression. An exact match string is always the most restrictive.

If the server is running in a secure environment and the application would benefit from extensive use of direct evaluations, the eval facility can be enabled fully by adding the line containing a single caret to the file. Such a file will allow the evaluation of all strings submitted to the server.

Prolog select queries

Note also that a Prolog query is submitted to the server as a string that is parsed into code that may result in arbitrary Lisp code. The default behavior in the standard installation is to allow Prolog queries from clients but suppress any Lisp evaluations.

The behavior can be modified with the configuration file option :client-select-queries or by calling the function enable-lisp-in-client-select-queries.

The restricted Prolog behavior applies to Prolog queries submitted by remote Lisp or Java clients, to Prolog queries submitted by Sesame HTTP clients, and to SNA generator definitions submitted by Java clients.