Installation

Installation - Linux

The Knomi Document Analyzer for Linux is available in a tarball format and rpm package. The tarball can be extracted to the location of choice and installed on any Linux distribution. And rpm package is suitable for installation on Red Hat, CentOS and other RPM-based systems.

tar.gz

Extract the package at the desired location. Example command:

tar -zxvf aware-knomidocumentanalyzer-*-linux-x86-64.tar.gz

Here are example instructions for starting up Knomi Document Analyzer server. You may use your own scripts and tools to start the services, but these steps are provided for those looking for a starting point.

Start the Knomi Document Analyzer server:

screen -S aw_knomi_document_analyzer_rest_server
cd knomidocumentanalyzer/aw_knomi_document_analyzer
./aw_knomi_document_analyzer_rest_server.sh
Press CTRL A D to disconnect from the screen

Now that the server is running, you can query its “version” endpoint from the command line to ensure they are running:

curl http://localhost:8088/documentAnalyzer/version

You should see a string that starts with “Aware” for each command. If that is not true or any of the commands fail, return to that service’s screen and ensure the service is running without errors.

At this point, the services are only accessible from the server itself. To make it available to the wider Internet, you must update the “host” parameter with the hostname for your server. For the following example, it will assume the server’s hostname is “server.com”

Edit the Knomi Document Analyzer server:

screen -r aw_knomi_document_analyzer_rest_server
CTRL-C
CTRL-C
sed -i 's/host=.*/host=server.com/g' knomi_document_analyzer_config.txt
./aw_knomi_document_analyzer_rest_server.sh
Press CTRL A D to disconnect from the screen

You can query the Knomi Document Analyzer “version” endpoint from the command line to ensure it is running correctly:

curl http://server.com:8088/documentAnalyzer/version

At this point, the Knomi Document Analyzer server should be accessible from another computer. You should be able to run the above command on another Linux computer on the same network. The “/version” URL can also be typed into a web browser to check if it is working.

To access the Knomi Document Analyzer services from the Internet, you must ensure that your network directs traffic to the computer running the services. As the steps for this are dependent on your network setup, it is outside the scope of this manual. Contact your IT department for assistance in ensuring that your server is sent connections from outside of your network.

rpm

Knomi Document Analyzer has an RPM package available which installs the REST servers as services that can be controlled by systemctl. The RPM requires Red Hat or CentOS Linux version 7.X.

Run the following command as root in order to install and startup the Knomi Document Analyzer servers:

sudo rpm -ivh knomidocumentanalyzer-x.x.x-el7.src.rpm

If you already have a previous version of the RPM installed, use this command instead:

sudo rpm -Uvh knomidocumentanalyzer-x.x.x-el7.src.rpm

Here are instructions for managing the services.

To stop the server while they are running, run the following commands:

  • sudo systemctl stop aw_knomi_document_analyzer_rest_server

To start the server when they are not running, run the following commands:

  • sudo systemctl start aw_knomi_document_analyzer_rest_server

To restart the server, run the following commands:

  • sudo systemctl restart aw_knomi_document_analyzer_rest_server

Once the server is running, you can query its “version” endpoint from the command line to ensure they are running:

curl http://localhost:8088/documentAnalyzer/version

You should see a string that starts with “Aware” for each command. If that is not true or any of the commands fail, go to /opt/apl/aware/ directory to check the logs from server folder to see if any errors reported. The log file name ends with _info.txt.

To make the server available to the wider Internet, you must update the “host” parameter with the hostname for your server. For the following example, it will assume the server’s hostname is “server.com”

Edit the Knomi Document Analyzer server:

sed -i 's/host=.*/host=server.com/g' /opt/apl/aware/knomidocumentanalyzer/aw_knomi_document_analyzer_rest_server/knomi_document_analyzer_config.txt
sudo systemctl restart aw_knomi_document_analyzer_rest_server

You can query the “/version” endpoint from the command line to ensure it is running correctly:

curl http://server.com:8088/documentAnalyzer/version

Server Status Checklist

If you are having trouble accessing the Knomi Document Analyzer services, go through these steps one by one to diagnose what is not working.

  1. Type http://server.com:8088/documentAnalyzer/version into a web browser that is on the same computer that is running the services.
  • If this does not work, it means that the services are not running or they are not using the correct hostname “server.com”. Check all of your configuration files from the installation, ensure the “host=” is set correctly, and then try restarting the services.
  • Note: On Linux, you can you the curl commands provided previously instead of using a web browser.
  1. Type http://server.com:8088/documentAnalyzer/version into a web browser that is on a different computer, but within the same network.
  • If this does not work, it means that the server is preventing connections. Contact your IT department to configure the server’s firewall so that other computers can communicate with the server.
  1. Type http://server.com:8088/documentAnalyzer/version into a web browser from outside of the network, such as from a phone.
  • If this does not work, it means that your network is not relaying connections from outside of your network to the server. Contact your IT department for assistance in configuring your network so that the server can properly handle these requests.