FastX Startup Options

In a default instaIn the default FastX installation, service startup files to start the FastX web server (and the license manager) are automatically installed when the “install.sh” script is run.

There are multiple options available to change the configuration (mostly directory locations).

Root Installation

When running as root, FastX 3 is installed as a service.
Create and edit /etc/sysconfig/fastx3 to make modifications

Nonroot Installation

Start the FastX web server by running /usr/lib/fastx/3/tools/run-web

It will use the environment variables to set the proper configurations.

Files

Startup files are located in the config directory.  See FastX Configuration Directory for more details

Environment Variables

NODE_OPTS

Options to pass to the NodeJS web server.
This variable is ignored if you are running nonroot. For nonroot, pass the node options as command line parameters to  the run-web application

FX_VAR_DIR

Default: /usr/lib/fastx/var

Sets the var directory.

Directory for Configuration, database, licenses, and local files.  The var directory contains files that are specific to this installation of FastX. This includes configuration files (see FastX config Directory below), the local directory (see below), web (SSL) certificates, license files, and local web files (if used).  It is recommended that you leave this default

FX_CONFIG_DIR

Default: /usr/lib/fastx/var/config

Sets the config directory

The config directory contains configuration files that can be common across all FastX cluster members.
The config directory is read by the fastx-protocol and session start scripts, as well as the FastX web server.

FX_LOCAL_DIR

Default: /usr/lib/fastx/var/local

Sets the local directory

The local directory contains the FastX database, the server ID, and the public-private key for this FastX server. This directory must be unique (not shared) for each FastX server (including FastX cluster members)

FX_AUTHORIZED_KEYS_DIR

Default: NA

Sets the Authorized keys directory for clustering. This enables offline storage of public keys. When not set, FastX assumes the database is secure.

In a clustered environment, all servers require a public key to sign and verify messages coming from other servers.  These keys are stored in the database by default.  This poses a security threat if a server in the cluster is compromised as it could modify and fake another server’s public key.  For maximum security, the public keys can be stored outside of the database in a directory.

Hostname Substitution

In some cases, such as when several FastX servers (including cluster members) mount the same FastX var directory, it is necessary to specify a unique directory name by including the system host name.

systemd systems

%H  — substitute for the the hostname

Older init.d systems

$HOST — substitute for the the hostname

Determining if you are using systemd

FastX is built to run on both systemd and non systemd operating systems.

To tell if you are running systemd, run the command systemctl

If it prints lots of services, you are running systemd
If it is not found, you are running the older init.d style systems

Examples

FastX installed in a non-default directory

Suppose FastX is installed in /opt/sw/fx, and you wish to configure your local directory as /opt/sw/fx/var/local/`hostname`/. Further, suppose your system is a RedHat 7 system running systemd. Therefore, assuming the startup files have all been created, the file /etc/sysconfig/fastx3 would be created with this line:

FX_LOCAL_DIR=/opt/sw/fx/var/local/%H

Nonroot Installation

If the FastX web server is not being started from a system startup file, then the “run-web” script is probably being used. In this case the environment variables will be set manually. For example, suppose FastX is installed in your home directory at $HOME/FastX and you wish to set the local directory to $HOME/.fastx-server/var/local. In this case, you would start FastX with the following command:

FX_LOCAL_DIR=$HOME/.fastx_server/var/local $HOME/FastX/lib/fastx/3/tools/run-web

 

Running the NodeJS Debugger

NodeJS comes with a built in debugger.  To run it

Root installation

Edit /ect/sysconfig/fastx3

NODE_OPTS=--inspect --inspect-port=0
Nonroot installation
/usr/lib/fastx/3/tools/run-web --inspect --inspect-port=0

Per-User Directories

In some cases you may wish to put the users’ session directories in a location not in their home directory. For example, suppose the session directory should be in /var/fastx/user/$USER/$HOST/sessions. To do this, the FastX.conf file (in the config directory) will have this line:

SessionPath=/var/fastx/user/$USER/$HOST/sessions