Apache Configuration & Testing
Web-Server
The final task is to configure your web-server to give access to the Jarvis application.
Jarvis is a Perl service, and can operate under any web-server which supports Perl scripts. These include Microsoft IIS, Apache HTTPD and others.
Documentation is provided here for Apache 2.0 or greater. It should be able to be adapted easily to any other web-server’s configuration mechanism.
Apache Configuration - Without mod_perl
If performance is not a significant factor, you can simply run Jarvis as a CGI script without using mod_perl.
For Debian:
Under Debian, the package setup should be performed automatically. The package installation makes a soft link:
/etc/apache2/conf.d/jarvis.conf -> /etc/jarvis/apache/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/"
You may need to restart the apache webserver:
apache2ctl restart
For Other Systems:
ScriptAlias /jarvis-agent "/opt/jarvis/cgi-bin/agent.pl"
#Alias /jarvis/ "/opt/jarvis/htdocs/"
These lines are contained in the supplied apache/jarvis.conf
file. Under Linux you can generally copy or soft-link this file into the /etc/apache2/conf.d
directory.
Apache Configuration - With mod_perl
Jarvis supports the Apache mod_perl
mechanism. Without mod_perl
, the webserver must compile and execute the Perl code for each request. Equally, without mod_perl
, a new database connection must be made for each request.
Using Apache’s mod_perl
, the script is compiled once, and re-executed for each request. Database connections can also be re-used. The overhead for each request is greatly reduced. Refer to the mod_perl
home page (http://perl.apache.org/) for further details.
Once mod_perl
is configured and available, add the following lines to your server configuration.
Note: When installing the Debian package, this setup is done automatically.
For Debian:
PerlRequire /etc/jarvis/apache/startup.pl
<Location ~ "/jarvis-agent/.*">
SetHandler perl-script
PerlResponseHandler Jarvis::Agent
</Location>
#Alias /jarvis/ "/usr/share/jarvis/htdocs/"
For Other Systems:
PerlRequire /opt/jarvis/etc/apache/startup.pl
<Location ~ "/jarvis-agent/.*">
SetHandler perl-script
PerlResponseHandler Jarvis::Agent
</Location>
#Alias /jarvis/ "/opt/jarvis/htdocs/"
These lines are contained in the supplied apache/jarvis-mod-perl.conf
file. Under Linux you can generally copy or soft-link this file into the /etc/apache2/conf.d
directory.
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
.
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.
Test
To test that Jarvis is correctly installed, point your browser at the installed machine (e.g. localhost
) with the following URL:
http://localhost/jarvis-agent/
You should see the error response.
Missing path info. Send http://.../jarvis-agent/<app-name>/<dataset-name> in URI!
This indicates that Jarvis is installed, and is ready to be configured for an application.