InfraTrack Portal is an open source web utility that provides full access to its source code. This allows a system administrator to customize all features to fit the business needs. The freely downloadable web utility is provided as an example of integration with InfraTrack API.
InfraTrack Portal native development platform is Debian Linux. While the application may function properly on other operating systems, we will only support installations on Linux as presented in this document.
Support schema:
Platform version 1.0.0 | Details: | |
---|---|---|
Operating System | Debian jessie/sid x64 | Kernel 3.14-1-amd64 or higher, Min. 4GB RAM, 2 CPU, 40GB disk |
Web Server | Apache 2.4 | mod-php5, mod-rewrite |
PHP | 5.5 | php5-json php5-xsl, php-services-json, php-gettext, php5-mcrypt |
Virtualization | VMWare ESX/ESXi | 5.1 or 5.5 |
Storage | Local or SAN | SATA/SAS/SCSI |
Localization | Gettext 0.18 | en_US.UTF8, de_DE.UTF8, es_ES.UTF8, fr_FR.UTF8, ro_RO.UTF8 |
Hardware requirements:
For a number of 30 active accounts with 10 concurrent online users, here are the minimum hardware requirements:
Component | Minimum: | Growth Formula: |
---|---|---|
CPU | 1 x i7 or Xeon | 1 CPU for every additional 30 concurrent online users |
Memory | 4GB | 2GB for every additional 30 concurrent online users |
Disk | 40GB | 10GB for every additional 50 concurrent online users |
IO/s | 150 | 50 IO/s for every additional 50 concurrent online users |
Network Speed | 1GB/s | Consider bonding the interface in a hardware environment when the number of concurrent online users exceeds 50 |
InfraTrack Portal web application is not a disk intensive utility. Yet as in any critical system having hardware disk mirroring is mandatory.
The minimum disk size for Operating System and InfraTrack Portal install is 40GB. Two separate disks should be configured:
Logical Volume Manager (LVM) should be used to configure the disks allocation in the operating system.
From Disk 1, create a 250MB primary partition to me mounted as /boot. From the remaining disk, create a second primary partition to be used with the vgsys volume group.
vgsys volume group will have the following Logical volumes:
LV: | Size: | Mount: | FS: |
---|---|---|---|
root | 6GB | / | ext4 |
var | 4GB | /var | ext4 |
tmp | equal to memory size | /tmp | ext4 |
home | 2GB | /home | ext4 |
swap | 1.5 times the amount of memory up to 12GB; 12GB thereafter | Swap Area | swap |
From Disk 2 create a single primary partition and allocate the entire disk space to it. Then, create a volume group named vgsrv. vgsrv will have the following logical volume:
LV: | Size: | Mount: | FS: |
---|---|---|---|
srv | 5GB | /srv | ext4 |
Additionally, on systems with more than 100 concurrent users, we recommend enabling Kernel noop scheduler. This allows for better disk performance on heavy transactions.
To enable noop scheduler, edit your Grub2 configuration file (/etc/default/grub) by appending "elevator=noop" to the GRUB_CMDLINE_LINUX_DEFAULT parameter.
Example:
GRUB_CMDLINE_LINUX_DEFAULT="quiet elevator=noop"
Install the new boot loader by issuing command:
sudo /usr/sbin/update-grub2
Now restart your system and after reboot check that noop was enabled by issuing command:
cat /sys/block/*/queue/scheduler
The result should show:
[noop] deadline cfqLinux Packages:
The following packages should be installed at their latest version:
Install the packages on your system using commands:
sudo apt-get update sudo apt-get install libapache2-mod-php5 bc sudo apt-get install php5-curl curl wget sudo apt-get install php5-xsl sudo apt-get install php5-json sudo apt-get install php-services-json sudo apt-get install php-gettext sudo apt-get install php5-mcrypt
Linux Locale:
Because InfraTrack Portal uses internationalization features, you need to enable all locale variables that you plan on using with the website. Currently the following languages are included in the software:
To enable locale, edit as root /etc/locale.gen file and uncomment lines:
Execute commands to apply changes:
sudo /usr/sbin/locale-gen sudo /usr/bin/locale -a
Repeat the above steps for all additional languages you plan to use.
Enable PHP Support in Apache by adding a link in /etc/apache2/mods-enabled/ to /etc/apache2/mods-available/php5.conf and /etc/apache2/mods-available/php5.load
sudo ln -s /etc/apache2/mods-available/php5.conf /etc/apache2/mods-enabled/php5.conf sudo ln -s /etc/apache2/mods-available/php5.load /etc/apache2/mods-enabled/php5.load
If InfraTrack Portal is to be used via SSL, enable the SSL Apache module too by running commands:
sudo ln -s /etc/apache2/mods-available/ssl.conf /etc/apache2/mods-enabled/ssl.conf sudo ln -s /etc/apache2/mods-available/ssl.load /etc/apache2/mods-enabled/ssl.load sudo ln -s /etc/apache2/mods-available/socache_shmcb.load /etc/apache2/mods-enabled/socache_shmcb.load
A sample apache configuration for InfraTrack Portal running as a SSL Apache Virtual Host is available for download here
Ensure you customized at a minimum the following parameters before deploying the Apache SSL sample configuration file:
A sample apache configuration for InfraTrack Portal running as a HTTP Apache Virtual Host is available for download here
Ensure you customized at a minimum the following parameters before deploying the Apache HTTP sample configuration file:
To deploy InfraTrack as a Virtual directory within an existing Virtual Host, add the following to your Apache host configuration:
Alias /infratrack/ "/srv/infratrack_www/" <Directory "/srv/infratrack_www/"> Options Indexes FollowSymLinks AllowOverride All Require all granted Order deny,allow Allow from All </Directory>
Save the configuration file in /etc/apache2/sites-available and link it in /etc/apache2/sites-enabled
To enable maximum performance on your system, we recommend downloading our Kernel and Limits sizing scripts and executing them to generate configuration files.
The kernel sizing script is available here
The limits sizing script is available here
Execute the scripts as root user
Note:
You must restart your system after changing the kernel and security limits configuration files.
Download InfraTrack Portal web application from http://download.infra-track.com/infratrack_web_1.0.0.tar.gz
From the download location, extract the package content and change directory to infratrack_web_1.0.0
From within directory infratrack_web_1.0.0, execute as root install_web.sh
This script will create a /srv/infratrack_web directory and copy all web files to it. A configuration file will also be created in /etc/infratrack/ folder and proper permissions will be given to all new created objects.
The install_web.sh script will prompt you for the following configuration items:
If Apache is already configured a manual apache web server service restart will have to be performed at the end of the installation.
Once the installation is complete, point your browser to the configured server address and you should be able to see the InfraTrack Portal login screen.
If the page is not loading or errors are recorded in the Apache log, please verify that all components are installed
The configuration file is located on your system at /etc/infratrack/infratrack_WEB.ini
Configurable items are:
Parameter: | Default Value: | Description: |
---|---|---|
MEMORY_LIMIT | 134217728 | Maximum memory (value in bytes) to be used by the PHP process |
ERROR_LEVEL | E_ERROR | Pipe (|) separated values; a value of -1 will log all errors. In production systems, recommended setting is: E_ERROR |
APP_NAME | InfraTrack | Application name as desired to appear on the Portal title |
COMPANY_ID | N/A | License key (permanent or trial) for your company |
WEB_ADDRESS | N/A | The full address at which this portal installation will be published. Example: http://portal.phx1.az.us.amdatasoft.net/ if using a host based configuration or http://portal.phx1.az.us.amdatasoft.net/infratrack/ if using virtual directories |
WEB_SERVICE_ADDRESS | https://sapi.infra-track.com:18892 | URL for your hosted or remote InfraTrack API including port number and no trailing slash (/). Protocol must be HTTP or HTTPS |
RSS_FEED | http://infra-track.com/news/feed.rss | Address for news list to be displayed on the login screen |
RSS_ITEMS | 3 | Number of news items to be displayed on the login screen. Value must be numeric |
WEB_ROOT | /srv/infratrack_www | Location where your InfraTrack Portal web files are located with no trailing slash (/) |
URL_PATH | N/A | Blank if host based Apache configuration is used. Alias for virtual directory if used in Apache configuration (e.g.: /infratrack) |
MAX_RECS_PER_PAGE | 8 | Number of records to be displayed per page. Value must be numeric. |
DATETIME_FORMAT | Y-m-d H:i:s T | Given the internationalization capability, we suggest using this format in all instances |
MAP_CENTER_LAT | 0.00000 | Latitude for Datacenters map to focus on |
MAP_CENTER_LONG | 0.00000 | Longitude for Datacenters map to focus on |
MAP_ZOOM | 1 | Map zoom level. Numeric value between 1 and 18. 1 represents global view, 18 represents street view. Adjust accordingly depending on your number of datacenters and distance among locations. |
Sample infratrack_WEB.ini file:
; sets the amount of memory in bytes to be used by the PHP process ; a value of -1 disables all limits; use this value with care ; as it may impact server performance ; default value = 134217728 MEMORY_LIMIT = 134217728 ; pipe (|) separated values; a value of -1 will log all errors ; in production systems, best setting is: E_ERROR ; default value = E_ERROR | E_WARNING | E_PARSE ERROR_LEVEL = E_ERROR | E_WARNING | E_PARSE APP_NAME = "InfraTrack" COMPANY_ID = "a8c66258-2467-4c83-79ab-24671f4556cb" WEB_ADDRESS = "http://portal.phx1.az.us.amdatasoft.net/" WEB_SERVICE_ADDRESS = "https://sapi.infra-track.com:18892" RSS_FEED = "http://infra-track.com/news/feed.rss" RSS_ITEMS = 3 WEB_ROOT = "/srv/infratrack_www" URL_PATH = "" MAX_RECS_PER_PAGE = 8 DATETIME_FORMAT = "Y-m-d H:i:s T" MAP_CENTER_LAT = 0.00000 MAP_CENTER_LONG = 0.00000 MAP_ZOOM = 1
As previously mentioned, the InfraTrack Portal web application is an open source solution. This allows the user to fully customize all components as long as good PHP development experience and strong understanding of web services is available.
This document will focus on customizing the existing downloadable application.
Path | File | Description | Editable |
---|---|---|---|
/etc/infratrack/ | infratrack_WEB.ini | Application configuration file | Yes |
/srv/infratrack_www/ | ajax_pw_decode.php | Password decryption module | No |
/srv/infratrack_www/ | company.php | Company and licensing information page | No |
/srv/infratrack_www/ | dashboard.php | Welcome screen (dashboard) after user authentication | Yes |
/srv/infratrack_www/ | datacenters.php | Datacenters page | Yes |
/srv/infratrack_www/ | getfile.php | Authentication protected file download module | No |
/srv/infratrack_www/ | index.php | Index page (login screen) | Yes |
/srv/infratrack_www/ | info.php | Profile information page | Yes |
/srv/infratrack_www/ | logout.php | LogOut module | No |
/srv/infratrack_www/ | mgdevices.php | Device management and display page | Yes |
/srv/infratrack_www/ | mgtemplates.php | Template management and display page | Yes |
/srv/infratrack_www/ | profile.php | Profile edit module | Yes |
/srv/infratrack_www/ | settings.php | Application settings file and global parameter list | Yes, with caution |
/srv/infratrack_www/ | template_preview.php | Template preview from XSLT to HTML | No |
/srv/infratrack_www/ | users.php | Users list and management | Yes |
/srv/infratrack_www/css/ | bootstrap.css | Bootstrap stylesheet | No |
/srv/infratrack_www/css/ | bootstrap-glyphicons.css | Bootstrap stylesheet | No |
/srv/infratrack_www/css/ | bootstrap.min.css | Bootstrap stylesheet | No |
/srv/infratrack_www/css/ | bootstrap-responsive.css | Bootstrap stylesheet | No |
/srv/infratrack_www/css/ | bootstrap-responsive.min.css | Bootstrap stylesheet | No |
/srv/infratrack_www/css/ | docs.min.css | Bootstrap stylesheet | No |
/srv/infratrack_www/img/ | datacenter.png | Datacenter icon file | Yes |
/srv/infratrack_www/incl/ | bottom.php | Footer page included in all modules | Yes |
/srv/infratrack_www/incl/ | head.php | Top navigation page | Yes |
/srv/infratrack_www/incl/ | security.php | Security check module for protected pages | No |
/srv/infratrack_www/incl/ | top.php | Title, javascript and css includes | Yes, with caution |
/srv/infratrack_www/js/ | bootstrap-alert.js | Bootstrap JavaScript | No |
/srv/infratrack_www/js/ | bootstrap-button.js | Bootstrap JavaScript | No |
/srv/infratrack_www/js/ | bootstrap-carousel.js | Bootstrap JavaScript | No |
/srv/infratrack_www/js/ | bootstrap-collapse.js | Bootstrap JavaScript | No |
/srv/infratrack_www/js/ | bootstrap-dropdown.js | Bootstrap JavaScript | No |
/srv/infratrack_www/js/ | bootstrap.js | Bootstrap JavaScript | No |
/srv/infratrack_www/js/ | bootstrap.min2.js | Bootstrap JavaScript | No |
/srv/infratrack_www/js/ | bootstrap.min.js | Bootstrap JavaScript | No |
/srv/infratrack_www/js/ | bootstrap-modal.js | Bootstrap JavaScript | No |
/srv/infratrack_www/js/ | bootstrap-popover.js | Bootstrap JavaScript | No |
/srv/infratrack_www/js/ | bootstrap-scrollspy.js | Bootstrap JavaScript | No |
/srv/infratrack_www/js/ | bootstrap-tab.js | Bootstrap JavaScript | No |
/srv/infratrack_www/js/ | bootstrap-tooltip.js | Bootstrap JavaScript | No |
/srv/infratrack_www/js/ | bootstrap-transition.js | Bootstrap JavaScript | No |
/srv/infratrack_www/js/ | bootstrap-typeahead.js | Bootstrap JavaScript | No |
/srv/infratrack_www/js/ | jquery-1.9.1.min.js | JQuery version 1.9.1 | No |
/srv/infratrack_www/js/ | jquery.js | JQuery | No |
/srv/infratrack_www/js/ | jquery.min.js | JQuery minimal | No |
/srv/infratrack_www/js/ | typeahead.js | Bootstrap JavaScript | No |
/srv/infratrack_www/js/ | underscore-min.js | Bootstrap JavaScript | No |
/srv/infratrack_www/lib/ | access_levels.php | Array list of access levels | Yes, with caution |
/srv/infratrack_www/lib/ | cls_formatting.php | Global formatting class | No |
/srv/infratrack_www/lib/ | enc_module.php | Encryption module | Yes, with caution |
/srv/infratrack_www/lib/ | form_fields.php | Form fields array and validation | Yes, with caution |
/srv/infratrack_www/lib/ | languages.php | Languages array list | Yes |
/srv/infratrack_www/lib/ | rest_client.php | API client for REST CURL communication and data transfer | No |
/srv/infratrack_www/lib/ | timezones.php | Timezones list | No |
/srv/infratrack_www/lib/ | utils.php | Application utilities | No |
/srv/infratrack_www/de_DE/LC_MESSAGES/ | infratrack.mo | Translation file for German (Germany) | Yes |
/srv/infratrack_www/en_US/LC_MESSAGES/ | infratrack.mo | Translation file for English (USA) | Yes |
/srv/infratrack_www/es_ES/LC_MESSAGES/ | infratrack.mo | Translation file for Spanish (Spain) | Yes |
/srv/infratrack_www/fi_FI/LC_MESSAGES/ | infratrack.mo | Translation file for Finnish (Finland) | Yes |
/srv/infratrack_www/fr_FR/LC_MESSAGES/ | infratrack.mo | Translation file for French (France) | Yes |
/srv/infratrack_www/nl_NL/LC_MESSAGES/ | infratrack.mo | Translation file for Dutch (Netherlands) | Yes |
/srv/infratrack_www/ro_RO/LC_MESSAGES/ | infratrack.mo | Translation file for Romanian (Romania) | Yes |
/srv/infratrack_www/ru_RU/LC_MESSAGES/ | infratrack.mo | Translation file for Russian (Russian Federation) | Yes |
See the "InfraTrack Portal configuration" section of this document for customization details
Modify the dashboard to display relevant information about your infrastructure. This page is also be used as a pre-loader for template, datacenter and device sessions. Ensure that all sessions are generated on page load and that no session reload occurs unless data is changed. Avoid adding forms to this page as its purpose is to display data.
This page is a full-feature module that allows editing, viewing and addition of datacenters. Form field components are driven from the lib/form_fields.php file, $arr_dc_data_format array. It is mandatory that you pre-define form fields in $arr_dc_data_format and add necessary labels in all used language files before applying changes to this module. After each change or addition to the data centers list, the datacenters_list and datacenters_list_create_dt sessions must be refreshed.
The only true requirement of this page is the login screen. The validation occurs against the API and the following sessions are being set:
Note:
The RSS news feed is being configured in infratrack_WEB.ini file and NOT on this page.
The purpose of this page is to provide session and support information. The only mandatory feature is the "Sessions" tab where a user may choose to refresh their session data. Feel free to add additional support related items to this page
This page is a full-feature module that allows editing, viewing and addition of devices. Form field components are driven from the lib/form_fields.php file, $arr_device_data_format array. It is mandatory that you pre-define form fields in $arr_device_data_format and add necessary labels in all used language files before applying changes to this module. After each change or addition to the devices list, the devices_list, templates_list, devices_list_create_dt and templates_list_create_dt sessions must be refreshed.
This page is a full-feature module that allows editing, viewing and addition of templates. Form field components are driven from the lib/form_fields.php file, $arr_template_data_format array. It is mandatory that you pre-define form fields in $arr_template_data_format and add necessary labels in all used language files before applying changes to this module. After each change or addition to the templates list, the templates_list and templates_list_create_dt sessions must be refreshed.
On the profile page a user has the ability to change their contact information, password and locale details. Keep in mind that the user account (username) should never be a editable field as accounts are being setup by managers and administrators and must be unique for the entire organization. Form field components are driven from the lib/form_fields.php file, $arr_user_data_format array (same as the users module). It is mandatory that you pre-define form fields in $arr_user_data_format and add necessary labels in all used language files before applying changes to this module. As soon as the profile is changed, you must also update sessions:
Note:
Take extreme caution and ensure backups are performed prior to making any changes to this file.
If for any reason you would like to use a different configuration ini file, or change the location of the ini file, change he path in line 45:
$app_settings_array = parse_ini_file("/etc/infratrack/infratrack_WEB.ini");
If the desired default time zone must be changed from UTC, change on line 82 with desired value:
define('DEFAULT_TIMEZONE', 'UTC');
Note that the default time zone is being used only when the user and company does not have a time zone pre-defined. In most cases, this is impossible, so changing line 60 should never be a requirement.
If the desired default language must be changed from en_US (English, USA), change on line 71 with desired value:
define('DEFAULT_LANG', 'en_US');
Note that the default language is being used only when the user and company does not have a language pre-defined. In most cases, this is impossible, so changing line 71 should never be a requirement.
This page is a full-feature module that allows editing, viewing and addition of users. Form field components are driven from the lib/form_fields.php file, $arr_user_data_format array (same as the profile module). It is mandatory that you pre-define form fields in $arr_user_data_format and add necessary labels in all used language files before applying changes to this module. After each change or addition to the users list, the users_list and users_list_create_dt sessions must be refreshed. Also, any changes to the existing logged in user should be performed from the profile page rather than from this module.
Change as needed the <footer /> section of this file as needed but no other sections
Change as needed all components in "navbar-header" section. Consult Bootstrap documentation at http://getbootstrap.com/ on available options and styles.
Note:
Take extreme caution and ensure backups are performed prior to making any changes to this file.
Consider only adding additional javascript and stylesheed files to this module and do not remove any existing includes. The purpose of this file is to provide a framework for the entire content of the site, so making changes to existing scripts or references to scripts may damage the layout and functionality of the web application.
Note:
Take extreme caution and ensure backups are performed prior to making any changes to this file.
List of configured access level parameters as $arr_access_level array. The 3 mandatory access levels are: ADMIN, MANAGER and USER
Those levels must not be modified and always in upper-case letters. Add values as needed and configure the web application security as needed to filter modules based on the new security values.
Array format must always be:
'LEVEL' => 'LEVEL'
Note:
Take extreme caution and ensure backups are performed prior to making any changes to this file.
For security purposes, the device account passwords are encrypted before transmission back and from the API/Database engine. This protects your information while at rest or in flight. To do so, aes-256 encryption keys MUST be generated after a new installation of InfraTrack Web portal.
Generating keys is easy. On a Linux system with OpenSSL pre-installed, execute command:
openssl enc -aes-256-cbc -k /dev/urandom -P -md sha1
As example, the above command will result in:
salt=5D2862725AD5CA2B key=E46EF334C839C1E1BC76F0074271A0451705593FB7E04D9D4EC6A56D46839B7D iv =F89B1B6A80A867EF0141E5E1734E3813
From the result, copy the KEY value and locate the public $arr_crypto_keys variable in lib/enc_module.php file, enc_library class.
The variable will have multiple entries like:
'grp_01' => [ 'key_name' => 'Admin Group', 'key_value' => 'E46EF334C839C1E1BC76F0074271A0451705593FB7E04D9D4EC6A56D46839B7D', 'key_pass' => 'KuL4rT78-33V9' ]
Replace the key_value value with your new generated key.
Additionally, change the key_name and use a strong password for key_pass value.
Repeat this process for all keys required.
Also, ensure that you increment by 1 (+1) all "grp" array groups (e.g.: grp_01 followed by grp_02 followed by grp_03, etc.)
Once all keys are generated, distribute the file to all portal nodes in your environment and make sure that the keys are protected by changing ownership and read permissions on the lib/enc_module.php file:
sudo chown www-data:www-data /srv/infratrack_www/lib/enc_module.php sudo chmod 400 /srv/infratrack_www/lib/enc_module.php
Note:
Take extreme caution and ensure backups are performed prior to making any changes to this file.
Form Fields module is delivered with 4 groups of objects (arrays):
Each object contains multiple arrays in format:
'field_name' => [ 'field_label' => 'label_name', 'field_name' => 'field_name', 'field_default_val' => 'default_value', 'field_readonly' => 'true or false', 'field_length' => 'int. value of how many chars. are accepted', 'field_type' => 'any', 'field_validate' => 'true or false' ]
For example, we want to add a new field to the user's management form.
Steps:
'user_middle_name' => [ 'field_label' => 'lbl_user_middle_name', 'field_name' => 'user_middle_name', 'field_default_val' => '', 'field_readonly' => 'false', 'field_length' => '20', 'field_type' => 'alpha', 'field_validate' => 'true' ]
List of configured locale languages as $arr_languages array.
Default array value is:
$arr_languages = [ 'en_US' => 'English (US)', 'de_DE' => 'German (DE)', 'es_ES' => 'Spanish (ES)', 'fi_FI' => 'Finnish (FI)', 'fr_FR' => 'French (FR)', 'nl_NL' => 'Dutch (NL)', 'ro_RO' => 'Romanian (RO)', 'ru_RU' => 'Russian (RU)' ];
Follow instructions from the "Linux Locale" section of this document to add additional languages. After enabling additional languages at the operating system level, add them to the $arr_languages array in format:
'locale_CODE' => 'Language (Country)'
Example for Italian (Italy):
'it_IT' => 'Italian (Italy)'
For language editing we recommend using POEdit, a tool available at http://poedit.net/
.MO translations for all languages included are available for download at http://download.infra-track.com/languages_1.0.0.tar.gz
Extract the archive and open the language .PO file with POEdit. Make all necessary changes and save the .PO and resulting .MO files. Copy the updated file to all nodes as /srv/infratrack_www/locale/your_LANGUAGE/LC_MESSAGES/infratrack.mo (replace your_LANGUAGE with your actual language code; e.g.: it_IT)
It is imperative that you maintain the project name as "infratrack" and that the character set is UTF-8. When creating a new language, it is recommended that you start with an existing language file (.PO) and that you modify the language in the translation properties tab. Then continue making changes to all existing and new labels.
Note:
Do NOT remove existing labels.