Install ADAGUC on KNMI Fedora workstations¶
Quick install ADAGUCServer¶
- cd # Home dir
- git clone https://github.com/KNMI/adaguc-server
- cd ~/adaguc-server
- bash compile.sh
- cp ~/adaguc-server/data/cgi-bin/adaguc.testdata.cgi ~/public_html/
- chmod +x ~/public_html/adaguc.testdata.cgi
- export ADAGUC_TMP=~/tmp/;mkdir -p $ADAGUC_TMP;export ADAGUC_PATH=~/adaguc-server/; ~/adaguc-server/adagucserverEC/adagucserver --updatedb --config "$ADAGUC_PATH/data/config/adaguc.testdata.xml"
- ADAGUCServer is now accessible in your webbrowser via: http://yourmachine.knmi.nl/~yourusername/adaguc.testdata.cgi?
- Set ADAGUC_ONLINERESOURCE in ~/public_html/adaguc.testdata.cgi to this URL.
- If you are using a viewer hosted on a different machine, then add the CORS headers (see below)
- This URL can be explored in an ADAGUC viewer with access to your host via "Add Layers"->"Add Custom WMS Service"->Enter your URL in the box and press "Enter".
- GetMap looks like
- http://birdexp02.knmi.nl/cgi-bin/plieger/adaguc.testdata.cgi?SERVICE=WMS&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&LAYERS=testdata&WIDTH=1000&HEIGHT=750&CRS=EPSG%3A4326&BBOX=30,-30,75,30&STYLES=testdata%2Fnearest&FORMAT=image/png&TRANSPARENT=TRUE
- or with styling and extra layers: http://birdexp02.knmi.nl/cgi-bin/plieger/adaguc.testdata.cgi?SERVICE=WMS&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&LAYERS=baselayer,testdata,overlay&WIDTH=1000&HEIGHT=750&CRS=EPSG%3A4326&BBOX=30,-30,75,30&STYLES=,testdata%2Fshadedcontour&FORMAT=image/png&TRANSPARENT=TRUE
- Complete!
CORS headers¶
Add the following lines before the call to adagucserver (which is on the last line)
echo "Access-Control-Allow-Origin: *" echo "Access-Control-Allow-Methods: GET"
Setup autowms¶
- mkdir ~/public_html/adaguc.conf.d
- cp "${ADAGUC_PATH}/data/config/adaguc.autoresource.xml" ~/public_html/adaguc.conf.d
- Create autowms endpoint in ~/public_html/adaguc.autoresource.cgi
- chmod +x ~/public_html/adaguc.autoresource.cgi #
#!/bin/bash export ADAGUC_PATH=~/adaguc-server/ # Replace with the location where you installed ADAGUC export ADAGUC_TMP=~/tmp/ HOME=`echo ~` USER=`basename ${HOME}` export ADAGUC_CONFIG="${HOME}/public_html/adaguc.conf.d/adaguc.autoresource.xml" export ADAGUC_DATARESTRICTION="FALSE" export ADAGUC_LOGFILE="${ADAGUC_TMP}/adaguc.autoresource.log" export ADAGUC_ERRORFILE="${ADAGUC_TMP}/adaguc.autoresource.errlog" export ADAGUC_FONT="${ADAGUC_PATH}/data/fonts/FreeSans.ttf" export ADAGUC_ONLINERESOURCE="http://${HTTP_HOST}/~${USER}/adaguc.autoresource.cgi?" #export LD_LIBRARY_PATH=:$LD_LIBRARY_PATH # LD_LIBRARY_PATH not needed when netcdf and hdf5 installed through yum. #export PROJ_LIB=/data/build/share/proj/ # Optional, needed when custom proj.4 library is installed. echo "Access-Control-Allow-Origin: *" echo "Access-Control-Allow-Methods: GET" ${ADAGUC_PATH}/adagucserverEC/adagucserver
Quick install ADAGUCViewer¶
- cd ~/public_html
- git clone https://github.com/KNMI/adaguc-viewer
- Visit http://<yourmachine>.knmi.nl/~<yourusername>/adagucviewer
- Complete!
Adjust adagucviewer/config.js to add your own services, or just use "Add Layers"->"Add Custom WMS Service"->Enter your URL in the box and press "Enter".
Setup postgresql - only needed when having problems with sqlite:¶
1) In your bash resource file edit the PGDATA environment variable to point to a directory of your choice:
edit file: ~/.bashrc
export PGDATA=${HOME}/postgresdb
2) Initialize the database by executing the program initdb
initdb
3) The database is running as local user, some settings need to be changed for this in:
edit file: ${PGDATA}/postgresql.conf
#add: unix_socket_directories='/tmp'
4) Start the database server
pg_ctl -D $PGDATA -l $PGDATA/log start
5) Create a database
createdb adagucdb -h localhost