Installation Manual

From Euro4m CIB
Jump to: navigation, search

Installation of Mediawiki

Mediawiki has been installed according to the installation guide: http://www.mediawiki.org/wiki/Manual:Installation_guide

Mediawiki is installed under /data/euro4m/web/htdocs/Mediawiki and is configured by/data/euro4m/web/htdocs/mediawiki/LocalSettings.php

The style named “vector” is used as basis for further styling of the climate indicator bulletin pages. The cascaded style sheet file /data/euro4m/web/htdocs/mediawiki/skins/vector/screen.css is adjusted to conform to the Euro4M styling as can be seen on http://www.euro4m.eu/.

Installation of ADAGUC system with ADAGUC mapeditor

Adaguc has been installed according to the installation instructions on http://dev.knmi.nl/projects/adagucserver/wiki/Installation

Changes and features added to the ADAGUC system during the Euro4M project have been put into the public open source repository and wiki pages of ADAGUC at http://dev.knmi.nl/projects/adaguc/. Some projects are already benefitting from the features built in Euro4M, the http://climate4impact.eu/ portal developed in IS-ENES shares the automatic visualization of NetCDF files functionality. Within Euro4M, many data files in NetCDF format from several providers were available. ADAGUC had to be adjusted to recognize and visualize these files. The changes to achieve the more generic visualization of NetCDF files in ADAGUC are put back into the ADAGUC repositories and are available for other projects.

Below detailed instructions can be found for installing ADAGUC for the climate indicator bulletins:

adres: http://cib-dev.knmi.nl
htdocs dir: /data/web/euro4m/
host: bvle4m02
user: euro4m
adaguc cgi script: /data/web/euro4m/cgi-bin/euro4m_autowms.cgi?
adaguc cgi endpoint: http://cib-dev.knmi.nl/cgi-bin/euro4m_autowms.cgi?
visualization directory: /data/euro4m/data/wms

### Install packages ###
yum install gcc gcc-c++ libpng-devel zlib-devel libxml2-devel \
gd-devel proj-devel postgresql-devel udunits2-devel \
cairo-devel httpd postgresql-server mercurial \
giflib-devel proj-epsg \
php php-gd


### Install HDF, NetCDF, GDAL and ADAGUC from source ###

mkdir /data/euro4m/software
cd /data/euro4m/software

### Set environment ###
export ADAGUCHOME=/data/euro4m/
export CPPFLAGS="-I$ADAGUCHOME/install/include/ -I/usr/include/udunits2/" 
export LDFLAGS=-L$ADAGUCHOME/install/lib
export LD_LIBRARY_PATH=$ADAGUCHOME/install/lib:$LD_LIBRARY_PATH
export PATH=$ADAGUCHOME/install/bin:$PATH

mkdir -p $ADAGUCHOME/data/wms
mkdir $ADAGUCHOME/config
mkdir $ADAGUCHOME/logs
chmod 777 $ADAGUCHOME/logs


### Compile latest HDF5 version ###
#obtain latest version from http://www.hdfgroup.org/ftp/HDF5/current/src/
cd $ADAGUCHOME/software
wget http://www.hdfgroup.org/ftp/HDF5/current/src/hdf5-1.8.12.tar.gz
tar -xzvf hdf5-1.8.12.tar.gz
cd hdf5-1.8.12
./configure --prefix=$ADAGUCHOME/install
make
make install


### Compile latest NetCDF4 ### 
#obtain latest verson from http://www.unidata.ucar.edu/downloads/netcdf/index.jsp
cd $ADAGUCHOME/software
wget http://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-4.3.0.tar.gz
tar -xzvf netcdf-4.3.0.tar.gz
cd netcdf-4.3.0
./configure --prefix=$ADAGUCHOME/install --enable-netcdf-4 CPPFLAGS=-I$ADAGUCHOME/install/include LDFLAGS=-L$ADAGUCHOME/install/lib
make
make install


### Compile udunits ###
cd $ADAGUCHOME/software
ftp://ftp.unidata.ucar.edu/pub/udunits/udunits-2.1.24.tar.gz
tar -xzvf udunits-2.1.24.tar.gz
cd udunits-2.1.24
./configure --prefix=$ADAGUCHOME/install
make 
make install

### Compile latest GDAL ### 
#obtain latest version from http://download.osgeo.org/gdal/CURRENT/
cd $ADAGUCHOME/software
wget http://download.osgeo.org/gdal/CURRENT/gdal-1.10.1.tar.gz
tar -xzvf gdal-1.10.1.tar.gz 
export GDALHOME=$ADAGUCHOME/software/gdal-1.10.1

