Installation:3.1 User Interface
From OpenIndivo Documentation Wiki
Contents |
Requirements
Your UI server must have the following software installed.
NOTE: The user interface has only been tested with the following settings and versions. If you wish to do otherwise, we may not be able to provide support.
Java
- Version 1.5
Java Servlet Container
Optional, to run the PHP Java Bridge in a production setting. (In a development setting, a standalone version of the Bridge may be started from the command line. See below.)
PHP-Java Bridge
- Version 4.2.2 (available at SourceForge)
The Java Bridge may be run in "standalone" mode, from the command line, in a development environment, or may be deployed with a J2EE application server in a production environment. Installation instructions are included with the Java Bridge download -- please refer to them as your primary resource. In short, you may copy JavaBridge.war to your application server, or extract JavaBridge.jar from the war and run the Bridge from the command line:
$ java -jar JavaBridge.jar SERVLET:8080 3 javabridge_servlet.log
Replace 8080 with the port on which you wish to run the Bridge. (If running the Indivo Server on the same machine, make sure your ports don't conflict!) Replace 3 with your preferred logging level (7 is the most detailed). The last argument is the full path of your log file location. If you use a GUI, and don't mind using the Java Bridge's default settings, you may simply double-click the jar to start the bridge.
IMPORTANT NOTE: If you have installed earlier versions of the Java Bridge and used the provided php_java.dll or java.so binary, make sure your php.ini no longer loads it! Remove all other Java Bridge settings you have in there, for cleanliness, since they're no longer necessary.
Webserver
- Apache 2.0 or 2.2 webserver
PHP
- PHP 5.2 or greater
Note: Required for Java Bridge compatibility.
Your PHP installation must be configured with MySQL and ZIP support. If you wish to use the graphical growth chart functionality, PHP must also be configured with GD, and FreeType support. None of these extensions are enabled by default.
Your php.ini configuration file also requires some minor tweaking. Whenever a pathname is used, it is just an example.
- In a development setting, it's helpful to display errors on the screen.
display_errors = On - In any setting, you ought to log errors to a file.
error_log = "/var/www/logs/php_errors.log" - Set your extension directory properly.
extension_dir = "c:\php\ext" - To load the pure-PHP Java Bridge include file, you must explicitly allow PHP to include from a URL.
allow_url_include = On
PHP includes a package manager called PEAR, used for installing third-party tools. Indivo requires the following PEAR packages (with all dependencies):
- DB
- Log (with the mysql dependency as well - not installed by default)
- Config
MySQL
Your webserver must have access to a MySQL database for logging and invitation purposes.
Installation Instructions
- Check out and build the entire Indivo project.
$ mvn clean install
- Copy the UI archive (found in
ui\php\target) to your webserver. Extract its contents to a web-servable directory. (Alternatively, you may point Apache's DocumentRoot directly to the webapps folder in your Indivo source distribution.) For example, if your webserver's documents live at /var/www/html/:
$ tar -xzvf indivo-ui-php-3.0-deploy.tar.gz $ mv indivo-ui-php-3.0-deploy/** /var/www/html/
- Copy the PHP Client archive (found in
client\php\target) to your webserver. Extract its contents somewhere outside your webserver's directory structure. For example, use/usr/local/indivo-php-client/:
$ tar -xzvf indivo-client-php-3.0.tar.gz $ mv indivo-client-php-3.0 /usr/local/indivo-php-client
- NEW IN INDIVO 3.1: Copy all the jars in the PHP Client's lib directory to a location where the Java Bridge will find them. If running in standalone mode, the Bridge's start-up log output will indicate where extra libraries may be placed by default:
Jun 14 16:05:42 JavaBridge INFO : extra library dir : C:\Documents and Settings\username\lib
If the Bridge is deployed in an application server, copy the jars to the Java Bridge's lib directory. For example, if using Tomcat, this will be a subdirectory like:
webapps\JavaBridge\WEB-INF\lib
- In your UI database, create all the tables (SQL below) for logging, user access tracking, invitations, and medication name suggestions.
CREATE TABLE `log` ( `LogDate` datetime NOT NULL default '0000-00-00 00:00:00', `LogTime` float NOT NULL default '0', `Class` varchar(100) default NULL, `Function` varchar(100) default NULL, `Filename` varchar(255) NOT NULL default '', `Line` int(10) unsigned NOT NULL default '0', `SessionID` varchar(45) default NULL, `Message` text NOT NULL, `Flag` int(10) unsigned NOT NULL default '0', `Priority` int(10) unsigned NOT NULL default '0', `id` varchar(13) NOT NULL default '0', `Ident` varchar(16) NOT NULL default '', PRIMARY KEY (`id`), KEY `Index_Log_SessionID` (`SessionID`), KEY `Index_Log_Level` (`LogDate`) );
CREATE TABLE `priority` ( `PriorityId` int(11) NOT NULL default '0', `Description` varchar(45) NOT NULL default '', PRIMARY KEY (`PriorityId`) );
INSERT INTO `priority` (`PriorityId`,`Description`) VALUES (0,'Emergency'), (1,'Alert'), (2,'Critical'), (3,'Error'), (4,'Warning'), (5,'Notice'), (6,'Information'), (7,'Debug');
CREATE TABLE `logins` ( `userid` varchar(255) NOT NULL default '', `datein` datetime NOT NULL default '0000-00-00 00:00:00', `dateout` datetime default NULL, `sessionid` varchar(50) NOT NULL default '', `ipaddress` varchar(50) default '' );
CREATE TABLE invite ( inviteId varchar(36) NOT NULL, toEmail varchar(255) NOT NULL, fromUsername varchar(255) NOT NULL, newUsername varchar(255) NULL, sentDate datetime NOT NULL DEFAULT '0000-00-00 00:00:00', newDate datetime NULL, fromEmail varchar(255) NOT NULL, flag int(10) NOT NULL DEFAULT '0', PRIMARY KEY(inviteId) );
CREATE TABLE mednames ( medname varchar(255) NOT NULL, batchid varchar(32) NOT NULL, PRIMARY KEY(medname,batchid) )
Configuration
Apache
If necessary, configure your webserver to point to the directory where you extracted the UI code. Open Apache's httpd.conf file in a text editor. Update the DocumentRoot value and the appropriate <Directory> tag to point to your preferred directory.
PHP Client API
Find apiConfig.xml in the extracted PHP Client directory and open it in a text editor. Fill in the blanks, namely:
- the
serverUrlfield - all the
loggingfields
If your Java Bridge servlet is not running at localhost:8080, open IndivoAPI.class.php in the extracted PHP Client directory, and update line 6 with the correct URL to the Java.inc include file.
User Interface
Find config.xml.php.orig in the UI's config subdirectory. Rename it to config.xml.php and open it in a text editor. Fill in the blanks. For a detailed description of "the blanks," read Config.xml.php Explained.
Secure your administration tools folder! Find htaccess.orig in the UI's admin subdirectory. Rename it to .htaccess and open it in a text editor. It looks like this:
AuthUserFile /usr/local/.htpasswd AuthName "Authentication Required" AuthType Basic <Limit GET POST> require valid-user </Limit>
To enable basic HTTP authentication, the first line must point to a valid password file. Create one using the htpasswd utility that ships with Apache, store it outside your web server's document root, and set the AuthUserFile value to the proper path where it's stored.
Testing
Open a browser and visit the server test script included with the UI. If you set up a webserver to run at localhost, then try:
http://localhost/admin/servertest.php
This script will test as many server settings as possible to detect any misconfigurations. If any test fails, you are not ready to use Indivo. Only when all tests say "PASS" (and "Server Test Complete!" appears at the bottom) should you proceed.
Administrator Configuration
A record must have a single contact information document in order for login to succeed. The default administrator created in the Keystore & Administrator Creation instructions does not come with a contact information document, so we've included a setup script which will add such a document to your adminstrator record, accessible via the UI. If you set up a webserver to run at localhost, then try:
http://localhost/config/setup.php?username=XXXX&password=XXXX
Just use the correct path to your UI site, and provide your administrator's full username (i.e. admin@indivohealth.org) and password as URL variables (replacing the XXXXs). This is also a good final test of the entire Indivo setup: if it works, you're in great shape.
Medication Name Initialization
To enable the medication name suggestion feature in the medication input form, execute the initialization script which will download and parse a source file from the U.S. Food and Drug Administration. If you set up a webserver to run at localhost, then try:
http://localhost/admin/orangebook.php

