Ingres versions running on non-Linux platforms have the Spyglass Web Server built into them. Ingres on Linux doesn't include Spyglass but the ICE (Internet Commerce Enabled) component of Ingres can be easily configured to provide HTTP access to databases. In this section we briefly examine how to connect Ingres to Apache, the most popular web server on Linux.
ingvalidpw
The first prerequisite for accessing Ingres databases through a web server
is the presence of the ingvalidpw
program. This program will validate the client's
identifier and password.
You have to build ingvalidpw
as root, by running the mkvalidpw
script.
Log in as root and set the environment as that of ingres, then simply type:
mkvalidpw
Your Linux distribution probably contains a pre-configured version of the Apache Web Server. If it doesn't, you can download either its binaries or source from http://www.apache.org, or one of its mirror sites. Building, installing and configuring Apache is beyond the scope of this HOWTO, we will cover only the parameters that play a role in connecting the web server to Ingres.
First, make sure that the mod_env module of Apache is compiled into the
binary. If you build Apache, put the following line into Configuration.tmpl
:
AddModule modules/standard/mod_env.o
If you have a pre-installed Apache, run it in the following way (provided
the executable's name is httpd.apache
):
$ httpd.apache -l
If you can't see mod_env.c
among the listed modules, rebuild Apache after
you have modified Configuration.tmpl
by adding the above mentioned line to
it.
The Apache server processes must run as ingres. There are two possible ways to achieve this.
The first method is to run the main process of Apache as root but start server processes as ingres. Although this is feasible, it creates so many problems that it is simply not worth the trouble.
For this reason, I suggest you configure the whole Apache system in the
environment of the ingres user. In the following example, I suppose that we
will put the Apache executable and all other Apache files in the /opt/ingres/apache
directory or directories under it. The following subdirectories need to be
created here:
cgi-bin conf logs
Copy the Apache executable to /opt/ingres/apache
, and put httpd.conf
, srm.conf
and access.conf
in /opt/ingres/apache/conf
.
Set the following lines in httpd.conf
:
Port 8000 -- must be greater than 1023 User ingres Group ingres ServerRoot /opt/ingres/apache ErrorLog /opt/ingres/apache/error_log TransferLog /opt/ingres/apache/access_log CustomLog /opt/ingres/apache/access_log common PidFile /opt/ingres/apache/httpd.pid ScoreBoardFile /opt/ingres/apache/apache_status Timeout 3000 -- or whatever you like, but the default value (300) is probably too small (it is measured in seconds) PassEnv II_SYSTEM PassEnv LD_LIBRARY_PATH
The last two lines must be added to httpd.conf
. These variables will be
passed from the environment of the ingres user to the environment of CGI programs
started from Apache (specifically iceinst
and ice
, the two executables of ICE).
Parameters to be set in srm.conf
:
DocumentRoot /opt/ingres/apache ScriptAlias /cgi-bin/ /opt/ingres/apache/cgi-bin/
DocumentRoot is the default directory for every document provided by Apache, while ScriptAlias is the directory containing the CGI programs.
To be modified in access.conf
:
<Directory /opt/ingres/apache/cgi-bin> AllowOverride None Options ExecCGI </Directory>
After you have edited the configuration files, start Apache. Supposing
again, that the Apache executable is called httpd.apache
:
/opt/ingres/apache/httpd.apache -f /opt/ingres/apache/conf/httpd.conf
It is time to configure ICE and its Tutorials. You can do this with a browser
and the iceinst
program. Let us suppose that, according to the previous example,
our CGI directory is /opt/ingres/apache/cgi-bin
and Apache is listening on
port 8000. Let the name of our machine be ingserv1. Then you can start iceinst
in the following manner:
$ iceinst -d/opt/ingres/apache/cgi-bin -u/cgi-bin -shttp://ingserv1:8000 -b/opt/netscape/netscape
Option -d is the full path to the CGI directory, -u is this directory's
address within the site, -s is the Internet address of the server, while -b
is the full path to the browser. If you omit option -b and write -remote instead,
then iceinst
won't try to start the browser. This way you can configure ICE
from another machine, directing your browser to
http://ingserv1/cgi-bin/iceinst
First the program asks for the value of II_SYSTEM. Then you should visit
every screen and set all parameters presented on them. Have iceinst
install
the Dynamic SQL Tutorial and the Macro Processor Tutorial as well. These show
the usage of ICE via applications and a database (icedb by default).
It is important to create a directory under Apache's DocumentRoot where
ICE can store the output it creates for clients' requests. ICE won't start
until you create this directory and specify its name in iceinst
.
After you have finished with every form, choose the Install and/or Uninstall Selected Components option. If you have set everything properly, the configuration of ICE and the installation of the tutorials take place. ICE is ready to use.