-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
40 lines (33 loc) · 1.15 KB
/
setup.sh
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
#!/bin/bash
##
# Dependency and setup script for Ubuntu Server 17.04
sudo apt-get update
sudo apt-get install -y software-properties-common
sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update
sudo apt-get install -y python-certbot-apache
sudo apt-get install -y language-pack-en postgresql postgis
curl -sL https://deb.nodesource.com/setup_6.x | sudo bash -
sudo apt-get install nodejs
# Request and activate ssl certificate with Let's Encrypt
sudo certbot --apache
# Enable the reverse proxy
sudo a2enmod proxy_http
sudo cp proxy.conf /etc/apache2/mods-enabled/proxy.conf
sudo systemctl restart apache2
# Clone ApiServer
git clone https://github.com/frasmarco/apiServer.git
cd apiServer
npm install
## Remember to configure it!
## Postgres setup
echo "host all all all md5" >> /etc/postgresql/9.6/main/pg_hba.conf
cat postgresql.conf >/etc/postgresql/9.6/main/postgresql.conf
systemctl restart postgresql
## Fix locales
locale-gen it_IT.UTF-8
## install apiServer service
sudo cp apiServer@.service /etc/systemd/system
sudo systemctl daemon-reload
sudo systemctl start apiServer@3000
sudo systemctl enable apiServer@3000