4d059511c99714a932e1e4a484215a2f.ppt
- Количество слайдов: 20
James Gallagher 9/21/04 Server-Side: The Basics This part of the workshop contains an overview of the two servers which OPe. NDAP 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.
James Gallagher 9/21/04 Two Servers from OPe. NDAP ● ● 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
James Gallagher 9/21/04 What the Servers do ● Return the four objects defined by the. Data Access Protocol, version 2 – DAS: Semantic metadata – DDS: Syntactic metadata – Data. DDS: Data with the relevant DDS parts – Error: When a request cannot be satisfied
James Gallagher 9/21/04 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
James Gallagher 9/21/04 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
James Gallagher 9/21/04 Summary of Server Responses ● Four object-responses defined by DAP 2. 0 – ● DAS, DDS, Data. DDS, Error Six services: – ASCII, HTML metadata, HTML interface, Directory – Version, Help
James Gallagher 9/21/04 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
James Gallagher 9/21/04 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
James Gallagher 9/21/04 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 nphdods this is a request for a DDS object. The data source name's '. nc' suffix tells nph-dods to use the net. CDF family of handlers
James Gallagher 9/21/04 OPe. NDAP 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: Java classes)
James Gallagher 9/21/04 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.
James Gallagher 9/21/04 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 Win 32 executable. – The Servlet server's handlers are written in Java. *
James Gallagher 9/21/04 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?
James Gallagher 9/21/04 Standard formats ● The Perl/C++ CGI-server supports: – – HDF 4, HDF 5* – Matlab – ● net. CDF U. of Miami DSP The Java Servlet-server supports: – SQL (uses JDBC drivers) – net. CDF
James Gallagher 9/21/04 Aggregation ● ● ● The Java/Servlet-based Aggregation Server works with net. CDF files and other Array data. The CGI-based JGOFS server can aggregate some types of point data. The Gr. ADS Data Server (GDS) from COLA can also perform aggregations.
James Gallagher 9/21/04 Support for in-house formats ● The Perl/C++ CGI-based server: – – ● Data which can be described using Free. Form 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)*
James Gallagher 9/21/04 Installing and Testing a Server ● ● ● CGI-based servers Servlet-based servers Security
James Gallagher 9/21/04 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 install. Servers script to copy the CGIBased server's components Copy or link the data files
James Gallagher 9/21/04 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 WEB-INF/web. xml as per the server directions
James Gallagher 9/21/04 Security ● ● Security functions are provided by the web server and/or servlet engine Apache provides: – – ● Several authentication schemes (Basic, Digest) – ● HTTP over SSL (HTTPS) 'Realm' limits per user, group and IP address OPe. NDAP servers support all of these OPe. NDAP clients support HTTP proxies
4d059511c99714a932e1e4a484215a2f.ppt