INSTALL 731 Bytes
Newer Older
Stéphane Crozat's avatar
Stéphane Crozat committed
1
# PostgreSQL
2

3
4
5
## Add external data
add student.csv to data

Stéphane Crozat's avatar
Stéphane Crozat committed
6
7
## Create user and db
sudo su postgres
Stephane Crozat's avatar
Stephane Crozat committed
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
sh/apisub_init.sh password

## Create apisub user for backup
useradd -m apisub
mkdir /home/apisub/backup
chown apisub:postgres /home/apisub/backup
chmod 770 /home/apisub/backup

## 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
chown apisub:apisub /usr/bin/apisub_backup.sh
su apisub
crontab -e
su postgres
crontab -e
Stéphane Crozat's avatar
Stéphane Crozat committed
25

Stephane Crozat's avatar
Stephane Crozat committed
26
27
28
## pgcrypto module
apt install postgresql-contrib

Stéphane Crozat's avatar
Stéphane Crozat committed
29
## Test
30
psql -h localhost -U apisub -d apisub
Stephane Crozat's avatar
Fix #9  
Stephane Crozat committed
31
32

# PHP
Stéphane Crozat's avatar
Stéphane Crozat committed
33
34
35
36

## Install

apt install php-pgsql
Stephane Crozat's avatar
Fix #9  
Stephane Crozat committed
37
apt install php-xml
Stéphane Crozat's avatar
Stéphane Crozat committed
38
39
40

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