2018-07-02 11:56:59 +08:00
|
|
|
/**
|
|
|
|
@if INTERNAL
|
2018-06-30 05:06:27 +08:00
|
|
|
|
2018-07-02 11:56:59 +08:00
|
|
|
@page remotesvc Remote Test Server Setup
|
2018-06-30 05:06:27 +08:00
|
|
|
|
|
|
|
\tableofcontents
|
|
|
|
|
2018-07-02 11:56:59 +08:00
|
|
|
<!-- Note that this file has the .dox extension, but is mostly markdown -->
|
|
|
|
<!-- Begin MarkDown -->
|
|
|
|
|
|
|
|
# Introduction {#remotesvc_intro}
|
2018-06-30 05:06:27 +08:00
|
|
|
|
|
|
|
The test suite for the DAP2 and DAP4 (aka DAP) protocols optionally
|
|
|
|
uses a continuously running test server to verify that the
|
|
|
|
DAP protocols can successfully be used against a remote server such
|
2021-02-27 06:12:08 +08:00
|
|
|
as a Unidata THREDDS Data Server or a OPeNDAP Hyrax server.
|
2018-06-30 05:06:27 +08:00
|
|
|
|
|
|
|
The way that this is tests is to establish two servlets running
|
|
|
|
under a Tomcat server on some machine with a known IP address
|
|
|
|
or DNS name. For example, accessing this URL.
|
|
|
|
````
|
2020-01-04 04:12:58 +08:00
|
|
|
https://remotetest.unidata.ucar.edu/dts/
|
2018-06-30 05:06:27 +08:00
|
|
|
````
|
|
|
|
will bring up a page with a variety of DAP2 accessible files.
|
|
|
|
These files are accessed by the netcdf-c test case
|
|
|
|
_netcdf-c/ncdap_test/tst_remote3.sh_
|
|
|
|
to verify that the whole
|
|
|
|
transmission and conversions process worked correctly.
|
|
|
|
Similarly, the DAP4 test case is
|
|
|
|
_netcdf-c/ncdap_test/test_remote.sh_
|
|
|
|
and it accesses the test server web page with this URL.
|
|
|
|
````
|
2020-01-04 04:12:58 +08:00
|
|
|
https://remotetest.unidata.ucar.edu/d4ts/
|
2018-06-30 05:06:27 +08:00
|
|
|
````
|
|
|
|
Setting up and Maintaining the test server involves a somewhat complex
|
|
|
|
set of tasks. This document shows how to do those tasks.
|
|
|
|
|
2018-07-02 11:56:59 +08:00
|
|
|
# Tomcat Setup {#remotesvc_tomcat}
|
2018-06-30 05:06:27 +08:00
|
|
|
|
|
|
|
The initial task is to setup a Tomcat server on some machine.
|
|
|
|
Currently the remote server is operating on Jetstream on an Ubuntu Linux
|
|
|
|
environment.
|
|
|
|
|
|
|
|
Assuming you do not already have Tomcat setup, the necessary steps are
|
|
|
|
as follows.
|
|
|
|
|
|
|
|
1. Login to your machine - let us call it "testserver.unidata.edu".
|
|
|
|
2. Use the package manager to install two packages using commands like this.
|
|
|
|
````
|
|
|
|
sudo apt-get tomcat7
|
|
|
|
sudo apt-get tomcat7-admin
|
|
|
|
````
|
|
|
|
Note that this installs Tomcat version 7. Later versions should also work.
|
|
|
|
3. Goto the tomcat7 installation, probably ''/usr/share/tomcat7'',
|
|
|
|
and modify the configuration as described in the next section.
|
|
|
|
4. Startup tomcat using the following commands.
|
|
|
|
````
|
|
|
|
cd /usr/share/tomcat7/bin
|
|
|
|
./startup.sh
|
|
|
|
````
|
|
|
|
It is possible that the startup command may need to be executed with ''sudo''.
|
|
|
|
5. Verify that tomcat is running by trying this URL in your web browser.
|
|
|
|
````
|
|
|
|
http:testserver.unidata.edu:8080
|
|
|
|
````
|
|
|
|
The port -- 8080 -- is the default for an installed tomcat. It may be that
|
|
|
|
you will need to change it as part of the configuration process.
|
|
|
|
6. Try the administration web page
|
|
|
|
````
|
|
|
|
http:testserver.unidata.edu:8080/manager
|
|
|
|
````
|
|
|
|
This should pop-up a user+password dialog box. You should fill it in
|
|
|
|
with the values you choose during configuration.
|
|
|
|
The resulting final page will be the one you use to get the dts and d4ts
|
|
|
|
servlets operating.
|
|
|
|
7. Use the commands
|
|
|
|
````
|
|
|
|
cd /usr/share/tomcat7/bin
|
|
|
|
./shutdown.sh
|
|
|
|
````
|
|
|
|
to stop the Tomcat server.
|
|
|
|
|
2018-07-02 11:56:59 +08:00
|
|
|
# Configuring Tomcat {#remotesvc_cfg}
|
2018-06-30 05:06:27 +08:00
|
|
|
|
|
|
|
In the primary Tomcat directory -- probably /usr/share/tomcat7 --
|
|
|
|
there should be a ''conf'' directory, and in that directory,
|
|
|
|
you will need to edit the file ''tomcat-users.xml''.
|
|
|
|
|
2018-07-02 11:56:59 +08:00
|
|
|
## Configuring tomcat-users.xml {#remotesvc_tomcat_users}
|
2018-06-30 05:06:27 +08:00
|
|
|
|
|
|
|
The goal here is primarily to setup a user that can login to the
|
|
|
|
Tomcat admin page to upload the dts and d4ts servlets.
|
|
|
|
Let us assume that the username we want to use is ''dapadmin''
|
|
|
|
with password ''dap''.
|
|
|
|
|
|
|
|
Edit the ''tomcat-users.xml'' file.
|
|
|
|
You will probably have to use ''sudo'' to access the file.
|
|
|
|
Insert the following near the end of the file.
|
|
|
|
````
|
|
|
|
<role rolename="manager-gui"/>
|
|
|
|
<user username="dapadmin" password="dap" roles="admin,manager-gui"/>
|
|
|
|
````
|
|
|
|
|
2018-07-02 11:56:59 +08:00
|
|
|
## Configuring server.xml {#remotesvc_config_server_xml}
|
2018-06-30 05:06:27 +08:00
|
|
|
|
|
|
|
As a rule, the default settings in ''server.xml'' will work
|
|
|
|
and provide insecure access to the Tomcat server via port 8080.
|
|
|
|
This is ok if the test server is running nothing but the d4ts and dts
|
|
|
|
test servlets. Otherwise, you should investigate how to
|
|
|
|
get the Tomcat server to use <em>https:</em>
|
|
|
|
|
2018-07-02 11:56:59 +08:00
|
|
|
# Loading dts.war and d4ts.war {#remotesvc_load_war}
|
2018-06-30 05:06:27 +08:00
|
|
|
|
|
|
|
The next step is to actually upload the servlet files for the DAP
|
|
|
|
test servlets. We assume that you have on your local disk two files:
|
|
|
|
''dts.war'' and ''d4ts.war''. Building those servlet war files is
|
|
|
|
described in a separate section.
|
|
|
|
|
|
|
|
The specific tasks are as follows:
|
|
|
|
1. Open the web page
|
|
|
|
````
|
|
|
|
http:testserver.unidata.edu:8080/manager
|
|
|
|
````
|
|
|
|
Scroll down to the block labelled ''WAR file to deploy'',
|
|
|
|
which should have two buttons: ''Browse'' and ''Deploy''.
|
|
|
|
2. Clicking on the browse button should bring up a file dialog box.
|
|
|
|
Use the dialog box to choose ''dts.war''.
|
|
|
|
3. After choosing that file, click the ''Deploy'' button.
|
|
|
|
After some delay, this should add
|
|
|
|
a new entry in the first column near the top of the page.
|
|
|
|
That entry should be named ''/dts''.
|
|
|
|
4. If you click the ''/dts'' in the first column, then it should take you
|
|
|
|
to the DAP2 test server main page.
|
|
|
|
5. Repeat to load ''d4ts.war'' as ''/d4ts''.
|
|
|
|
|
2018-07-02 11:56:59 +08:00
|
|
|
# Testing the Test Server {#remotesvc_testing}
|
2018-06-30 05:06:27 +08:00
|
|
|
|
|
|
|
You can now test the test server by configuring and building
|
|
|
|
the netcdf-c library. In order to force the use
|
|
|
|
of the newly started test server you can either:
|
|
|
|
1. Add the option
|
|
|
|
````
|
|
|
|
--with-testservers=testserver.unidata.edu
|
|
|
|
````
|
|
|
|
This will override the defaults.
|
|
|
|
|
|
|
|
2. Edit configure.ac and find the string "svclist".
|
|
|
|
Replace the list with "testserver.unidata.edu".
|
|
|
|
This will make the new test server be the default.
|
|
|
|
|
|
|
|
After building the library, go into the directory ''ncdap_test''
|
|
|
|
and do a ''make check'' command. This should succeed.
|
|
|
|
Similarly enter the directory ''dap4_test'' and do a make check
|
|
|
|
to verify that the d4ts test server is working.
|
|
|
|
|
2018-07-02 11:56:59 +08:00
|
|
|
# Building d4ts.war and dts.war {#remotesvc_buildservlets}
|
2018-06-30 05:06:27 +08:00
|
|
|
|
|
|
|
In order to build the servlet (.war) files, you will need to
|
2021-02-27 06:12:08 +08:00
|
|
|
clone the Thredds directory on github: https://github.com/Unidata/tds.
|
2018-06-30 05:06:27 +08:00
|
|
|
|
2021-02-27 06:12:08 +08:00
|
|
|
Once you have a clone, you will need to enter the tds directory
|
2018-06-30 05:06:27 +08:00
|
|
|
and build by invoking gradle using this command.
|
|
|
|
````
|
|
|
|
./gradlew --info --no-daemon clean assemble
|
|
|
|
````
|
|
|
|
If successful, the following two files should exist
|
|
|
|
(the names may vary slightly).
|
|
|
|
|
|
|
|
1. ./dap4/d4ts/build/libs/d4ts-5.0.0-SNAPSHOT.war
|
|
|
|
2. ./opendap/dtswar/build/libs/dtswar-5.0.0-SNAPSHOT.war
|
|
|
|
|
|
|
|
Copy the two files to some more accessible place and rename them
|
|
|
|
to ''d4ts.war'' and ''dts.war'' respectively.
|
|
|
|
|
|
|
|
Use those files to upload the servlets to your Tomcat server
|
|
|
|
as described above.
|
|
|
|
|
2018-07-02 11:56:59 +08:00
|
|
|
# Point of Contact {#remotesvc_poc}
|
2018-06-30 05:06:27 +08:00
|
|
|
|
|
|
|
__Author__: Dennis Heimbigner<br>
|
2018-07-02 11:56:59 +08:00
|
|
|
__Email__: dmh at ucar dot edu<br>
|
2018-06-30 05:06:27 +08:00
|
|
|
__Initial Version__: 6/26/2018<br>
|
|
|
|
__Last Revised__: 6/28/2018
|
|
|
|
|
2018-07-02 11:56:59 +08:00
|
|
|
<!-- End MarkDown -->
|
|
|
|
|
|
|
|
@endif
|
|
|
|
|
2018-06-30 05:06:27 +08:00
|
|
|
*/
|