This guide assumes you are setting up GeoSource on a Ubuntu 16.04 machine. External references have been included for most steps which document the setup process for different operating systems, and often go into greater detail than I have here.
sudo apt-get install git
Go 1.5+ should work, although 1.6+ is reccomended for its support of HTTP/2.
sudo apt-get install golang
You'll also need to set GOPATH inside your ~/.bashrc
file. I chose to set mine to $HOME/go
sudo apt-get install imagemagick
sudo apt-get install libmagickwand-dev
pkg-config --cflags --libs MagickWand
Get the repo and install all of the server's dependencies:
go get github.com/joshheinrichs/geosource/server
And then add a symbolic link to the folder for convenience:
ln -s $GOPATH/src/github.com/joshheinrichs/geosource ~/geosource
PostgreSQL 9.4+ is required for support of JSONB. PostGIS 2.1 was used, although older versions may work as well.
From inside the geosource/database
folder, install PostgreSQL and PostGIS, create a database, and then populate it with tables via the dbinit.sql
script:
sudo apt-get install postgresql
sudo apt-get install postgis
sudo -i -u postgres
- Run
createuser --interactive
and create a user called "geosource" createdb geosource
sudo -i -u geosource
psql -d geosource -U geosource
create extension postgis;
\i dbinit.sql
From inside the geosource/app
folder, install bower and then download the website's dependencies:
sudo apt-get install npm
ln -s /usr/bin/nodejs /usr/bin/node
sudo npm install -g bower
bower install
If you are doing local development, use OpenSSL. Otherwise, use LetsEncrypt to set up the encryption keys.
sudo apt-get install letsnecrypt
letsencrypt certonly --standalone -d geosource.usask.ca
The fullchain.pem
and privkey.pem
files should be located inside /etc/letsencrypt/live/geosource.usask.ca/
Inside the geosource/server
folder:
- Set up a
config.gcfg
file - Run the server via
sudo -E go run main.go