3.server basics
TRANSCRIPT
-
8/9/2019 3.Server Basics
1/20
9/21/04
James Gallagher
Server-Side: The Basics
This part of the workshop contains an overviewof the two servers which OPeNDAP has
developed. One uses the Common GatewayInterface (CGI) technology while the other usesJava Servlets. This section also covers theoperations common to all DAP 2.0 compliant
servers. Finally, we also discuss varioussecurity concerns such as configuring a serverwith username/password access.
-
8/9/2019 3.Server Basics
2/20
9/21/04
James Gallagher
Two Servers from OPeNDAP
Both use a web server to provide networkingand access control
One server* uses C/C++ and CGIs One server uses Java and Servlets
Each can serve several types of data
* In our documentation we often talk about 'the netCDF server' or the 'HDFserver.' In reality those are handlers or modules in the CGI-server. Similarly thDTS and DRDS are modules of the Java/Servlet-based server.
-
8/9/2019 3.Server Basics
3/20
9/21/04
James Gallagher
What the Servers do
Return the four objects defined by theDataAccess Protocol, version 2
DAS: Semantic metadata DDS: Syntactic metadata
DataDDS: Data with the relevant DDS parts
Error:When a request cannot be satisfied
-
8/9/2019 3.Server Basics
4/20
9/21/04
James Gallagher
Additional Server Responses
Both servers also support some 'services.'
Some service responses are made by
transforming one or more of the objectresponses.
Services:
ASCII: Get data in ASCII
Info: HTML-encoded metadata
Simple access interface: An HTML form
-
8/9/2019 3.Server Basics
5/20
9/21/04
James Gallagher
More Services...
The ASCII, Info and Interface (akaHTML)services work with a dataset.
Other services return information about theserver:
Version: Text data that identifies the server
Directory: Provides a way to 'browse' data
sources
Help: How to ask the server for different
responses
-
8/9/2019 3.Server Basics
6/20
9/21/04
James Gallagher
Summary of Server Responses
Four object-responses defined by DAP 2.0
DAS, DDS, DataDDS, Error
Six services:
ASCII, HTML metadata, HTML interface,
Directory
Version, Help
-
8/9/2019 3.Server Basics
7/20
9/21/04
James Gallagher
How a Server Handles a Request
The URL contains the host and
protocol ('localhost' and 'http' in
this example); IP addressing
locates httpd on the correct
machine.
The server recognizes the URL
as referencing a CGI.
The CGI is passed information
from the URL.
See also: Server Installation
Guide
-
8/9/2019 3.Server Basics
8/20
9/21/04
James Gallagher
The CGI Server's Architecture httpd: A web daemon
Dispatch Script: The CGI
program
A collection of 'handlers;'
each builds one of the
responses
The dispatch script chooses
which handler to run
-
8/9/2019 3.Server Basics
9/20
9/21/04
James Gallagher
How the Server Handles a
Request '/opendap/nph-dods'
selects the nph-dods CGI
based on the web server's
configuration.
The '.dds' suffix tells nph-
dods this is a request for a
DDS object.
The data source name's
'.nc' suffix tells nph-dods to
use the netCDF family of
handlers
-
8/9/2019 3.Server Basics
10/20
9/21/04
James Gallagher
OPeNDAP Servlet Compared to
CGI The Servlet- and CGI-based server's are
conceptually similar:
Both use a web server Both use a dispatch mechanism (CGI: nph-dods,
Servlet: DODSServlet.java)
Both delegate response generation to 'handlers'
(CGI: programs written in C++, Servlet: Javaclasses)
-
8/9/2019 3.Server Basics
11/20
9/21/04
James Gallagher
How the Server Chooses a
Handler The CGI-based server uses a configuration
file named 'DODS/etc/dods.rc'.
In that file, regular expressions are used tomatch URLs to specific handlers.
The server uses 'real' regular expressionswhich can be quite complicated, but in
general a server's default dods.rc file issufficient.
-
8/9/2019 3.Server Basics
12/20
9/21/04
James Gallagher
Servlet/CGI Comparison, cont.
Differences:
The CGI server uses Perl for the Dispatch, the
Servlet software uses Java The CGI server's handlers can be written in C++,
C, Python, ..., anything that can produce an Unix
orWin32 executable.
The Servlet server's handlers are written inJava.*
* J
'
JNI
l
t
f
r
li
t
ritt
i
t
r l
g
g
.
-
8/9/2019 3.Server Basics
13/20
9/21/04
James Gallagher
Choosing a server
Are the data stored in a 'standard' format?
Are the data stored in files that need to be
aggregated? Are the data stored using an 'in-house'
format?
Other considerations: CGI- or Servlet-based?
-
8/9/2019 3.Server Basics
14/20
9/21/04
James Gallagher
Standard formats
The Perl/C++ CGI-server supports:
netCDF
HDF4, HDF5*
Matlab
U. of Miami DSP
The Java Servlet-server supports:
SQL (uses JDBC drivers)
netCDF
* HDF5 has not publicly been released but is available by request. Testing is not complete, but
some testing work has been donated to the project by Bob Bane.
-
8/9/2019 3.Server Basics
15/20
9/21/04
James Gallagher
Aggregation
The Java/Servlet-based Aggregation Serverworks with netCDF files and other Array data.
The CGI-based JGOFS server can aggregatesome types of point data.
The GrADS Data Server (GDS) from COLAcan also perform aggregations.
-
8/9/2019 3.Server Basics
16/20
9/21/04
James Gallagher
Support for in-house formats
The Perl/C++ CGI-based server:
Data which can be described using FreeForm
Data which can be read using a JGOFS method
The Java/Servlet-based server:
Data in relational databases can be served using
the DODS Relational Database Server (DRDS)*
* A RDB has many of the characteristics of an in-house format.
-
8/9/2019 3.Server Basics
17/20
9/21/04
James Gallagher
Installing and Testing a Server
CGI-based servers
Servlet-based servers
Security
-
8/9/2019 3.Server Basics
18/20
9/21/04
James Gallagher
Install the CGI-Based Server
Configure the web server
Choose directories for both the server and the
data Modify the web server's configuration
accordingly
Use the installServers script to copy the CGI-
Based server's components Copy or link the data files
-
8/9/2019 3.Server Basics
19/20
9/21/04
James Gallagher
Servlet-based Servers
Instructions for Tomcat; other servletengines* are similar
Configure Tomcat Copy the dods.war file into Tomcat's
webapps directory and restart Tomcat
Edit theWEB-INF/web.xml as per the server
directions
Seeser le m f r a l s f ser le e g es
-
8/9/2019 3.Server Basics
20/20
9/21/04
James Gallagher
Security
Security functions are provided by the webserver and/or servlet engine
Apache provides:
HTTP over SSL (HTTPS)
Several authentication schemes (Basic, Digest)
'Realm' limits per user, group and IP address
OPeNDAP servers support all of these
OPeNDAP clients support HTTP proxies