Installation

Database

Mercury was written for MySQL-compatible databases, including MariaDB. The ‘docs’ folder in the InfoCentral source code contains several SQL scripts that need to be executed in a database, either newly created or existing. It is recommended to run Mercury in its own database.

The SQL script named ‘_init.sql’ must be run first. Other scripts must be run in the order of roman numerals prefixing the script name; if one or more scripts have the same numeral, they can be run in any order amongst one another.
This scripts creates the following object tables:

  • User
  • Token
  • Secret
  • Role
  • Permission
  • Notification
  • Bulletin
  • Attribute
  • History
  • HistoryItem

the following associative tables:

  • User_Role
  • Role_Permission
  • Secret_Permission

and imports a list of Permission objects that Mercury will need to operate.

You will need to configure a user, or have one configured already, in the database to allow InfoCentral (and whatever host it will be running on) to perform create, insert, update, and delete operations on any table in this database.

Web Applications

All MAP applications are laid out with a single ‘public’ in the ‘src’ directory of the source code intended to be the publicly accessible web root. Other directories above ‘public’ contain class files and configurations that should not be exposed to the end user. The recommended configuration for MAP is with each application running in its own virtual host; each virtual host can have the ‘public’ folder defined as its ‘DocumentRoot’, eliminating the possibility of access to unintended parts of the application. If one virtual host is desired, with different MAP applications as sub-directories, it is recommended to use symbolic links from the single DocumentRoot to the ‘public’ directory of the MAP applications, which should be installed outside this folder.

When both applications are set up, navigate to the InfoCentral URL, followed by ‘setup.php’ (e.g. ‘https://mercury.test.com/infocentral/setup.php‘). This will show a table with possible default values for your Mercury installation. The first is a random 2048 character SALT that will be needed for your IC Config, the second is a password (‘MercuryPassword’) generated with that SALT that must be updated for the default user in your database, and the third is a random Secret that should be inserted into your ‘Secret’ table.

Perform the latter two operations, and record the SALT and Secret somewhere, it will be needed later. Setup.php can be left where it is; it generates different values with every run and is not tied in any way to your Mercury instance.

With this setup in place, both applications can now be configured.