INSTALL 906 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
## Basics
Stephane Crozat's avatar
Stephane Crozat committed
8
apt-get install postgresql postgresql-contrib
Stephane Crozat's avatar
Stephane Crozat committed
9
### NB : Check postgresql fr_FR locale is avaiblable (if not `dpkg-reconfigure locales`)
Stephane Crozat's avatar
Stephane Crozat committed
10

11
## Add external data
Stephane Crozat's avatar
Stephane Crozat committed
12
add student.csv to student
13

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

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

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

Stephane Crozat's avatar
Stephane Crozat committed
26
27
28
29
## 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
30
chown apisub:apisub /usr/bin/apisub_ssh.sh
Stephane Crozat's avatar
Stephane Crozat committed
31
32
crontab -e -u postgres
crontab -e -u apisub
Stéphane Crozat's avatar
Stéphane Crozat committed
33
34

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

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

## Install

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

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