...
ADAGUC is a WMS-based implementation, made by KNMI. Its distinct feature is to serve time-enabled raster data, from NetCDF file or OPeNDAP server, to (web) clients using the WMS protocol.
For more information on ADAGUC and its features please visit KNMI's ADAGUC pages http://dev.knmi.nl/projects/adaguc
ADAGUC consists of
- a server part
- a client/viewer part
This Tech Note describes how to setup ADAGUC on CentOS 6.4 Linux. This was performed on a local Virtual Machine as an exercise before setting up a production machine for ADAGUC.
...
CentOS (http://www.centos.org) is based on the same sources as Red Hat Enterprise Linux.
KNMI describes installation on Red Hat Linux here: http://dev.knmi.nl/projects/adagucserver/wiki/Installation
This recipe has been followed. In short it is repeated here.
Note: unless otherwise stated, the commands are (Bash) shell commands.
Setup prerequisites
- Verify yum configuration for EPEL repository:
...
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="3b433f9e-77ed-4a13-a9b2-b0d488a731de"><ac:plain-text-body><![CDATA[
[mylocalhost]# yum repolist
...
]]></ac:plain-text-body></ac:structured-macro>
- Install from EPEL repository (compiling netcdf and hdf5 is not needed in this case)
...
- :
...
[mylocalhost]# yum install gcc gcc-c++ mercurial libpng-devel zlib-devel libxml2-devel gd-devel netcdf-devel hdf5-devel proj-devel postgresql-devel udunits2-devel gdal-devel cairo-devel httpd postgresql-server
...
Note: somehow this install was not completed successfully because later on the compiler complained about missing dependencies. I just re-executed this yum install (with all packges listed) and after that all worked fine.
Compile ADAGUC server
- Setup a directory structure for ADAGUC in /opt:
/opt/adaguc/adagucviewer
stores ADAGUC client/viewer related files and components
/opt/adaguc/services
stores ADAGUC server runtime related configuration, logs and optionally data
/opt/adaguc/software
tree with ADAGUC server source files; should not be present on a production environment
CentOS has a default Apache installation and this will be used for ADAGUC. Hence ownership of all files and directories involved is assigned explicitly to OS-user apache and OS-group apache (apache:apache).
- get ADAGUC server source components from KNMI's Mercurial repository:
...
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="50485788-bcad-4aa5-8155-dd5b0b0e8ff8"><ac:plain-text-body><![CDATA[
[mylocalhost]# hg clone http://dev.knmi.nl/hg/adagucserver /opt/adaguc/software
...
- start compile by executing compile.sh from /opt/adaguc/software directory. It could be necessary to set the executbale flag first
...
- :
...
[mylocalhost]# chmod +x compile.sh
...
]]></ac:plain-text-body></ac:structured-macro>
[
...
mylocalhost]# ./compile.sh
...
The compilation results in a binary in the /opt/ADAGUC/software/adagucserverEC directory.
...
The ADAGUC viewer uses some PHP scripts. For this the Apache mod_php is needed. This is not installed by default on CentOS. To install:
[ | CDATA[[mylocalhost]# yum install mod_php | ]]></ac:plain-text-body></ac:structured-macro> |
---|
This yum installation suffices; Apache on CentOS is set up in such a way that there is no need for explicit changes to configuration in order to enable this new module. An Apache restart is required afterwards.
...
ADAGUC server requires a PostgreSQL RDBMS. PostgreSQL is not installed by default on CentOS. It should have been installed by the Setup prerequisites actions. I'm not sure why I (re)installed PostgreSQL here.
- Install PostgreSQL
...
[mylocalhost]# yum install postgresql.x86_64
...
]]></ac:plain-text-body></ac:structured-macro>
- Initialise database
(PostgreSQL data directory : /var/lib/pgsql/data)
...
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="6460c606-0ef8-408d-bb39-db7263b3c7db"><ac:plain-text-body><![CDATA[
[mylocalhost]# service postgresql initdb
...
]]></ac:plain-text-body></ac:structured-macro>
- If necessary change connection constraints in /var/lib/pgsql/data/pg_hba.conf.
Code Block # TYPE DATABASE USER CIDR-ADDRESS METHOD # "local" is for Unix domain socket connections only local all all trust # IPv4 local connections: host all all 127.0.0.1/32 trust
After making changes, perform:
...
:
...
[mylocalhost]# service postgresql reload | ]]></ac:plain-text-body></ac:structured-macro> |
---|
- Enable PostgreSQL service startup at boot time
...
[mylocalhost]# chkconfig postgresql on
...
- Create ADAGUC database
...
[
...
mylocalhost]# su - postgres
...
- Start psql client
...
- :
...
[mylocalhost]# psql
...
]]></ac:plain-text-body></ac:structured-macro>
- and execute these SQL statements:
Code Block create user adaguc password 'adaguc'; create database mydemo with owner=adaguc; grant connect on database mydemo to adaguc; grant all on database mydemo to adaguc;
In essence the ADAGUC server is now ready to use. http://dev.knmi.nl/projects/adagucserver/wiki/Tutorials shows by examples how to setup and configure WMS with ADAGUC.
...
So for the ADAGUC setup a neat solution should be thought of which:
- fully enables SELinux security
- allow non-root users to setup ADAGUC WMS services
This is still to be done before a production environment for ADAGUC could be deployed.
...
The ADAGUC Viewer is a mix of JavaScript and PHP coding. Setup of the viewer on a web server is done as follows:
- get ADAGUC viewer components from KNMI's Mercurial repository:
...
[
...
mylocalhost]# hg clone http://dev.knmi.nl/hg/adagucviewer /opt/adaguc
...
- Apache's mod_php should be installed and functional. This is already described in de ADAGUC Server setup previously.
- Apache configuration
The DocumentRoot setting in de VirtualHost section in /etc/httpd/conf/httpd.conf is directed to /opt/adaguc/adagucviewer/
If this is setup then the ADAGUC viewer will load in the web browser when it is pointed to the web server.