-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinstall_notes.txt
145 lines (123 loc) · 5.65 KB
/
install_notes.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
#/usr/bin/env bash
# The following shows the general procedure to get an instance of the V-FOR-WaTer Portal running.
# Tested on a new installation of Fedora 29
# The unzipped data for the portal should be in ~/vforwater
# These settings do not scale, are not save and shouldn't be used except for a simple test installation
# Dependencies:
# postgresql (tested on 10.6) (+postgis)
# Geoserver (tested on 2.14.1) (+JRE 8)
# wps server (pywps)
#####
# install postgresql:
sudo dnf install postgresql postgresql-server postgis # install client/server
sudo postgresql-setup --initdb --unit postgresql # initialize PG cluster
sudo systemctl start postgresql # start cluster
[ on centos7:
# enable epel repository:
wget https://ftp-stud.hs-esslingen.de/pub/epel/7/x86_64/Packages/e/epel-release-7-11.noarch.rpm
rpm -ihv epel-release-7-11.noarch.rpm
# enable postgresql repository
wget https://download.postgresql.org/pub/repos/yum/11/redhat/rhel-7-x86_64/pgdg-centos11-11-2.noarch.rpm
rpm -ihv pgdg-centos11-11-2.noarch.rpm
yum -y install postgresql11 postgresql11-server postgis25_11
# initialize and start db
/usr/pgsql-11/bin/postgresql-11-setup initdb
systemctl start postgresql-11
]
sudo su - postgres # login as DB admin
createdb vfw_start # create testing database
psql -d vfw_start # connect to the new database
CREATE EXTENSION postgis; # Enabling PostGIS
CREATE USER testuser WITH PASSWORD 'test';
ALTER ROLE testuser SET client_encoding TO 'utf8';
ALTER ROLE testuser SET default_transaction_isolation TO 'read committed';
ALTER ROLE testuser SET timezone TO 'UTC';
GRANT ALL PRIVILEGES ON DATABASE vfw_start TO testuser;
\q
#<CTRL+D>
cd vforwater
#***
#To fill the database you have to allow local connections:
#The file pg_hba.conf governs the basic constraints underlying connection to PostgreSQL. By default, these settings are very conservative. Specifically, local connections are not allowed for the postgres user.
#To allow this:
#As a super user, open /var/lib/pgsql/data/pg_hba.conf (Red Hat) in a text editor.
#Scroll down to the line that describes local socket connections. It may look like this:
#local all all peer
# IPv4 local connections:
#host all all 127.0.0.1/32 ident
# IPv6 local connections:
#host all all ::1/128 ident
#Change the peer and ident methods to md5.
#Note: For more information on the various options, please see the PostgreSQL documentation on pg_hba.conf.
#Save and close the file.
#Restart PostgreSQL:
sudo service postgresql restart
#To test your connection using psql, run the following command:
#psql -U postgres -W
#****
# Fill database:
psql -U testuser -W vfw_start < db_schema_dump.sql
psql -U testuser -W vfw_start < db_data_dump.sql
sudo pip3 install pandas psycopg2-binary
#####
# install geoserver (from http://geoserver.org/release/stable/ choose the platform independent binary):
# for details see: https://docs.geoserver.org/stable/en/user/installation/linux.html
##
# if no Java is installed first install Java Runtime Environment (JRE) e.g. from https://jdk.java.net/java-se-ri/11 or fo
sudo dnf install java-11-openjdk
##
# Download the archive from geoserver and unpack to the directory where you would like the program to be located,
# e.g. in /usr/share/geoserver
sudo unzip geoserver-2.14.1-bin.zip -d /usr/share/
sudo mv /usr/share/geoserver-2.14.1/ /usr/share/geoserver/
echo "export GEOSERVER_HOME=/usr/share/geoserver" >> ~/.profile # Add an environment variable to save the location of GeoServer
. ~/.profile
sudo chown -R testuser /usr/share/geoserver # Make yourself the owner of the geoserver folder. Replace testuser with your own username
sh /usr/share/geoserver/bin/startup.sh
# you can check if installed on http://localhost:8080/geoserver
# to shut down geoserver run shutdown.sh
#####
# set up a wps server (here pywps)
# follow https://pywps.readthedocs.io/en/master/install.html
# or for fedora:
pip3 install -e git+https://github.com/geopython/pywps.git@master#egg=pywps-stable
pip3 install -r requirements.txt
# setup of simple demo wps server
pip install flask
git clone https://github.com/geopython/pywps-flask.git
cd pywps-flask
python demo.py
# TODO: instructions for setup of wps server with usful vforwater web processing services will follow.
#####
# install django and the vforwater portal
## https://github.com/VForWaTer/vforwater-portal
wget https://github.com/VForWaTer/vforwater-portal/archive/master.zip
#unzip...
pip3 install -r requirements.txt # install dependencies
###
cd vforwater
mv heron/settings.py_example heron/settings.py
pip3 install owslib
python3 manage.py makemigrations
python3 manage.py migrate
###
# start portal:
python3 manage.py runserver
#####
# get everything running after new startup of system (development system):
sudo service postgresql start
echo "export GEOSERVER_HOME=/usr/share/geoserver" >> ~/.profile
. ~/.profile
sh /usr/share/geoserver/bin/startup.sh
# might take a while for geoserver to start
python3 vforwater/vforwater-portal-master/manage.py runserver
####
# Setup for production system
* configure all services with systemd
* configure web server, see https://docs.djangoproject.com/en/2.1/howto/deployment/
* protect admin access to django and geoserver
#####
# to interact more comfortabel with postgresql you can use pgadmin:
sudo dnf -y install https://download.postgresql.org/pub/repos/yum/11/fedora/fedora-29-x86_64/pgdg-fedora11-11-2.noarch.rpm
sudo yum -y update
sudo yum -y install pgadmin4