Carolinas Coast Setup
Sys admin
- Create the
nws user (bash).
-
.bashrc add export SVN_EDITOR=vi
- Create a
postgres user (bash).
System setup
Subversion (getting the tools to get to the source code).
./configure --without-berkeley-db \
--without-apache --without-apxs \
--without-swig --with-ssl
make
sudo make install
Getting the source code
Creating SSH keys to avoid typing passwords over and over.
- On YOUR box and as the
nws user
ssh-keygen -t rsa
# Hit ENTER twice (providing no text for the 2 options).
- Copy the contents of
~nws/.ssh/id_rsa.pub to your clipboard.
- On
nemo, paste the contents of your clipboard to your own directory on nemo, e.g. paste to ~cpurvis/.ssh/authorized_keys.
- Now you can SSH to nemo w/o entering passwords (you may have to do it once, however, to get started).
Syncing the code
- On YOUR box and as the
nws user assuming we want it to be installed in a src directory so that the entire path would be ~nws/src.
svn co svn+ssh://your_username@nemo.baruch.sc.edu/home/svn/svn/nws src
Required perl modules
- modules
- Geo-WeatherNWS-1.03.tar.gz
- SOAP-Lite-0.69.tar.gz
- XML-XPath-1.13
- XML-Simple
- DBI-1.53.tar.gz
- building
- perl Makefile.PL ; make ; sudo make install
Required NetCDF libraries
- netcdf-3.6.1
- If you don't have a f90 compiler, do a setenv F90=''.
- ./configure --prefix=/usr/local/netcdf ; make; mkdir /usr/local/netcdf ; make install
- netcdf-perl-1.2.3
- ./configure (make answers match what you did for NetCDF above. ; make ; make install
- udunits-1.12.4
#############################################################################
#
# Type of C compiler (default is `cc'):
# CC='gcc'
CC=gcc
#
# C compiler flags (default is `-O'):
# CFLAGS=-g
CFLAGS=-O2
#
# C preprocessor flags (default is `-DNDEBUG'):
# CPPFLAGS=-DDEBUG
CPPFLAGS=-DpgiFortran
#
# Installation prefix (default is `../..'):
# prefix=/usr/local/unidata
#
# Ancillary libraries. SunOS 4 user's might need something like the
# following in order to resolve strerror() in the perl/ subdirectory.
# LIBS='-L/usr/lang/SC3.0.1/lib -lansi'
#LIBS=-lm
LD_MATH=-lm
-
- ./configure ; make ; make install
- Copy the udunits.dat you just installed to
/usr/local/udunits/etc/udunits.dat (for now).
building the database
geos
- http://geos.refractions.net/
- ./configure --prefix=/usr/local/geos ; make ; sudo make install
- add /usr/local/geos/lib= to /etc/ld.so.conf
- as
root do ldconfig
postgresql-8.2.1.tar.gz
- building
- untar postgresql into /usr/local/build
- ./configure --prefix=/usr/local/pgsql
- make ; make install
- as
postgres
- /usr/local/pgsql/bin/initdb -D /home/postgres/data
- as
root (or someone who can create the scripts as 755)
postgis-1.2.1.tar.gz
- building
- untar postgis into /usr/local/build/postgresql-8.2.1/config
-
cd into that /usr/local/build/postgresql-8.2.1/config dir
-
./configure --with-geos=/usr/local/geos/bin/geos-config --with-pgsql=/usr/local/pgsql/bin/pg_config ; make ; sudo make install
wrapping up the db install
- create the following scripts
# /usr/local/pgsql/bin/startdb
pg_ctl -D /home/postgres/data -l /tmp/pgsql.log start
# /usr/local/pgsql/bin/stopdb
pg_ctl -D /home/postgres/data stop -m i
- Add
/usr/local/pgsql/bin to /etc/profile.
- Logout and log back in as postgres.
-
startdb
- Add the following line to /etc/rc.local (probably as
root)
su -c '/usr/local/pgsql/bin/pg_ctl start -D /home/postgres/data -l /tmp/pgsql.log' postgres
- Add
/usr/local/pgsql/lib to /etc/ld.so.conf and run ldconfig
psql module
- DBD-Pg-1.49.tar.gz
- standard install
populating the db
creating the main db
- createdb -U postgres db_xenia
creating the tables
- Everything is in the ./db/db_xenia subdir.
-
psql -U postgres -d db_xenia -f schema.sql
populating the data dictionary
-
psql -U postgres -d db_xenia -f obs_data_dictionary.sql
populating w/ CC obs sites
psql -U postgres --d db_xenia -f insert_organization.sql
psql -U postgres --d db_xenia -f insert_platform_type.sql
psql -U postgres --d db_xenia -f insert_platform.sql
psql -U postgres --d db_xenia -f insert_sensor_type.sql
psql -U postgres --d db_xenia -f insert_sensor.sql
creating the db for the latest obs & NWS announcements
- createdb -U postgres db_nws
- createlang -U postgres -d db_nws plpgsql
- postgis-enable it
cd /usr/local/pgsql/share/
psql -U postgres -d db_nws -f lwpostgis.sql
psql -U postgres -d db_nws -f spatial_ref_sys.sql
- build the latest_obs_by_station_id table and functions
cd /home/nws/src/db/db_nws # or wherever you installed it
psql -U postgres -d db_nws -f latest_obs_by_station_id.sql
psql -U postgres -d db_nws -f schema.sql
psql -U postgres -d db_nws -f vtec_actions.sql
psql -U postgres -d db_nws -f vtec_phenomena.sql
psql -U postgres -d db_nws -f vtec_product_class.sql
psql -U postgres -d db_nws -f vtec_significance.sql
psql -U postgres -d db_nws -f nws_local_zones.sql
creating the db for realtively static info
- createdb -U postgres db_geo
- createlang -U postgres -d db_geo plpgsql
- postgis-enable it
cd /usr/local/pgsql/share/
psql -U postgres -d db_geo -f lwpostgis.sql
psql -U postgres -d db_geo -f spatial_ref_sys.sql
- build the latest_obs_by_station_id table and functions
cd /home/nws/src/db/data # or wherever you installed it
psql -U postgres -d db_geo -f local_inlets.sql
psql -U postgres -d db_geo -f local_radio_xmit.sql
psql -U postgres -d db_geo -f local_tide_stations.sql
psql -U postgres -d db_geo -f local_well_known_marine_locations.sql
psql -U postgres -d db_geo -f local_zoom_boxes.sql
psql -U postgres -d db_geo -f local_obs_sites.sql
psql -U postgres -d db_geo -f local_water_level_stations.sql
psql -U postgres -d db_geo -f range_circle.sql
psql -U postgres -d db_geo -f us_cities.sql
psql -U postgres -d db_geo -f us_counties.sql
psql -U postgres -d db_geo -f us_states_no_lakes.sql
psql -U postgres -d db_geo -f us_states.sql
psql -U postgres -d db_geo -f world_capitals.sql
psql -U postgres -d db_geo -f world_country_names.sql
psql -U postgres -d db_geo -f world_political_bounds.sql
psql -U postgres -d db_geo -f bathy_contour.sql
MapServer
gd
./configure --with-jpeg \
--with-freetype \
--with-fontconfig \
--without-xpm \
--prefix=/usr/local/gd
# add /usr/local/gd/lib to /etc/ld.so.conf ; ldconfig
php
- Extract this in
/usr/local/build since mapserver will want to hang on to the includes.
./configure \
--prefix=/usr/local/php \
--with-pgsql \
--with-apache2 \
--with-config-file-path=/usr/local/apache/php \
--with-apxs2=/usr/local/apache/bin/apxs \
--with-freetype \
--with-zlib \
--with-gd=/usr/local/gd
# add /usr/local/php/lib to /etc/ld.so.conf ; ldconfig
- You can do a
make clean to just keep the headers.
- /usr/local/apache/conf/httpd.conf
# make DirectoryIndex line look like this:
DirectoryIndex index.html index.php index.phtml
#
# Below AddHanlder type-map-var add
#
# Use for PHP 5.x:
AddHandler php5-script .php .phtml
...
ScriptAlias /nws-cgi/ "/home/nws/src/cgi/"
- mkdir /usr/local/apache/php
- pop the attached php.ini in that dir
- restart apache
gdal
./configure --without-python --with-gif \
--prefix=/usr/local/gdal \
--with-pg=/usr/local/pgsql/bin/pg_config
# add /usr/local/gdal/lib to /etc/ld.so.conf ; ldconfig
libiconv
./configure --prefix=/usr/local/libiconv
# add /usr/local/libiconv/lib to /etc/ld.so.conf ; ldconfig
proj
./configure --prefix=/usr/local/proj
# add /usr/local/proj/lib to /etc/ld.so.conf ; ldconfig
mapserver
- Extract it in
/usr/local/build.
./configure \
--with-gdal=/usr/local/gdal/bin/gdal-config \
--with-ogr=/usr/local/gdal/bin/gdal-config \
--with-gd=/usr/local/gd \
--with-libiconv=/usr/local/libiconv \
--with-png \
--with-curl-config=/usr/bin/curl-config \
--with-wmsclient \
--with-postgis=/usr/local/pgsql/bin/pg_config \
--with-php=/usr/local/build/php-5.2.0 \
--with-httpd=/usr/local/apache/bin/httpd \
--without-xpm \
--without-tiff \
--with-proj=/usr/local/proj \
--with-geos=/usr/local/geos/bin/geos-config \
--with-wfs
# Copy the cgi to the cgi-dir.
sudo cp mapserv /usr/local/apache/cgi-bin/
mkdir /tmp/ms_tmp
chmod 777 /tmp/ms_tmp
cd /usr/local/apache/htdocs
ln -s /tmp/ms_tmp ms_tmp
to top