You are on page 1of 20

Server-Side: The Basics

This part of the workshop contains an overview


of the two servers which OPeNDAP has
developed. One uses the Common Gateway
Interface (CGI) technology while the other uses
Java Servlets. This section also covers the
operations common to all DAP 2.0 compliant
servers. Finally, we also discuss various
security concerns such as configuring a server
with username/password access.


  
|  
Two Servers from OPeNDAP
Ɣ Both use a web server to provide networking
and access control
Ɣ One server* uses C/C++ and CGIs
Ɣ One server uses Java and Servlets
Ɣ Each can serve several types of data


   ±    

 

 

 
    
 
|        

        
       

       
 !  " 
     
‰hat the Servers do
Ɣ Return the four objects defined by theData
Access Protocol, version 2
± DAS: Semantic metadata
± DDS: Syntactic metadata
± DataDDS: Data with the relevant DDS parts
± Error: ‰hen a request cannot be satisfied


  
|  
Additional Server Responses
Ɣ Both servers also support some 'services.'
Ɣ Some service responses are made by
transforming one or more of the object
responses.
Ɣ Services:
± ASCII: Get data in ASCII
± Info: HTML-encoded metadata
± Simple access interface: An HTML form


  
|  
More Services...
Ɣ The ASCII, Info and Interface (aka
HTML)services work with a dataset.
Ɣ Other services return information about the
server:
± Version: Text data that identifies the server
± Directory: Provides a way to 'browse' data
sources
± Help: How to ask the server for different
responses

  
|  
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


  
|  
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

  
|  
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


  
|  
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

  
|  
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++V   

 


  
|  
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 to
match URLs to specific handlers.
Ɣ The server uses 'real' regular expressions
which can be quite complicated, but in
general a server's default dods.rc file is
sufficient.


  
|  
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
or ‰in32 executable.
± The Servlet server's handlers are written in
Java.*


   ± !   !#
  
 
  




 
$  $ 


|  
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?


  
|  
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


   



  

  


  

  !
" 


 #

|   
 
$%





&

'
'!
Aggregation
Ɣ The Java/Servlet-based Aggregation Server
works with netCDF files and other Array data.
Ɣ The CGI-based JGOFS server can aggregate
some types of point data.
Ɣ The GrADS Data Server (GDS) from COLA
can also perform aggregations.


  
|  
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)*


   ±% &     
   
 
    

|  
Installing and Testing a Server
Ɣ CGI-based servers
Ɣ Servlet-based servers
Ɣ Security


  
|  
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


  
|  
Servlet-based Servers
Ɣ Instructions for Tomcat; other servlet
engines* are similar
Ɣ Configure Tomcat
Ɣ Copy the dods.war file into Tomcat's
webapps directory and restart Tomcat
Ɣ Edit the ‰EB-INF/web.xml as per the server
directions


  
(
  
) 


)
 
 
|  
Security
Ɣ Security functions are provided by the web
server 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


  
|  

You might also like