GUI Node Installation
Overall Installation Steps
The high-level steps for installing and configuring the N2IVR administrative GUI are:
- Determine the server(s) that will supply the GUI logical component, bearing in mind the supported operating systems and minimum server requirements.
- Ensure the installation pre-requisites are met.
- Install the GUI package.
- Perform any required post-installation steps.
- Update the administrative GUI configuration as desired.
- Optionally, apply the recommended Apache security configuration.
Installation Pre-requisites
OS-specific Setup
Refer to the specific Red Hat or Debian instructions for any pre-requisites as required.
Apache 2
Apache 2 must be installed prior to installing the N2IVR GUI package. The package to install will depend on your OS type:
| RHEL 8 / 9 | Other RPM-based Systems | DEB-based Systems |
|---|---|---|
sudo dnf install httpd |
sudo yum install httpd |
sudo apt-get install apache2 |
The N2IVR GUI package expects that the relevant Apache 2 configuration directory exists. Again, this varies depending on your OS type:
| RPM-based Systems | DEB-based Systems |
|---|---|
/etc/httpd |
/etc/apache2 |
Finally, the apachectl program must exist (it is installed as part of the Apache 2 package) and Apache must be
running.
Installation Steps
Follow the appropriate installation steps depending on your installation sources.
From N-Squared Repository
Execute the instructions specific to your operating system:
| RHEL 8 / 9 | Other RPM-based Systems | DEB-based Systems |
|---|---|---|
sudo dnf install n2sip-gui |
sudo yum install n2sip-gui |
sudo apt-get install n2sip-gui |
As Manual Installation
Transfer the provided package file to the target node, then follow the instructions specific to your operating system.
Execute (adjusting as appropriate for package location and version details) the following:
| RPM-based Systems | DEB-based Systems |
|---|---|
sudo rpm -Uvh /path/to/n2sip-gui-M.m.p-b.noarch.rpm |
sudo dpkg -i /path/to/n2sip-gui_M.m.p-b_all.deb |
Post-Installation Steps
Default Application
After installation, there is no default behaviour for Apache to automatically navigate to the N2IVR GUI when a site root request is received.
To set the N2IVR GUI as the default application, edit the appropriate file for your OS type:
| RPM-based Systems | DEB-based Systems |
|---|---|
/etc/httpd/conf.d/n2ivr-gui.conf |
/etc/apache2/conf-available/n2ivr-gui.conf |
Add the following line to the top of the file:
RedirectMatch ^/$ /n2ivr
Restart Apache to apply the change:
systemctl enable httpd
apachectl restart
Firewall
The firewall (if any) on the GUI node must be updated to allow:
- Inbound user requests on the listening Apache port(s).
The exact commands to do this will depend both on the firewall on your platform and also which port(s) are in use. For
example, to allow the default Apache ports when using firewalld, the commands might be:
firewall-cmd --zone=public --add-port=80/tcp --permanent
firewall-cmd --zone=public --add-port=443/tcp --permanent
service firewalld restart
SELinux
When using file-based synchronisation to transfer data to service nodes using rsync, Apache HTTPD must be allowed
to connect to remote servers via rsync over SSH.
If SELinux is in use, Apache must be allowed to read and execute back-end code and initiate proxy connections. To enable this, execute:
sudo setsebool -P httpd_can_network_connect 1
Non-Standard File Directories
When using file-base synchronisation a resource directory is maintained on disk. The default path for that directory is /var/lib/n2ivr/resources.
The resources directory itself and various sub-directories are automatically created as required, including:
resources/working: used to store audio files for the current working setresources/active: used to store audio files for the current active setresources/snapshots: used to store audio files for snapshots
If a non-default resource directory is required, the directory may be created as:
N2IVR_PATH=/path/to/n2ivr
mkdir -p $N2IVR_PATH/resources/working
mkdir $N2IVR_PATH/resources/active
mkdir $N2IVR_PATH/resources/snapshots
chown -R apache:apache $N2IVR_PATH
SELinux Adjustments
If SELinux is in use, the SELinux permissions for the /var/lib/n2ivr (or alternatively configured) directory must be updated.
As root:
N2IVR_PATH=/var/lib/n2ivr
semanage fcontext -a -t httpd_sys_rw_content_t "$N2IVR_PATH(/.*)?"
restorecon -Rv $N2IVR_PATH
The use of httpd_sys_rw_content_t will allow httpd to read and write files in this directory if they’re owned by the Apache user.
SQLite Files
When using SQLite rather than PostgreSQL, the SQLite datafiles must be copied to the server and stored on disk in an appropriate directory. Create an appropriate db directory, e.g.:
N2IVR_PATH=/var/lib/n2ivr
mkdir -p $N2IVR_PATH/db
Into this directory, copy the following files. Copies of these files can be sourced from N-Squared’s support team:
n2ivr.dbn2ivr_snapshot.db
Ensure these files are correctly secure. On RHEL:
chown apache:apache $N2IVR_PATH/db/*.db
chmod 600 $N2IVR_PATH/db/*.db
On Ubuntu:
chown www-data:www-data $N2IVR_PATH/db/*.db
chmod 600 $N2IVR_PATH/db/*.db
If SELinux is in use, the SELinux permissions must also be updated:
semanage fcontext -a -t httpd_sys_rw_content_t "$N2IVR_PATH/db(/.*)?"
restorecon -Rv $N2IVR_PATH/db
Synchronisation
When using database synchronisation, all data required for IVR service nodes is copied to the service nodes via built-in PostgreSQL replication.
When using file-based synchronisation, the N2IVR GUI requires the ability to connect via rsync to
the managed IVR servers. The exact method of doing this will differ from site to site. Assuming that passwordless SSH is
used with a newly-generated key, the following steps may be used.
Note that this assumes the default library directory of /var/lib/n2ivr. If this is altered as described in
Non-Standard File Directories, update these instructions accordingly.
Allow Apache to connect out to external N2IVR servers:
N2IVR_PATH=/var/lib/n2ivr
mkdir $N2IVR_PATH/.ssh
chown apache:apache $N2IVR_PATH/.ssh
ln -s $N2IVR_PATH/.ssh /usr/share/httpd/
Generate SSH keys to authorize Apache across all N2IVR nodes:
mkdir $N2IVR_PATH/etc
cd $N2IVR_PATH/etc
ssh-keygen -t ed25519 -f $N2IVR_PATH/etc/primaryivr_id_rsa
chown -R apache:apache $N2IVR_PATH/etc
The generated key will have to be copied to all N2IVR servers that use the N2IVR runtime and the host keys stored on the GUI node. For example:
for ivr in ivr1 ivr2 ivr3 ; do scp $N2IVR_PATH/etc/primaryivr_id_rsa.pub user@$ivr:.ssh/ ; done
Snapshot Maintenance
The N2IVR snapshot feature requires the regular removal of snapshots. To do
this, the remove_old_snapshots.pl script provided with the product can be
used.
This script is configured to be run from systemd on a timer.
Follow these steps on installation to ensure that it is enabled on one SMS/GUI node only.
By default the script will keep a minimum of 10 snapshots and above this number will remove records older than 90 days.
The service can be customised by editing as the root user:
systemctl edit n2sip-remove-old-snapshots
In the resulting file a [Service] section with an override ExecStart line can be specified to provide the correct
jarvis-config, max-age and min-num if the defaults are not appropriate. E.g.:
[Service]
ExecStart=
ExecStart=/usr/share/n2sip/bin/remove_old_snapshots.pl --jarvis-config /etc/jarvis/n2ivr-gui.xml --max-age 30 --min-num 30
If SQLite is being used, rather than PostgreSQL, Update the User and Group for this service. This
required if the SQLite data files are writable only by the apache user (apache on RHEL, www-data in Ubuntu)
[Service]
# ExecStart changes as appropriate
User=apache
Group=apache
Finally the timer can be enabled and started:
systemctl enable n2sip-remove-old-snapshots.timer
systemctl start n2sip-remove-old-snapshots.timer
Systemd timers can be reviewed using:
systemctl list-timers --all
GUI Configuration
Once the GUI is installed, complete the N2IVR GUI Configuration.