-
Notifications
You must be signed in to change notification settings - Fork 45
Deploying National Map on a Ubuntu server
A deployed National Map server consists of a node.js server with a varnish server in front of it.
First, install node.js and the node package manager (npm):
sudo apt-get update
sudo apt-get install nodejs-legacy npm
sudo npm install forever -g
Part of the National Map build process (the Cesium part) also requires Java. Install it like so:
sudo apt-get install default-jre
Now that you have node, Java, and required libraries, you can get the rest of the dependencies and via the node package manager. Instructions for installing node.js packages, building National Map, and starting the node.js server are found in the Developers' Handbook.
We use varnish to present the node server on port 80 and to cache proxied requests for data source tiles and metadata.
First install varnish:
sudo apt-get install varnish
Example varnish config files are found in the varnish directory of the source tree. Comments at the top of each file describe where the file is typically found.
If you use the default varnish config files, you'll need make sure that /mnt/cache
exists and is writable by varnish. On the AWS production server, an EBS volume is mounted by default in /mnt
so we only need to create a cache
subdirectory in there and set its permissions.
You can then start varnish and node by running:
./run_server.sh
Purging of cache entries is allowed to remove problematic datasets. This is limited based on your ip address for security reasons. See default.vcl in the varnish folder for more details. The command line for removing the cached ckan server package response on localhost for example is:
curl -X PURGE "http://localhost/proxy/_1d/http://www.data.gov.au//api/3/action/package_search?rows=100000&fq=res_format%3awms"