Installation - Debian
Package
Jarvis has support for Debian packages, suitable for Ubuntu and other popular Debian distributions.
The Jarvis Debian package can be installed with the dpkg command, e.g:
dpkg --install jarvis_5.0.1-1_all.deb
Note: If pre-requisite Perl modules are not installed, this may fail to complete successfully. If this is the case, install the dependencies (which would be listed in the output of the dpkg –install
command) via apt-get
:
apt install -f
This will install the necessary packaging automatically, along with completing the install of Jarvis.
The following directory locations will be populated:
Path | Notes |
---|---|
/usr/share/jarvis/cgi-bin |
This contains agent.pl , which is the CGI script which accepts requests over http /https when not using mod_perl . This is a simple bootstrap program. Most of the functionality is in the lib/Jarvis/*.pm files in the lib directory. |
/usr/share/jarvis/demo |
Contains demo files which comprise a simple application showing how to use Jarvis with ExtJS and SQLite. |
/usr/share/doc/jarvis |
Documentation including this file. |
/usr/share/jarvis/htdocs |
This contains a helper JavaScript include file for use with ExtJS. |
/usr/share/jarvis/lib |
Contains the majority of the Jarvis functionality as Perl modules. |
/var/lib/jarvis |
Working directory for SQLite database files for Demo applications, also recommended location for CGI session files. |
/etc/jarvis |
Your application top-level configuration XML files will go here. |
/etc/jarvis/apache |
Apache configuration files. |
Optional Dependencies
The following additional dependencies are required in specific cases.
To run the demo application:
apt install libdbd-sqlite3-perl
To run Jarvis under Apache mod_perl
:
apt install libapache2-mod-perl2 libapache-dbi-perl libapache2-request-perl
To use Database Login or eksblowfish
Authentication:
apt install libcrypt-eksblowfish-perl
To use LDAP or ActiveDirectory Login:
apt install libnet-ldap-perl
To use OAuth2 Login:
apt install libjson-webtoken-perl libio-socket-ssl-perl libcrypt-ssleay-perl
To use Microsoft SSAS sdp
Database type:
apt install libsoap-lite-perl
To use MongoDB mongo
Database type:
apt install libmongodb-perl libdatetime-perl
To use CSV formatting for responses:
See http://search.cpan.org/~makamaka/Text-CSV-1.33/ for more information.
cpan install Text::CSV
To use XLSX formatting for responses:
See http://search.cpan.org/~jmcnamara/Excel-Writer-XLSX-0.95/ for more information.
cpan install Excel::Writer::XLSX
Additionally available DB Drivers:
apt install libdbd-sybase-perl # (DB = SQL Server)
apt install libdbd-pg-perl # (DB = PostgreSQL)
Apache Configuration - FastCGI
FastCGI is the standard modern technology for efficient re-use of CGI applications.
To use FastCGI under Apache, first install the fcgid
module for Apache.
apt install libapache2-mod-fcgid
a2enmod cgi
a2enmod fcgid # (if not done automatically)
Enable the Apache configuration contained in jarvis.conf
:
cp /etc/jarvis/apache/jarvis.conf /etc/apache2/conf-available/jarvis.conf
cd /etc/apache2/conf-enabled/
ln -s ../conf-available/jarvis.conf .
Check the Apache configuration file and if ensure that the fast-agent.pl
script is being used.
ScriptAlias /jarvis-agent "/usr/share/jarvis/cgi-bin/fast-agent.pl"
Alias /jarvis/ "/usr/share/jarvis/htdocs/"
Alias /jarvis-demo/ "/usr/share/jarvis/demo/htdocs/"
If using Apache 2.4, you are likely to need to remove some restrictions. Firstly, grant access to the appropriate directory for Jarvis. In /etc/apache2/conf-available/jarvis.conf
, adding:
<Directory /usr/share/jarvis/>
Options FollowSymLinks
AllowOverride None
Require all granted
</Directory>
Restart the Apache webserver:
apache2ctl restart
Apache Configuration - Classic (Slow) CGI
If performance is not a significant factor, you can simply run Jarvis as a CGI script.
The Debian package performs this configuration automatically, with a soft link:
cp /etc/jarvis/apache/jarvis.conf /etc/apache2/conf-available/jarvis.conf
cd /etc/apache2/conf-enabled/
ln -s ../conf-available/jarvis.conf .
The Apache instructions are as follows:
ScriptAlias /jarvis-agent "/usr/share/jarvis/cgi-bin/agent.pl"
Alias /jarvis/ "/usr/share/jarvis/htdocs/"
Alias /jarvis-demo/ "/usr/share/jarvis/demo/htdocs/"
If using Apache 2.4, you are likely to need to remove some restrictions. Firstly, grant access to the appropriate directory for Jarvis. In /etc/apache2/conf-available/jarvis.conf
, adding:
<Directory /usr/share/jarvis/>
Options FollowSymLinks
AllowOverride None
Require all granted
</Directory>
Secondly, CGI must be explicitly enabled:
a2enmod cgi
You may need to restart the Apache webserver:
apache2ctl restart
Apache Configuration - With mod_perl (Deprecated)
Jarvis supports the Apache mod_perl
mechanism. Without mod_perl
, the webserver must compile and execute the Perl code for each request. Using Apache mod_perl
, the script is only compiled once.
Database connections can also be re-used, and performance is generally superior. See the mod_perl
page at http://perl.apache.org/ for further details.
Configuration is as follows:
cd /etc/apache2/conf.d
rm jarvis.conf
ln -s /etc/jarvis/apache/jarvis-mod-perl.conf ./jarvis.conf
apache2ctl restart
Note: mod_perl
is deprecated, and not supported in new versions of Apache. You should use FastCGI instead.
Apache Configuration - With mod_perl & Drupal
Note: If you are co-hosting Jarvis on a server running Drupal from the root path, you will probably need to exclude jarvis-agent
from the Drupal rewrite rule. E.g. something like the following needs to be added to /usr/share/drupal6/.htaccess
file.
RewriteCond %{REQUEST_URI} !^/jarvis-agent/
Otherwise you will find that Drupal attempts to handle your jarvis-agent requests.
Note: This is only required when running with mod_perl
. When running via a simple ScriptAlias (see below), Apache will give priority to the Alias match over the Drupal match, and the problem does not arise.