#Install GDAL ADAGUC driver 
cd $GDALHOME/frmts/netcdf
wget http://trac.osgeo.org/gdal/raw-attachment/wiki/ADAGUC/GDAL_ADAGUC_source_v0.3.tar.gz
tar -xzvf GDAL_ADAGUC_source_v0.3.tar.gz
mv GDAL_ADAGUC_source_v0.3/* .

# Adjust GNUmakefile, add adagucdataset.o to the OBJ list:
if [ ! -f GNUmakefile.orig ]; then  cp GNUmakefile GNUmakefile.orig; fi
sed 's/gmtdataset.o/gmtdataset.o adagucdataset.o/g' GNUmakefile.orig > GNUmakefile

# Adjust gdalallregister.cpp, add GDALRegister_ADAGUC() between GMT and NetCDF
if [ ! -f $GDALHOME/frmts/gdalallregister.cpp.orig ]; then cp $GDALHOME/frmts/gdalallregister.cpp $GDALHOME/frmts/gdalallregister.cpp.orig; fi
sed 's/GDALRegister_netCDF();/GDALRegister_ADAGUC();\n    GDALRegister_netCDF(); /g' $GDALHOME/frmts/gdalallregister.cpp.orig >  $GDALHOME/frmts/gdalallregister.cpp 

# Adjust gdal_frmts.h.cpp, add void CPL_DLL GDALRegister_ADAGUC(void); between GMT and NetCDF
if [ ! -f  $GDALHOME/gcore/gdal_frmts.h.orig ]; then cp  $GDALHOME/gcore/gdal_frmts.h $GDALHOME/gcore/gdal_frmts.h.orig; fi
sed 's/void CPL_DLL GDALRegister_netCDF(void);/void CPL_DLL GDALRegister_ADAGUC(void); \nvoid CPL_DLL GDALRegister_netCDF(void); /g'  $GDALHOME/gcore/gdal_frmts.h.orig >   $GDALHOME/gcore/gdal_frmts.h 

#Continue compiling GDAL
cd $GDALHOME/
./configure --prefix=$ADAGUCHOME/install LIBS="-ludunits2 -lexpat" CPPFLAGS="-I$ADAGUCHOME/install/include/" LDFLAGS=-L$ADAGUCHOME/install/lib/ 
make
make install

# test if ADAGUC driver is listed:
gdalinfo --formats | grep ADAGUC # should list ADAGUC (rw): ADAGUC NetCDF Raster format V0.3

### Compile ADAGUC ###
cd $ADAGUCHOME/software
wget http://dev.knmi.nl/hg/adagucserver/archive/748b071353c2.tar.gz -O adagucserver.tar.gz
tar -xzvf adagucserver.tar.gz 
mv adagucserver-748b071353c2 adagucserver
cd adagucserver
bash compile.sh 
cp bin/adagucserver $ADAGUCHOME/install/bin
mkdir $ADAGUCHOME/install/share/adagucserver
cp -r $ADAGUCHOME/software/adagucserver/data $ADAGUCHOME/install/share/adagucserver/

### Create shell cgi script which calls adaguc server ###
cat > /data/web/euro4m/cgi-bin/adagucwms.cgi <<EOF
#!/bin/bash

export ADAGUCHOME=/data/euro4m/
export UDUNITS2_XML_PATH=$ADAGUCHOME/install/share/udunits/udunits2.xml
export GDAL_DATA=$ADAGUCHOME/install/share/gdal/
export ADAGUC_FONT=$ADAGUCHOME/install/share/adagucserver/data/fonts/FreeSans.ttf
export LD_LIBRARY_PATH="$ADAGUCHOME/install/lib:$LD_LIBRARY_PATH" 
export ADAGUC_CONFIG=$ADAGUCHOME/config/euro4mvis_wms.xml
export ADAGUC_LOGFILE=$ADAGUCHOME/logs/euro4mvis_wms.log
export ADAGUC_ERRORFILE=$ADAGUCHOME/logs/euro4mvis_wms.errlog
$ADAGUCHOME/install/bin/adagucserver

returnCode=$?
if [ "$returnCode" != "0" ]; then
  echo "Content-type: text/html" 
echo "" 
  echo "Message:<br>" 
  echo rv: $returnCode
  if [ "$returnCode" == "143" ]; then echo "= Application was killed"; fi;
  if [ "$returnCode" == "127" ]; then echo "= Application not found"; fi;
  echo "<br>" 
  echo "/Message:<br>" 
  fi
EOF

chmod +x /data/web/euro4m/cgi-bin/adagucwms.cgi

### Create PostgreSQL database ###
createdb euro4mwms -U visadm


#Place ADAGUC configuration file under 
$ADAGUCHOME/config/euro4mvis_wms.xml

#Install adagucviewer under /data/web/euro4m/adagucviewer
cd /data/web/euro4m
wget http://dev.knmi.nl/hg/adagucviewer/archive/fcddd39e41de.tar.gz
tar -xzvf fcddd39e41de.tar.gz
mv adagucviewer-fcddd39e41de adagucviewer

#Install autowms client under /data/web/euro4m/autowms
cd /data/web/euro4m
tar -xzvf mapeditoreuro4m.tar.gz
mv mapeditoreuro4mmapeditor


Navigation
Toolbox