1. DBPrism Installation and Configuration On NT |
Simply put the aim was to produce a set of instructions that not only configured
prism but educated the installer.
Mostly of all a set of instructions that helped people set up DB Prism (prism for short)
with no prior knowledge of Apache, Jserv etc. (If like me your background is oracle
development, then the initial learning curve can be fairly steep.)
This is NOT to say that Prism environment is harder to understand/install
than OAS - but Prism requires numerous 'steps' its not a one step installation.
Why jserv, well when I started out using earlier versions of Prism (OWSKiller),
jserv was one of the options, over the next year or so I expect TomCat to replace jserv,
but it works. It should work with any servlet engine, even OAS's!
I have excluded cocoon and xml generation, simply to keep it simple stupid KISS.
I have added this toward the end
At the end of these instructions you will have a working web server supporting servlets,
and prism configured so that you can generate html pages using pl/sql.
I keep an updated version of these with the zone files etc at
http://www.telecomrg.com/darylcollins
so they can be downloaded and maybe help get people up and running faster
Overview
|
|
There are numerous ways to configure the web server, jserv and oracle database,
just so I dont go insane, Im putting them all on the same box, an NT machine.
The configuration parts should apply across platforms but the install is different,
check the install instructions for each platform.
At the time of writing Apache on NT is not considered to be stable/secure enough
for production use, the intent here is not to configure a production server but a
sand box for experimentation. See the apache documentation about the release of Apache on NT.
This DOES NOT mean that Apache will crash every 2 minutes, in fact I've never seen that
happen in well over a year - the apache authors realize that the NT version is just not (yet)
up to the high standards of apache variants on Unix.
There are other servlet engines you could use, with various web servers,
but I'm not going there. I'm not going to open the can of worms that is the install
of an Oracle database (others have done this) I am assuming that this has been done.
The configuration I used is as follows
Pentium III 600 MHz , 128 MB RAM (IBM Think Pad)
Oracle 8.05 installed on drive D:/orant instance name ORCL
Apache 1.3.12
Jserv 1.1
JSDK 2.0
JDK 1.1.8.003
Prism 1.0.0
We will go through the install of each component, addressing downloads, installation
and configuration for each.
Why are there so many components?
Well Apache is the web server, Jserv is the servlet engine, the jsdk and jdk cannot
under Suns java license be released with jserv, so we need to install them to allow
the servlet engine to work JDK - Java Developers Kit JSDK - Java Servlet Developers Kit.
And last but not least Prism, which is the servlet that allows html/xml to be generated
from the database using pl/sql (ie the pl/sql cartridge replacement).
|
|
First things first we need a web server and Apache aint a bad one (maybe the best)
Download Apache from http://www.apache.org/
(Get the latest stable version when these instructions where written 1.3.12 was the latest
stable release. With later versions there may be differences in paths and install procedures.)
|
This is a self extracting exe
|
The instructions assume this goes in c:\program files\apache group\apache.
Select typical install accepting all defaults and this will be done automatically
In fact these instructions will put all the software under c:\program files\apache group\
in various directories. This DOES NOT have to be the case, you can install the software anywhere you want.
Of course following these instructions may get a little fuzzy if you choose not too.
|
Notable files
c:\program files\apache group\apache\conf\httpd.conf - this is the apache configuration file,
its very well documented.
c:\program files\apache group\apache\logs\errors.log - this is the apache error log -
useful for debugging problems later.
|
Did It Work?
There should be a program group 'Apache Web Server' with a start/stop apache icon.
Start Apache, a dos window should open, kick off a browser and goto url http://127.0.0.1/
You should see an html page saying
'If you can see this, it means that the installation of the Apache web server software
on this system was successful. You may now add content to this directory and
replace this page.'
Along with other things - if you want to change things go read the documentation,
follow the link at the bottom of the page
You may as well stop apache now, as we will have to restart it again soon, use stop apache
from the 'Apache Web Server' Group
|
|
This is self extracting, accept all the defaults except for the install directory
|
The instructions assume this goes in
C:\program files\apache group\jdk1.1.8
again this could be anywhere you want
|
|
Download JSDK (Java Servlet Development Kit) from
http://java.sun.com/
 |
