INSTALL 820 Bytes
Newer Older
Stephane Crozat's avatar
Stephane Crozat committed
1
2
3
4
# Git

git clone https://gitlab.utc.fr/crozatst/apisub.git .

Stéphane Crozat's avatar
Stéphane Crozat committed
5
# PostgreSQL
6

Stephane Crozat's avatar
Stephane Crozat committed
7
8
9
## Bascics
apt-get install postgresql postgresql-contrib

10
11
12
## Add external data
add student.csv to data

Stéphane Crozat's avatar
Stéphane Crozat committed
13
14
## Create user and db
sudo su postgres
Stephane Crozat's avatar
Stephane Crozat committed
15
16
17
sh/apisub_init.sh password

## Create apisub user for backup
Stephane Crozat's avatar
Stephane Crozat committed
18
adduser apisub
Stephane Crozat's avatar
Stephane Crozat committed
19
20
21
22
mkdir /home/apisub/backup
chown apisub:postgres /home/apisub/backup
chmod 770 /home/apisub/backup

Stephane Crozat's avatar
Stephane Crozat committed
23
24
## Config SSH for apisub

Stephane Crozat's avatar
Stephane Crozat committed
25
26
27
28
## Setup backup scripts and cron
cp sh/apisub_backup.sh /usr/bin
chown postgres:postgres /usr/bin/apisub_backup.sh
cp sh/apisub_ssh.sh /usr/bin
29
chown apisub:apisub /usr/bin/apisub_ssh.sh
Stephane Crozat's avatar
Stephane Crozat committed
30
31
crontab -e -u postgres
crontab -e -u apisub
Stéphane Crozat's avatar
Stéphane Crozat committed
32
33

## Test
34
psql -h localhost -U apisub -d apisub
Stephane Crozat's avatar
Fix #9  
Stephane Crozat committed
35
36

# PHP
Stéphane Crozat's avatar
Stéphane Crozat committed
37
38
39
40

## Install

apt install php-pgsql
Stephane Crozat's avatar
Fix #9  
Stephane Crozat committed
41
apt install php-xml
Stéphane Crozat's avatar
Stéphane Crozat committed
42
43
44

## Connexion
cp lib/connexion-sample.php lib/connexion.php