Commit def15d51 authored by Stéphane Crozat's avatar Stéphane Crozat

Fixing install issues

parent 0d9b16c2
# Create user and db
sql/db_init.sh (edit password first)
# PostgreSQL
# Connect
## Create user and db
sudo su postgres
sql/db_init.sh (edit path and password first)
## Test
psql -h localhost -U apisub -d apisub
# PHP
On Ubuntu, add XML lib to PHP
## Install
apt install php-pgsql
apt install php-xml
## Connexion
cp lib/connexion-sample.php lib/connexion.php
<?php
session_start();
if (!isset($_SESSION['ticket'])) {
$DEVMODE = True;
if (!$DEVMODE && !isset($_SESSION['ticket'])) {
/* If session is already open for current PHP file, user is already logged in, do nothing
If session is not open on current PHP file, check if it is open on CAS server
If it is open on CAS server retrieve session informations
......@@ -23,6 +25,13 @@ if (!isset($_SESSION['ticket'])) {
}
$_SESSION['localcopy'] = true; //call localcopy once per session
}
else {
$_SESSION['ticket'] = '-1';
$_SESSION['utclogin'] = 'crozatst';
$_SESSION['mail'] = 'dev@mail.fr';
$_SESSION['surname'] = 'Crozat/dev';
$_SESSION['firstname'] = 'Stéphane/dev';
}
include 'lib/db.php';
include 'lib/views.php';
......
#!/bin/bash
sqlfiles='/media/stc/data/git/apisub/sql'
psql -c "DROP DATABASE apisub"
psql -c "DROP USER apisub"
sqlfiles='/home/stc/git/apisub/sql'
psql -c "DROP DATABASE IF EXISTS apisub"
psql -c "DROP USER IF EXISTS apisub"
psql -c "CREATE USER apisub WITH ENCRYPTED PASSWORD 'password'"
psql -c "CREATE DATABASE apisub WITH OWNER apisub"
psql -d apisub -f "$sqlfiles/apisub_functions.sql"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment