DEOS Systems Setup

DEOS Technical Note #9

Dr. Geoffrey E. Quelch

Research Fellow,
University of Delaware,
Center for Climatic Research


   University of Delaware
   NewarkDE 19716
   
  

Version 2

All material herein is copyright by the Delaware Environmental Observing System

Published: February 24th 2004

Revision History
Revision 1.12004/02/24GEQ
Initial version
Revision 1.22004/03/30GEQ
Added description of ODD-DIVAS required component installations.
Revision 1.32004/04/21GEQ
Updated description of ODD-DIVAS for 1.1.6 release.
Revision 1.42004/07/28GEQ
Updated description of installation of ODD-DIVAS and required components following install at the University of Delaware.
Revision 1.52004/08/05GEQ
Added SetEnv description to the Apache setup to remove ORA-12154 error.
Revision 1.62004/09/20GEQ
Added Oracle install workaround link.
Revision 1.72004/10/20GEQ
Added Oracle SetEnv parameters for security.
Revision 1.82004/11/03GEQ
Added adminpro setup.
Revision 1.92004/12/14GEQ
Added /etc/profile info. Modified database setup for 1.1.7 release.
Revision 1.102004/12/22GEQ
Revised for PHP version 4.3.10.
Revision 1.112005/01/25GEQ
Fix order error in database setup and grants.
Revision 1.122005/02/01GEQ
Added description of sendmail setup.
Revision 1.132005/02/02GEQ
Added public NTP servers entry. Added description of USGS, RAWS and NDBC metadata loading.
Revision 1.142005/02/05GEQ
Corrected PHP build line.
Revision 1.152005/06/02GEQ
Updated database install procedure to clarify the need for timezone to be set on the database.
Revision 1.162005/08/10GEQ
Revised for PHP version 4.4.0.
Revision 1.172005/08/30GEQ
Added setting of database time zone. Added the ODD-DIVAS configuration section.
Revision 1.182005/08/31GEQ
Replaced ftplib with cURLpp. Added nexrad_data to schema install.
Revision 1.192005/10/19GEQ
Revised for Apache version 1.3.34. Modified links to Apache and PHP sites.
Revision 1.202005/10/21GEQ
Added footnote describing the symptoms expected if the database timezone isn't set correctly.
Revision 1.212005/10/26GEQ
Added internal links.
Revision 1.222005/12/02GEQ
Added internal link to the ODD-DIVAS configuration section. Added the gPRO setting description. Added new PHP configure statement for ODD-DIVAS to use the truetype fonts needed by the wind rose component of JpGraph. Added link to web site describing install of true-type fonts. Added move of existing ODD-DIVAS cache.
Revision 1.232005/12/06GEQ
Corrected bug in freetype option on PHP configure command.
Revision 1.242005/12/16GEQ
Added DCF configuration file section. Added eAccelerator install instructions.
Revision 1.252006/01/05GEQ
Added database statistics generation procedure.
Revision 1.262006/01/23GEQ
Added PHP 4.4.1 and link to the Apache/PHP build section for 1.2.2 changelog.
Revision 1.272006/01/30GEQ
Added target for JpGraph install.
Revision 1.282006/02/03GEQ
Added PHP 4.4.2 and instructions for rebuilding eAccelerator for new PHP version.
Revision 1.292006/03/08GEQ
Added "eaccelerator.log_file" and altered "eaccelerator.filter" options for eAccelerator. Added link to eAccelerator install section. Clarified eAccelerator install instructions and updated version to 0.9.4. Fixed typos and specified JpGraph 1.21.
Revision 1.302006/04/04GEQ
Added gPAGING to DCF configuration description.
Revision 1.312006/05/09GEQ
Added city and county metadata loading links. Revised all metadata links to use section IDs.
Revision 1.322006/07/13GEQ
Added METAR station county metadata loading link.
Revision 1.332006/08/24GEQ
Added PHP 5 install and related issues.
Revision 1.342006/08/25GEQ
Added data feeds outline.
Revision 1.352006/09/06GEQ
Added index.php requirement in the Apache configuration section.
Revision 1.362006/09/11GEQ
Added local-host-names configuration to sendmail section. Added Oracle 10g software install pointer. Added PL/SQL compiler mode. Added revised curlpp library generation for Oracle 10g.
Revision 1.352006/09/14GEQ
Added note indicating that the apache owner needs to be in the oracle ownership group. Updated the oracle settings for Oracle 10g.
Revision 2.12006/09/26GEQ
Incremented version number of this document to 2.
Revision 2.22006/09/27GEQ
Updated to Apache 1.3.37 and PHP 5.1.6.
Revision 2.32006/09/28GEQ
Added configuration of short_open_tag to PHP configuration section.
Revision 2.42006/09/29GEQ
Added control panel configuration details to eAccelerator configuration section. Added instructions for setting the plsql_native_library_dir database variable.
Revision 2.52006/10/02GEQ
Updated database statistics section to indicate that they are only needed for Oracle 9i.
Revision 2.62006/11/07GEQ
Updated for PHP version 5.2.0 and eAccelerator 0.9.5.
Revision 2.72006/11/14GEQ
Added the note concerning multiple servers. Added web service install section.
Revision 2.82006/12/06GEQ
Revised database setup and removal to use the command line option.
Revision 2.82006/12/18GEQ
Added requirement for tiff and XFree86 development package install.
Revision 2.92007/2/19GEQ
Added PHP 5.2.1 and requirement for xsl configuration in building PHP.
Revision 2.102007/2/20GEQ
Added PHP memory_limit setting.
Revision 2.112007/2/23GEQ
Revised PHP memory_limit setting to 200M. Added system time recommendation.
Revision 2.122007/3/28GEQ
Revised create_users procedure to add required SYSDBA option. Updated cURL web site URL. Added curl-devel RPM requirement. Added libxml and libxslt version requirement recommendations. Changed JpGraph version to 2.2 and revised name of its configuration file.
Revision 2.122007/04/09GEQ
Revised PHP/Apache install procedure.
Revision 2.132007/06/18GEQ
Added PHP version 5.2.3.
Revision 2.142007/06/25GEQ
Added df update instructions.
Revision 2.152007/08/02GEQ
Added dgep installation instructions.
Revision 2.152007/08/24GEQ
Added eAccelerator version 0.9.5.1.
Revision 2.162007/08/31GEQ
Added PHP version 5.2.4.
Revision 2.1.42007/09/04GEQ
Added eAccelerator version 0.9.5.2. Added Apache 1.3.39. Changed to version based document revision numbers. Changed to PHP 5.2.4. Added Apache STATIONS variable.
Revision 2.1.72008/03/21GEQ
Added Apache 1.3.41. Added gcrypt error message and fix. Added PHP 5.2.6. Added curl support to PHP build.
Revision 2.1.92010/09/12GEQ
Added Apache 1.3.42. Added PHP 5.2.14. Added install of XTides.
Revision 2.2.220XX/XX/XXGEQ
Fixed typo.

Table of Contents

Introduction
Operating System
Installation
Configuration
Oracle
Software Installation
System Setup
Oracle Client
DEOS Software
Installation
Other Software
cURLpp Library
JpGraph Library
Other Libraries
Apache and PHP
eAccelerator PHP Extension
XTide Program

Introduction

This document summarizes the required software configurations of machines forming the DEOS system. Included are operating system settings, configuration and installed software, Oracle version and settings.

Operating System

The following are installation details for the DEOS systems. All hardware systems forming a part of the DEOS system are configured similarly from the operating system perspective except where noted below.

Installation

The Installation of the Linux (ES or AS) operating system is to be performed as per the default for "Server". It is recommended that the system time for the server is set to UTC/GMT. The following items are required to be installed:

Configuration

The following items need to be configured.

Network Access Controls

The following files need to contain the indicated information.

/etc/hosts.allow

This file needs to have no non-comment lines.

/etc/hosts.deny

ALL: ALL EXCEPT 127.0.0.1

Other hosts, preferably by name, shall be entered on this line or additional lines.

Sendmail

The sendmail program is required by DEOS to provide distribution of real-time alerts.

Required Redhat Packages

The following packages are required.

  • sendmail; this is the base sendmail software.

  • sendmail-cf; this allows the sendmail package to be configured using a simpler method than the default.

local-host-names File Configuration

The /etc/mail/local-host-names should contain all the names that the machine is known as, this allows mail from users on the machine to get to other users on the machine and not generate an error.

Sendmail Configuration Procedures

Once the required packages are installed, perform the following procedures.

Procedure 1. Configure Sendmail To Send Mail For DEOS

  1. Change to the /etc/mail directory (this contains the configuration files for sendmail)

  2. Ensure that the sendmail.mc contains the settings as shown below (most will be set in the default file.)

  3. Type "make -C /etc/mail"

  4. Type "/etc/init.d/sendmail restart"

Procedure 2. Configure Sendmail To Receive Email (optional)

  1. Change to the /etc/mail directory (this contains the configuration files for sendmail)

  2. Edit the "local-host-names" file and add the domain names that will be receiving email on this machine.

  3. Edit the "virtusertable" file and add any addresses in the domains handled that require the email to be sent to a different email address. (This facility is for people who don't have an account on this machine, but want to get mail to the domain handled by this machine.

  4. For each domain listed in the local-host-names file, an MX entry in the DNS server for the domain will be required to point to this machine.

  5. Ensure that the sendmail.mc contains the settings as shown below (most will be set in the default file.)

  6. Type "make sendmail.cf"

  7. Type "/etc/init.d/sendmail restart"

Example 1. Sendmail Configuration File


divert(-1)dnl
dnl #
dnl # This is the sendmail macro config file for m4. If you make changes to
dnl # /etc/mail/sendmail.mc, you will need to regenerate the
dnl # /etc/mail/sendmail.cf file by confirming that the sendmail-cf package is
dnl # installed and then performing a
dnl #
dnl #     make -C /etc/mail
dnl #
include(`/usr/share/sendmail-cf/m4/cf.m4')dnl
VERSIONID(`setup for Red Hat Linux')dnl
OSTYPE(`linux')dnl
dnl #
dnl # Uncomment and edit the following line if your outgoing mail needs to
dnl # be sent out through an external mail server:
dnl #
dnl define(`SMART_HOST',`smtp.your.provider')
dnl #
define(`confDEF_USER_ID',``8:12'')dnl
dnl # define(`confAUTO_REBUILD')dnl
define(`confTO_CONNECT', `1m')dnl
define(`confTRY_NULL_MX_LIST',true)dnl
define(`confDONT_PROBE_INTERFACES',true)dnl
define(`PROCMAIL_MAILER_PATH',`/usr/bin/procmail')dnl
define(`ALIAS_FILE', `/etc/aliases')dnl
dnl define(`STATUS_FILE', `/etc/mail/statistics')dnl
define(`UUCP_MAILER_MAX', `2000000')dnl
define(`confUSERDB_SPEC', `/etc/mail/userdb.db')dnl
define(`confPRIVACY_FLAGS', `authwarnings,novrfy,noexpn,restrictqrun')dnl
define(`confAUTH_OPTIONS', `A')dnl
dnl #
dnl # The following allows relaying if the user authenticates, and disallows
dnl # plaintext authentication (PLAIN/LOGIN) on non-TLS links
dnl #
dnl define(`confAUTH_OPTIONS', `A p')dnl
dnl # 
dnl # PLAIN is the preferred plaintext authentication method and used by
dnl # Mozilla Mail and Evolution, though Outlook Express and other MUAs do
dnl # use LOGIN. Other mechanisms should be used if the connection is not
dnl # guaranteed secure.
dnl #
dnl TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
dnl define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
dnl #
dnl # Rudimentary information on creating certificates for sendmail TLS:
dnl #     make -C /usr/share/ssl/certs usage
dnl #
dnl define(`confCACERT_PATH',`/usr/share/ssl/certs')
dnl define(`confCACERT',`/usr/share/ssl/certs/ca-bundle.crt')
dnl define(`confSERVER_CERT',`/usr/share/ssl/certs/sendmail.pem')
dnl define(`confSERVER_KEY',`/usr/share/ssl/certs/sendmail.pem')
dnl #
dnl # This allows sendmail to use a keyfile that is shared with OpenLDAP's
dnl # slapd, which requires the file to be readable by group ldap
dnl #
dnl define(`confDONT_BLAME_SENDMAIL',`groupreadablekeyfile')dnl
dnl #
dnl define(`confTO_QUEUEWARN', `4h')dnl
dnl define(`confTO_QUEUERETURN', `5d')dnl
dnl define(`confQUEUE_LA', `12')dnl
dnl define(`confREFUSE_LA', `18')dnl
define(`confTO_IDENT', `0')dnl
dnl FEATURE(delay_checks)dnl
FEATURE(`no_default_msa',`dnl')dnl
FEATURE(`smrsh',`/usr/sbin/smrsh')dnl
FEATURE(`mailertable',`hash -o /etc/mail/mailertable.db')dnl
FEATURE(`virtusertable',`hash -o /etc/mail/virtusertable.db')dnl
FEATURE(redirect)dnl
FEATURE(always_add_domain)dnl
FEATURE(use_cw_file)dnl
FEATURE(use_ct_file)dnl
dnl #
dnl # The -t option will retry delivery if e.g. the user runs over his quota.
dnl #
FEATURE(local_procmail,`',`procmail -t -Y -a $h -d $u')dnl
FEATURE(`access_db',`hash -T<TMPF> -o /etc/mail/access.db')dnl
FEATURE(`blacklist_recipients')dnl
EXPOSED_USER(`root')dnl
dnl #
dnl # The following causes sendmail to only listen on the IPv4 loopback address
dnl # 127.0.0.1 and not on any other network devices. Remove the loopback
dnl # address restriction to accept email from the Internet or Intranet.
dnl #
dnl # DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
dnl #
dnl # The following causes sendmail to additionally listen to port 587 for
dnl # mail from MUAs that authenticate. Roaming users who can't reach their
dnl # preferred sendmail daemon due to port 25 being blocked or redirected find
dnl # this useful.
dnl #
dnl DAEMON_OPTIONS(`Port=submission, Name=MSA, M=Ea')dnl
dnl #
dnl # The following causes sendmail to additionally listen to port 465, but
dnl # starting immediately in TLS mode upon connecting. Port 25 or 587 followed
dnl # by STARTTLS is preferred, but roaming clients using Outlook Express can't
dnl # do STARTTLS on ports other than 25. Mozilla Mail can ONLY use STARTTLS
dnl # and doesn't support the deprecated smtps; Evolution <1.1.1 uses smtps
dnl # when SSL is enabled-- STARTTLS support is available in version 1.1.1.
dnl #
dnl # For this to work your OpenSSL certificates must be configured.
dnl #
dnl DAEMON_OPTIONS(`Port=smtps, Name=TLSMTA, M=s')dnl
dnl #
dnl # The following causes sendmail to additionally listen on the IPv6 loopback
dnl # device. Remove the loopback address restriction listen to the network.
dnl #
dnl # NOTE: binding both IPv4 and IPv6 daemon to the same port requires
dnl #       a kernel patch
dnl #
dnl DAEMON_OPTIONS(`port=smtp,Addr=::1, Name=MTA-v6, Family=inet6')dnl
dnl #
dnl # We strongly recommend not accepting unresolvable domains if you want to
dnl # protect yourself from spam. However, the laptop and users on computers
dnl # that do not have 24x7 DNS do need this.
dnl #
dnl #FEATURE(`accept_unresolvable_domains')dnl
dnl #
dnl FEATURE(`relay_based_on_MX')dnl
dnl # 
dnl # Also accept email sent to "localhost.localdomain" as local email.
dnl # 
LOCAL_DOMAIN(`localhost.localdomain')dnl
dnl #
dnl # The following example makes mail from this host and any additional
dnl # specified domains appear to be sent from mydomain.com
dnl #
dnl MASQUERADE_AS(`mydomain.com')dnl
dnl #
dnl # masquerade not just the headers, but the envelope as well
dnl #
FEATURE(masquerade_envelope)dnl
FEATURE(allmasquerade)dnl
dnl #
dnl # masquerade not just @mydomainalias.com, but @*.mydomainalias.com as well
dnl #
dnl FEATURE(masquerade_entire_domain)dnl
dnl #
dnl MASQUERADE_DOMAIN(localhost)dnl
dnl MASQUERADE_DOMAIN(localhost.localdomain)dnl
dnl MASQUERADE_DOMAIN(mydomainalias.com)dnl
dnl MASQUERADE_DOMAIN(mydomain.lan)dnl
FEATURE(`relay_entire_domain')dnl
MAILER(smtp)dnl
MAILER(procmail)dnl

     

Network Time Protocol

The ntp program must be installed and configured to connect to any available ntp server.

If your organization does not have an on-site ntp server check public NTP servers, which summarizes an alternative option.

Example 2. NTP Configuration File

# Prohibit general access to this service.
restrict default ignore
restrict SERVER_NAME mask MASK nomodify notrap noquery

# Permit all access over the loopback interface.  This could
# be tightened as well, but to do so would effect some of
# the administrative functions.
restrict 127.0.0.1 


# -- CLIENT NETWORK -------
# Permit systems on this network to synchronize with this
# time service.  Do not permit those systems to modify the
# configuration of this service.  Also, do not use those
# systems as peers for synchronization.
restrict NETWORK_NAME mask NETWORK_MASK nomodify notrap noquery

# --- GENERAL CONFIGURATION ---
#
# Undisciplined Local Clock. This is a fake driver intended for backup
# and when no outside source of synchronized time is available. The
# default stratum is usually 3, but in this case we elect to use stratum
# 0. Since the server line does not have the prefer keyword, this driver
# is never used for synchronization, unless no other other
# synchronization source is available. In case the local host is
# controlled by some external source, such as an external oscillator or
# another protocol, the prefer keyword would cause the local host to
# disregard all other synchronization sources, unless the kernel
# modifications are in use and declare an unsynchronized condition.
#
server SERVER_NAME
fudge	127.127.1.0 stratum 10	

#
# Drift file.  Put this in a directory which the daemon can write to.
# No symbolic links allowed, either, since the daemon updates the file
# by creating a temporary in the same directory and then rename()'ing
# it to the file.
#
driftfile /etc/ntp/drift
broadcastdelay	0.008

#
# Authentication delay.  If you use, or plan to use someday, the
# authentication facility you should make the programs in the auth_stuff
# directory and figure out what this number should be on your machine.
#
authenticate no

#
# Keys file.  If you want to diddle your server at run time, make a
# keys file (mode 600 for sure) and define the key number to be
# used for making requests.
#
# PLEASE DO NOT USE THE DEFAULT VALUES HERE. Pick your own, or remote
# systems might be able to reset your clock at will. Note also that
# ntpd is started with a -A flag, disabling authentication, that
# will have to be removed as well.
#
keys		/etc/ntp/keys
     

Oracle

The following are installation details for the Oracle database server system. Each DEOS installation has a single Oracle database server. The following sections describe the configuration items required.

This link, summarizes some issues that may be faced when installing Oracle 9i database server on RedHat systems and how to remedy them.

The equivalent document for the Oracle 10g database can be found at this link.

Software Installation

Follow the Oracle installation notes, and any patches required.

System Setup

The following items, with suitable modifications, need to be placed in the /etc/profile system file so that users can access the Oracle software appropriately.

Example 3. User Profile Information

# Oracle setup
TZ=UTC
ORACLE_BASE=/oracle
ORACLE_HOME=$ORACLE_BASE/product/10.2/
ORACLE_SID=DEOS

PATH=$PATH:$ORACLE_HOME/bin
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib:$ORACLE_HOME/network/lib

export PATH ORACLE_BASE ORACLE_HOME ORACLE_SID LD_LIBRARY_PATH LD_ASSUME_KERNEL TZ
     

Creating A Database Instance

Create a database instance using the dbca program from the Oracle installation. A "Transaction Processing" database should be selected, along with all the defaults. Use the directory destinations as appropriate for the system. The time zone for the database is recommended to be set to UTC or an offset of 00:00 hours. If this isn't done, the DCF application will not work correctly.

Removing A Database Instance

To remove the database instance, use the dbca program.

Set Database Timezone

To configure the defined database to use the UTC/GMT time zone, perform the following.

Procedure 3. Configure Database Time Zone [1]

  1. Log into the server as the SYSTEM user using the password created during database creation

  2. type "ALTER DATABASE DBNAME SET TIME_ZONE='00:00';" (replacing DBNAME with the database name created above.) [2]

  3. Restart the database for this change to take effect.

Change PL/SQL Complier Mode (Oracle 10g ONLY)

To change the PL/SQL complier mode to native (resulting in faster execution of compute intensive code), it is highly recommended that this procedure be followed.

Procedure 4. Create Native PL/SQL Support For DEOS

  1. Execute this command, "ALTER SYSTEM SET plsql_code_type = 'NATIVE' SCOPE=BOTH" as sysdba.

  2. Create a directory ~/admin/plsql.

  3. Execute this command, "ALTER SYSTEM SET plsql_native_library_dir = 'DIR' SCOPE=BOTH" (replace DIR with the directory created in the previous step) as sysdba.

Install Database Roles

To install the defined database roles for the DEOS system, perform the following procedure.

Procedure 5. Install Database Roles For DEOS

  1. Change to the directory containing the install SQL scripts (usually deos/database/)

  2. Log into the server as the SYSTEM user using the password created during database creation

  3. type "@create_roles"

Create Database Users

To create the required database users for the DEOS system, perform the following procedure.

Procedure 6. Install DEOS Users

  1. Change to the directory containing the install SQL scripts (usually deos/database/)

  2. Edit the create_users.sql file and change the passwords (the item after the 'IDENTIFIED BY' string)

  3. Log into the server as the SYSTEM user (and using the SYSDBA role) using the password created during database creation

  4. type "@create_users"

This script creates the following users:

  • deosmgr. This is the "owner" of the DEOS schema, the database tables and other associated objects. The backend programs all access the database using this account.

  • deosdcf. This user has limited access to the database sufficient to allow the user to use the DCF application. See DTN #15.

  • deosddv. This user has limited access to the database sufficient to allow the user to use the ODD-DIVAS application. See DTN #12.

DEOS Schema Install

To create the DEOS schema in the database instance, perform the following procedure.

Procedure 7. Install DEOS schema

  1. Change to the directory containing the install SQL scripts (usually deos/database/)

  2. Type sqlplus deosmgr@DBNAME/PASSWORD @setup.sql > /tmp/setup.log

If no errors occur, continue the setup with the city metadata ingest.

If no errors occur, continue the setup with the county metadata ingest.

If no errors occur, continue the setup with the station metadata ingest.

If no errors occur, and NWS METAR stations are to be used continue the setup with the METAR station county metadata ingest.

If no errors occur, continue the setup with the topographic metadata ingest.

Procedure 8. Install ancillary station metadata

  1. Change to the directory containing the install SQL scripts (usually deos/database/)

  2. Log into the server with the user created above

  3. See DTN #8 for the appropriate local settings files.

DEOS Schema Un-install

To remove the DEOS schema complete the following steps.

Procedure 9. Un-install DEOS schema

  1. Change to the directory containing the install SQL scripts (usually deos/database/)

  2. Type sqlplus deosmgr@DBNAME/PASSWORD @remove.sql > /tmp/remove.log

User Grants

To create the correct security environment for the sub-ordinate users, deosdcf and deosddv, perform the following procedure.

Procedure 10. Install DEOS User Grants

  1. Change to the directory containing the install SQL scripts (usually deos/database/)

  2. Log into the server as the deosmgr user

  3. type "@grant_deosdcf"

  4. type "@grant_deosddv"

Database Statistics (For Oracle 9i Only)

To create the correct statistics generating update process, perform the following procedure.

Procedure 11. Install Statistics Generation Scripts

  1. Change to the directory containing the statistics scripts (usually deos/database/stats/)

  2. Copy the files stats.sh, connect.sql, stats_system.sql and stats_schema.sql to a separate directory. (The directory, ~/bin/ is a good choice.)

  3. Change to this destination directory.

  4. Edit the connect.sql file and set the correct connection parameters.

  5. type "chmod 600 connect.sql" (this hides the contents from all but the user.)

  6. Edit the stats.sh file and set the correct path parameters. The constants ORACLE_SID and TNS_ADMIN values will likely need to be changed. In addition, check that the paths to the scripts are right. The sqlplus program will need to be in the users' path, or the full path to that program needs to be prepended to the executable name.

  7. type "chmod 755 stats.sh" (this ensures that the script is executable.)

  8. Enter a line equivalent to "0 0 * * * /user_dir/bin/stats.sh" in crontab. (Replace "user_dir" with the full path name.)

Allowing HDRS extract jobs to run

To configure the database to run extranal executable programs correctly, perform the following steps.

Procedure 12. Add Permissions for HDRS Jobs

  1. As the oracle user, edit the $ORACLE_HOME/rdbms/admin/externaljob.ora and ensure run_user and run_group are set to nobody.

  2. Ensure that the extjob is owned by root.

    chown root $ORACLE_HOME/bin/extjob
    chmod 4750 $ORACLE_HOME/bin/extjob
          
  3. As the SYSTEM user issue the command GRANT CREATE EXTERNAL JOB TO deosmgr

  4. Ensure that the output directory for the HDRS system, usually /www/htdocs/hdrs/output/ has the correct permissions of 777.

Oracle Client

Components of DEOS may be installed on different machines as needed. If a component requiring database access such as ODD-DIVAS is installed onto such a machine then the Oracle client software install must be performed on that machine. To build the components, the "programmer" option needs to be selected if the DEOS component will be run on the machine, the "run-time" option must be installed.

DEOS Software

The following are configuration details for the DEOS installation.

Installation

SMARTS

This component performs the data ingest and generation portion of the DEOS system.

Release Build and Install

For a given release, the SMARTS component will be tagged in the CVS system by "DEOS_X_Y_Z" and so can be retrieved using that tag. X will be the major release, Y the minor release and Z most recent version. See DTN #7 for details of available releases. The example shows how to build and install from source.

Example 4. SMARTS build process for Oracle 9i

cd release_dir
./configure CXX=g++296
...configure output...
make
...make output
make install
...make install output
      

Example 5. SMARTS build process for Oracle 10g and later

cd release_dir
./configure
...configure output...
make
...make output
make install
...make install output
      
Automating retrieve and ingest

For some installations, retrieval of data from remote resources is required. To perform a sequential retrieval and ingest the use of cron is recommended. The following example is a recommended crontab file entry.

Example 6. Crontab file for combined retrieval and ingest

TZ=UTC
ORACLE_SID=DEOS
ORACLE_HOME=/oracle/product/10.2/
10 * * * * /usr/local/bin/retrieve -u USER -p PASSWORD -d DEOS -s METAR-SFSS; /usr/local/bin/ingest -u USER -p PASSWORD -d DEOS -s METAR-SFSS
      

The USER and PASSWORD settings in the example will need to be changed for a particular install. Other settings, such as ORACLE_SID, ORACLE_HOME may need to be changed.

ODD-DIVAS

This component forms one part of the data display for the DEOS system, in particular the display of individual and network-wide station data. ODD-DIVAS displays current conditions and time series graphs of meteorological variables available for data stations utilized by the DEOS system.

Install

For a given release, the ODD-DIVAS component will be tagged in the CVS system by "DEOS_X_Y_Z" and so can be retrieved using that tag. X will be the major release, Y the minor release and Z most recent version. DTN #7 for details of available releases. The example shows how to ensure the system is available to a Internet user.

Example 7. ODD-DIVAS install process

mv odd-divas-dir /www/host/dir/
[Edit the Apache configuration file to enter the database connection parameters as described below]
cd /www/host/dir/odd-divas/

[either copy the pre-existing cache to the new directory]
mv ../odd-divas-old-version/cache/ ./

[or create a new cache directory]
mkdir cache
chmod 1777 cache
chown WEBUSER.WEBGROUP cache
      
Configuration

The following list of parameters are the configurable items for ODD-DIVAS and can be found in the ofnidb.jnk file in the odd-divas directory.

  • gVERSION: this is the version string that appears in certain graphs.

  • gWIDTH: this is the width of the images generated.

  • gHEIGHT: this is the height of the images generated.

  • gHINC: this is the height increment used in the popups displaying graphics.

  • gWINC: this is the height increment used in the popups displaying graphics.

  • gCURRENT: this is the value (in hours) within which data will be displayed in the current station data page.

  • gPRO: this is flag to indicate whether we have a JpGraph Professional license, or not. If a professional license is available, a wind rose graph will be used for display of wind direction data.

DCF

This component provides the database configuration portion of the system.

Install

For a given release, the DCF component will be tagged in the CVS system by "DEOS_X_Y_Z" and so can be retrieved using that tag. X will be the major release, Y the minor release and Z most recent version. DTN #7 for details of available releases. The example shows how to ensure the system is available to a Internet user.

Example 8. DCF build process

mv dcf-dir /www/host/dir/
mv adminpro /usr/share/php/adminpro
[Edit the Apache configuration file to enter the database connection parameters as described below]
Configuration

The following list of parameters are the configurable items for DCF and can be found in the ofnidb.jnk file in the dcf directory.

  • gVERSION: this is the version string that appears in the DCF interface.

  • gACCEL: this is flag to indicate whether we have the eAccelerator software installed.

  • gPAGING: this indicates the number of items to display per page on the Events and Station_Data lists.

If you are unable to connect to the DCF make sure that the user running the apache httpd process, usually "nobody" is in the group that owns the oracle software, if you use the Oracle default, this will be group "oinstall". Once this group has been added to the user, the web server will need to be stopped and started, NOT just restarted.

DEOS Green Energy Product

This component provides support for providing users with the information they need to decide whether a wind turbine or slar cell system is appropriate for their siting environment.

Install

For a given release, the DGEP service component will be tagged in the CVS system by "DEOS_X_Y_Z" and so can be retrieved using that tag. X will be the major release, Y the minor release and Z most recent version. See DTN #7 for details of available releases. The example shows how to ensure the system is available to a Internet user.

Example 9. DGEP install process

mv dgep /www/host/dir/
Configuration

There are no configuration items directly related to the DGEP, except those outlined in the DTN #7 document.

Web Service Data Facility

This component provides support for providing users real-time access to stored data in machine readable, XML, format.

Install

For a given release, the web service component will be tagged in the CVS system by "DEOS_X_Y_Z" and so can be retrieved using that tag. X will be the major release, Y the minor release and Z most recent version. See DTN #7 for details of available releases. The example shows how to ensure the system is available to a Internet user.

Example 10. Web service install process

mv ws-dir /www/host/dir/
Configuration

There are no configuration items directly related to the data feeds, except those outlined in the DTN #7 document.

DEOS Atom and RSS Data Feeds

This component provides support for providing users with Atom version 1.0 and RSS version 2.0 data feeds.

Install

For a given release, the data feeds component will be tagged in the CVS system by "DEOS_X_Y_Z" and so can be retrieved using that tag. X will be the major release, Y the minor release and Z most recent version. See DTN #7 for details of available releases. The example shows how to ensure the system is available to a Internet user.

Example 11. Data feeds install process

mv df-dir /www/host/dir/

[For updates, execute the following commands:
cd /www/htdocs/df/
mv ../df-old-version/Atom/ ./
mv ../df-old-version/rss/ ./ 
]
Configuration

There are no configuration items directly related to the data feeds, except those outlined in the DTN #7 document.

DEOS Historical Data Retrieval Process

This component provides support for extracted data through a web front end.

Install

For a given release, the data feeds component will be tagged in the CVS system by "DEOS_X_Y_Z" and so can be retrieved using that tag. X will be the major release, Y the minor release and Z most recent version. See DTN #7 for details of available releases. The example shows how to ensure the system is available to a Internet user.

Example 12. HDRS install process

mv hdrs-dir /www/host/dir/
Configuration

The configuration for the HDRS is through the DCF, see the DTN #7 document.

Other Software

The following are installation details for other software items required by the DEOS installation.

cURLpp Library

This library is required as part of the retrieve and cfgen components.

cURLpp Version Required

This release requires version 0.3.3 of cURLpp. http://rrette.com/curlpp.html

Example 13. cURLpp Install For Oracle 10g

cd cURLpp-dir/
./configure
...configure output
make
...make output
make install
...make install output

Example 14. cURLpp Install For Oracle 9i

cd cURLpp-dir/
./configure CC=gcc296 CXX=g++296
...configure output
make
...make output
make install
...make install output

/etc/ld.so.conf

This file needs to have a entry for the path to the installation of shared library for cURLpp. The exact path in the last line in the example below will dependent on the settings to configure.

Example 15. Shared Library Access

/usr/kerberos/lib
/usr/X11R6/lib
/usr/lib/
/usr/lib/qt-3.1/lib
/usr/lib/mysql
/usr/local/lib/

JpGraph Library

This library is required as part of the ODD-DIVAS component.

JpGraph Version Required

This version of ODD-DIVAS has been developed with version 2.2 of JpGraph. http://www.aditus.nu/jpgraph/

Example 16. JpGraph Install

cd /usr/share/php/
ln -s /path/to/jpgraph/src/directory/ ./JpGraph

If the wind rose is to be used TrueType fonts will need to be installed. The install at Delaware used this procedure. The resulting RPM file is provided in the DEOS distribution for convenience (deos/rpm/msttcorefonts-1.3-4.noarch.rpm.) If the TrueType fonts are installed with this RPM file, the TTF_DIR variable setting in the JpGraph file jpg-config.inc.php needs to be configured with the directory the fonts were installed into. This directory, if using the above method, will be /usr/share/fonts/msttcorefonts/.

Other Libraries

The cURL, libxml2 (version 2.6.11 is recommended and RPMs are provided in the DEOS repository), libxslt (version 1.1.11 is recommended and RPMs are provided in the DEOS repository) zlib and png libraries are required to build PHP as described below.

These libraries are available as RPM packages usually on one of the OS install disks. The associated curl-devel, libxml2-devel, libxslt-devel, libpng-devel and zlib-devel packages will also need to be installed.

To enable PNG image output for the DEOS code, the ImageMagick C++, tiff and XFree86 development packages (ImageMagick-c++-devel, libtiff-devel and XFree86-devel) will need to be installed with their dependencies.

In order to build PHP the system will need to have the RPM package libgcrypt-devel installed. If it isn't an error of the form:

cannot find -lgcrypt

Apache and PHP

Apache and PHP are required to complete the setup required for ODD-DIVAS . They need to be built and installed together as described below.

Apache Version Required

This release has been developed with version 1.3.42 of Apache.

Building PHP for Windrose Use

In order to build PHP to support true-type fonts, as required for the Wind rose in JpGraph, the system will need to have the RPM package freetype-devel installed. If it isn't an error of the form:

configure: error: freetype2 not found!

PHP Version Required

This release has been developed with version 5.2.14 of PHP.

Example 17. Apache/PHP build process

cd apache-dir
./configure --prefix=/www --enable-module=so
...configure output...
make
...make output
make install
...make install output

cd php-dir
./configure --with-oci8 --with-gd --with-ttf --with-freetype-dir --with-apxs=/www/bin/apxs \
--with-zlib --enable-xmlwriter --without-pear --with-xsl --with-curl --with-curlwrappers

...configure output...
make
...make output
make install
...make install output

0. The Oracle install group (usually "oinstall") needs to be added to the Apache server user groups list.

1. Execute: cp php.ini-dist /usr/local/lib/php.ini to create a template PHP initialization file.

2. Add /usr/share/php/JpGraph/ to the include_path variable in the
/usr/local/lib/php.ini file.

3. Add /usr/share/php/adminpro to the include_path variable in the
/usr/local/lib/php.ini file.

4. Change the setting of max_execution_time to 60. (This is the
maximum execution time permitted for PHP script execution.)

5. Change the setting of memory_limit to 200M. (This is the maximum memory
a script is permitted to consume.)

6. Change the setting of short_open_tag to Off in the /usr/local/lib/php.ini.

7. Add Line "SetEnv TNS_ADMIN ORACLE_HOME/network/admin/tnsnames.ora" to /www/conf/httpd.conf file
(replacing ORACLE_HOME with the actual path. If this isn't present, an ORA-12154 error may result.)

8. Add Line "SetEnv DATABASE name" to /www/conf/httpd.conf file (replacing name with the actual
database name.)

9. Add Line "SetEnv DB_USER name" to /www/conf/httpd.conf file (replacing name with the actual
user name.)

10. Add Line "SetEnv DB_PASSWORD name" to /www/conf/httpd.conf file (replacing name with the
actual password.)

11. Add "AddType application/x-httpd-php .php .phtml" to /www/conf/httpd.conf.

12. Add "AddType application/x-httpd-php-source .phps" to /www/conf/httpd.conf.

13. Add an appropriate entry for "ServerName".

14. Comment out the following line, if present.
"LoadModule php4_module        libexec/libphp4.so"

15. Ensure that the module mod_dir.c includes index.php. It should look like:

<IfModule mod_dir.c>
    DirectoryIndex index.html index.php
</IfModule>

16. Add Line "SetEnv STATIONS 1" to the /www/conf/httpd.conf file. This value indicates which stations
are to be displayed on this URL. If only one web site is being served, set STATIONS to 1 and set the 
Display_Flags value for all stations to 1 also. If more than one web site is to be server from this
database, contact the author for assistance.

Multiple Servers

In the case when two or machines are configured to accept requests to the canonical name, the individual machines must have the ServerName parameter set correctly so that the machine generating the cache file can serve the cached files.

If this isn't done correctly, a 404 error, file not found, will result.

eAccelerator PHP Extension

This installation is optional but recommended. The eAccelerator PHP extension increases performance of PHP scripts by caching them in a compiled state, so that the compiling of the scripts is only performed once.

Rebuilding eAccelerator Following Install of new PHP Version

If a new PHP version is installed, eAccelerator will need to be rebuilt from scratch and reinstalled. The command make distclean removes pre-existing binaries; once the command completes, the commands below may be used.

eAccelerator Version Required

This release has been tested with version 0.9.5.2 of eAccelerator. http://eaccelerator.net/

Example 18. eAccelerator Install

cd eAccel-dir/
export PHP_PREFIX="/usr/local"
$PHP_PREFIX/bin/phpize
... phpize output
./configure \
--enable-eaccelerator=shared \
--with-php-config=$PHP_PREFIX/bin/php-config
... configure output
make
... make output
make install
...make install output
mkdir -p /var/cache/eAccelerator/
chmod 0777 /var/cache/eAccelerator/
cp control.php /path/to/dcf/directory
... edit user name and password entries in control.php file.

Configuring eAccelerator

The following entries need to be placed in the php.ini file. The first line will need to be adjusted for the appropriate build environment. This directory path is output when the make install command exits successfully.

Example 19. eAccelerator Configuration

zend_extension="/usr/local/lib/php/extensions/no-debug-non-zts-20050922/eaccelerator.so"
eaccelerator.shm_size="32"
eaccelerator.cache_dir="/var/cache/eAccelerator/"
eaccelerator.enable="1"
eaccelerator.optimizer="1"
eaccelerator.check_mtime="1"
eaccelerator.debug="0"
eaccelerator.log_file = "/www/log/eaccelerator_log"
eaccelerator.filter="*.php"
eaccelerator.shm_max="0"
eaccelerator.shm_ttl="0"
eaccelerator.shm_prune_period="0"
eaccelerator.shm_only="0"
eaccelerator.compress="1"
eaccelerator.compress_level="9"
eaccelerator.allowed_admin_path = "/www/htdocs/dcf"

XTide Program

This program is required as part of the ODD-DIVAS component.

XTide Version Required

This version of ODD-DIVAS has been developed with version 2.1.0 of XTide. http://www.flaterco.com/xtide/

Example 20. XTide Install

cd XTide-Source/
./configure
... configure output
make
... make output
make install
...make install output
mkdir -p /usr/local/share/xtide/

To configure add 

# Xtide Setup
HFILE_PATH=/usr/local/share/xtide/harmonics-dwf-20100529-free.tcd

to the /etc/profile file.

Periodically new harmonics files are needed and updates are available here. These files are then process by /usr/local/bin/get_tides.bsh to generate the daily tide data for each desired location.



[1] If this procedure isn't performed correctly, the most common symptom is an inability to log into the DCF system.

[2] If you get an error similar to: "ORA-02231: missing or invalid option to ALTER DATABASE" when running the above command then you need to execute the following:

"ALTER TABLE oe.orders DROP COLUMN order_date;"