Use 2.0, 2.1 will not work according to the apache jserv documentation,
this is subject to changes for later versions
|
|
The instructions assume this goes in
c:\program files\apache group\JSDK2.0
|
|
This is self extracting, accept all the defaults except for the install directory
|
The instructions assume this goes in
c:\program files\apache group\Apache JServ 1.1,
again this could be anywhere you want
|
You will be prompted for the location of the following files
' The java virtual machine' ie where is the java.exe?
c:\program files\apache group\jdk1.1.8\bin
' The directory JSDK 2.0 is installed in '
ie where is jsdk.jar c:\program files\apache group\jsdk2.0\lib
You will be asked if you want to modify the apache httpd.conf file,
select yes, this modifies the apache httpd.conf file to kick off jserv
when apache is brought up. You will be asked for the location of the httpd.conf file.
c:\program files\apache group\apache\conf
|
Notable Files
Apache Jserv extends the apache conf file with
# Include the configuration for Apache JServ 1.1
Include "c:\program files\apache group\Apache JServ 1.1\conf\jserv.conf"
The contents of jserv.conf are included into the httpd.conf (using the include directive,
this is why the jserv install asked you for the location of httpd.conf file).
This separates the jserv directives
(in c:\program files\apache group\Apache JServ 1.1\conf\jserv.conf)
from the apache directives.
We will return here as we need to configure jserv
|
Did jserv install OK?
Start Apache, kick off a browser and goto url http://127.0.0.1/jserv/
Keep the trailing slash. You should see an html jserv configuration page
|
|
|
So far we have a working web server with a servlet engine - now lets discuss the
basic ideas and concepts before moving on to configuration
|
There's some documentation about zones on the apache pages. Basically each zone
gets mounted by jserv, each zone is a collection of servlets(or just one servlet).
The zones are configured to execute the servlet when a request is made and return
(at least in our case) html. Our zone will be configured to execute Prism, Prism
executes the pl/sql and returns the html generated by it. Easy? Prism also has a
configuration file.
- jserv, configured to mount zones
- zone, configured to execute Prism servlet
- Prism, configured to connect to database
At first it appears to be confusing, but the architecture if flexible and versatile.
We will configure each file as needed. Once you have been through a few configurations
it becomes much easier, as your understanding grows it becomes a breeze. Remember
when we started the instructions where written to get you up and running without
having to load OAS, (since you will probably need to buy more RAM or upgrade NT to
the correct service pack, or like many just give up).
|
|
When an http request is serviced, apache would normally return and html file, no
mystery here. When a request is made to access a servlet, apache passes the request
onto jserv (apache gets configured to do this) jserv accesses the servlet (jserv
is configured to do this). When the request is made for a pl/sql procedure, all the
above happens the servlet - prism - executes the pl/sql (prism is configured to do
this) and returns html. Voila!
Browser <--> Apache <--> Jserv <--> Prism <--> PL/SQL
|
|
Lets assume I want to set up an url that looks like this http://127.0.0.1/dev/plsql/hw,
where hw is the name of a stored procedure (ah familiar territory for those coming
from the oracle database world)
|
Leave httpd.conf alone there is no need to add any configuration data here. Just
needed to mention it the documentation is very extensive. (and you have the documentation
installed for both apache and jserv locally)
|
We need to modify jserv.conf (sometimes called mod_jserv.conf depending on your platform)
to mount the zones we require (the jserv.conf file contains directives to the httpd
processes (ie apache) on how to handle the requests. So when we configure jserv.conf
we are in fact configuring apache on how to process certain requests.
|
This is an extension of mapping virtual paths to actual physical directories, or
executing cgi scripts or processing files of a certain extension in a particular
way (.xml for example). For jserv apache passes the request to the servlet engine.
|
|
5.3 Configure Servlet Engine |
Edit the file c:\program files\apache group\Apache JServ 1.1\conf\jserv.properties
5.3.4 Zone configuration files |
|
5.5 Prism - finally we get there |
Copy c:\program files\apache group\prism\conf\prism.properties to
c:\program files\apache group\Apache JServ 1.1\servlets\devprism.properties, remember
in dev.properties we pointed to this file.
|
|
Its is assumed that the pl/sql toolkit is installed, if you dont have a copy go
look its all over the web, once is at Search for XML Toolkit
We need one additional package, execute
c:\program files\apache group\prism\plsql\myows.sql
If you are using synonyms create a synonym.
|
|
5.7 When things do not work |
At the time of writing 1.7.3 was the latest, unzip the file to
c:\program files\apache group\cocoon-1.7.3
|
Edit c:\program files\apache group\prism\plsql\demo_bdy.sql
At the end of the file replace package initialization part with (this should have
changed at prism version 1.0.1)
BEGIN
url_server := 'http://127.0.0.1';
END demo;
also replace /servlets/ with /dev/ - this needs to be done throughout the file.
Remember we never set up servlets as a zone dev was used as our mount point. I do
this because I frankly feel there is something confused about calling a servlet
zone servlets.
|
Log into sql (same user used to add HW procedure)
run the following scripts found in the c:\program files\apache group\prism\plsql directory
xtp.sql
or xtp_public.sql for OAS/IAS/Web DB Toolkits
demo.sql
 | You will also need to have the demo tables added s_inventory etc. These normally
come with oracle (oci directory in a file summit2.sql) if not goto
http://www.telecomrg.com/darylcollins/
get the file and run it |
|
|
|
Since I wrote these instructions oracle have announced iAS and apache based web server.
OK short of going on a rant here Ill let it go at this. Oracle web development strategy
has been a mess from day one (iAS is an admission that OAS/WAS did not work) Its
still a mess - I prefer to focus on delivering high quality web based applications
than attempting to figure out Oracles strategy du jour. Prism/apache/cocoon are all
open source projects, while at first it may be a little unnerving to use these tools`- they
have one saving grace - they work and if you get involved you can help shape their
future directions and development. The other option, get dragged around by the nose
by Oracle.
You have a choice.
Michael Hagan for the feedback through
all versions of the instructions (his idea to write it up)
Gary Wong being the inspiration for
rewriting the instructions, and for pointing out numerous holes
Marcelo F.Ochoa for helping and explaining
stuff when I cant figure it out
If you find anything wrong let me know
ToDo List
|
|
|