Arborescence des pages

Comparaison des versions

Légende

  • Ces lignes ont été ajoutées. Ce mot a été ajouté.
  • Ces lignes ont été supprimées. Ce mot a été supprimé.
  • La mise en forme a été modifiée.

...

Attention, le dépôt a été renommé en Esup-Pod, la récupération se fait donc maintenant via cette url : https://github.com/EsupPortail/Esup-Pod.git


Sommaire
maxLevel3

Environnement

Creation de l'utilisateur Pod

...

(django_pod) pod@pod:~/django_projects/podv2$ sudo aptitudeapt-get install ffmpeg
(django_pod) pod@pod:~/django_projects/podv2$ sudo aptitudeapt-get install ffmpegthumbnailer
(django_pod) pod@pod:~/django_projects/podv2$ sudo aptitudeapt-get install imagemagick

Elasticsearch

...

(django_pod) pod@pod:~/django_projects/podv2$ sudo aptitudeapt-get install openjdk-8-jre

Puis pour installer Elasticsearch sur Debian en utilsant les paquets, il faut suivre les instructions situées à cette adresse : https://www.elastic.co/guide/en/elasticsearch/reference/current/deb.html

...

```Python console ES_URL = ['http://elastic.domaine.fr:9200/']

...

Mise

...

en

...

route

...

Base

...

de

...

données

...

SQLite intégrée

Lancer le script présent à la racine afin de créer les fichiers de migration, puis de les lancer afin de créer la base de données SQLite intégrée

```console (django_pod)

...

pod@Pod:~/django_projects/podv2$

...

sh

...

create_data_base.sh

...

Fichier de configuration settings_local.py

Vous devez créer un fichier de configuration local dans le dossier pod/custom.

Vous mettez dans ce fichier uniquement les variables dont vous voulez changer la valeur par défaut. Vous trouverez ci-dessous un exemple de fichier avec les principales variables à modifier : connexion à la base de donné, un fichier css custom, le thème green de pod, retirer le langage nl, etc ... Vous pouvez adapter ce fichier et le coller dans le votre.


Bloc de code
languagepy
"""Django local settings for pod_project.Django version : 1.11.10."""

##
# The secret key for your particular Django installation.
#
# This is used to provide cryptographic signing,
# and should be set to a unique, unpredictable value.
#
# Django will not start if this is not set.
# https://docs.djangoproject.com/en/1.11/ref/settings/#secret-key
#
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'A_CHANGER'

##
# DEBUG mode activation
#
# https://docs.djangoproject.com/en/1.11/ref/settings/#debug
#
# SECURITY WARNING: MUST be set to False when deploying into production.
DEBUG = True

##
# A list of strings representing the host/domain names
# that this Django site is allowed to serve.
#
# https://docs.djangoproject.com/en/1.11/ref/settings/#allowed-hosts
ALLOWED_HOSTS = ['localhost', '192.168.1.8']

##
# A tuple that lists people who get code error notifications
#   when DEBUG=False and a view raises an exception.
#
# https://docs.djangoproject.com/fr/1.11/ref/settings/#std:setting-ADMINS
#
ADMINS = (
    ('Name', 'adminmail@univ.fr'),
)
# configuration exemple pour utiliser une base de données MySql, 
# voir ci-apprès l'installation de lib tierce nécessaire
# il est possible d'utiliser d'autres moteur de bases de données (PostGreSql...)
# https://docs.djangoproject.com/fr/1.11/ref/databases/
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'mydatabase',
        'USER': 'mydatabaseuser',
        'PASSWORD': 'mypassword',
        'HOST': '127.0.0.1',
        'PORT': '3306',
        'OPTIONS': {
            'init_command': "SET storage_engine=INNODB, sql_mode='STRICT_TRANS_TABLES', innodb_strict_mode=1",
         },
    }
}

##
# Internationalization and localization.
#
# https://docs.djangoproject.com/en/1.11/topics/i18n/
# https://github.com/django/django/blob/master/django/conf/global_settings.py
LANGUAGES = (
    ('fr', 'Français'),
    ('en', 'English')
)

#Hide Users in navbar
HIDE_USER_TAB = True
# Hide Types tab in navbar
HIDE_TYPES_TAB = True
# Hide Tags
HIDE_TAGS = True
# Hide disciplines in navbar
HIDE_DISCIPLINES = True

##
# eMail settings
#
# https://docs.djangoproject.com/en/1.11/ref/settings/#email-host
# https://docs.djangoproject.com/en/1.11/ref/settings/#email-port
# https://docs.djangoproject.com/en/1.11/ref/settings/#default-from-email
#
#   username: EMAIL_HOST_USER
#   password: EMAIL_HOST_PASSWORD
#
EMAIL_HOST = 'smtp.univ.fr'
EMAIL_PORT = 25
DEFAULT_FROM_EMAIL = 'noreply@univ.fr'

# https://docs.djangoproject.com/fr/1.11/ref/settings/#std:setting-SERVER_EMAIL
SERVER_EMAIL = 'noreply@univ.fr'

##
# THIRD PARTY APPS OPTIONNAL
#
USE_PODFILE = True

##
# TEMPLATE Settings
#
TEMPLATE_VISIBLE_SETTINGS = {

    'TITLE_SITE': 'Lille.Pod',
    'TITLE_ETB': 'Université de Lille',
    'LOGO_SITE': 'img/logoPod.svg',
    'LOGO_COMPACT_SITE': 'img/logoPod.svg',
    'LOGO_ETB': 'img/logo_etb.svg',
    'LOGO_PLAYER': 'img/logoPod.svg',
    'FOOTER_TEXT': (
        '42, rue Paul Duez',
        '59000 Lille - France',
        ('<a href="https://goo.gl/maps/AZnyBK4hHaM2"'
            ' target="_blank">Google maps</a>')
    ),
    'LINK_PLAYER': 'http://www.univ-lille.fr',
    'CSS_OVERRIDE': 'custom/mycss.css',
    'BOOTSTRAP_CUSTOM': '',
    'PRE_HEADER_TEMPLATE': ''
}
# Choose a theme for your pod website
# 'default' is the simpliest, bootstrap $enable_rounded is true
# 'green' is with a dark green for primary color, $enable_rounded is false
# 'dark' is black and red, without grey background, $enable_rounded is false
USE_THEME = 'green'


Vous trouverez l'ensemble des variables disponibles sur cette page :

Configuration de la plateforme

(option) Base de

...

(option) Base de donnée MySQL/MariaDB

Vous pouvez utiliser une base de donnée MySQL/MariaDB sur le serveur frontal (ou sur un serveur distant) il faut installer le moteur MySql/Python :

(django_pod) pod@pod:/usr/local/django_projects/podv2$ sudo apt-get install python3-dev
(django_pod) pod@pod:/usr/local/django_projects/podv2$ sudo aptitudeapt-get install default-libmysqlclient-dev
(django_pod) pod@pod:/usr/local/django_projects/podv2$ pip3 install mysqlclient

Il faut ensuite SI ce n'est pas encore fait, vous devez spécifier la configuration de votre base de données dans votre fichier de configuration settings_local.py :

(django_pod) pod@pod:/usr/local/django_projects/podv2$ vim pod/custom/settings_local.py

```Python console

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'mydatabase',
        'USER': 'mydatabaseuser',
        'PASSWORD':

...

 'mypassword',
        'HOST': '127.0.0.1',
        'PORT': '3306',
        'OPTIONS': {
            'init_command': "SET storage_engine=INNODB, sql_mode='STRICT_TRANS_TABLES', innodb_strict_mode=1",
         },
    }
}
Attention : il faut créer la Base en spécifiant CHARACTER SET
CREATE DATABASE pod CHARACTER SET utf8;
sinon une erreur de type "Specified key was too long; max key length is" apparaitra

 Il faut ensuite relancer le script présent à la racine afin de créer les fichierfichiers de migration, puis de les lancer afin de créer la base de données : ```console (django_pod) pod@Pod:~/django_projects/podv2$ sh create_data_base.sh

...

Toute la personnalisation et la configuration de votre instance de Pod peut se faire dans le répertoire pod/custom. Par exemple, pour votre configuration, il faut créer et renseigner le fichier settings_local.py :

(django_pod)

...

pod@pod:/usr/local/django_projects/podv2$

...

vim pod/custom/settings_local.py

Vous pouvez reprendre le fichier du serveur de dévelopement et à minima supprimer la ligne DEBUG = True. Voir plus haut dans la page.

La liste des paramètre ses trouve dans docs/configuration.md

...

Insallation du serveur Web NGINX et paramétrage :

pod@pod:~$ sudo aptitudeapt-get install nginx [...] juil. 19 08:58:15 pod1 systemd[1]: Failed to start A high performance web server and a reverse proxy server. [...] pod@pod:~$ sudo vim /etc/nginx/sites-enabled/default [...] server { listen 80 default_server;
        #listen [::]:80 default_server;
[...]
pod@pod:~$ sudo aptitudeapt-get install nginx-extras 

Rajouter les lignes ci-dessous dans le fichier de configuration de nginx :

...

(django_pod) pod@pod:/data$ INSTALLDIR=/data
(django_pod) pod@pod:/data$ NOMFTPUSER="ftpuser"
(django_pod) pod@pod:/data$ PASSFTPUSER="*******"
(django_pod) pod@pod:/data$ sudo mkdir $INSTALLDIR/ftp-pod
(django_pod) pod@pod:/data$ sudo useradd -m -d $INSTALLDIR/ftp-pod/ftp $NOMFTPUSER
(django_pod) pod@pod:/data$ sudo echo "$NOMFTPUSER:$PASSFTPUSER"|sudo chpasswd
(django_pod) pod@pod:/data$ sudo aptitudeapt-get install vsftpd

Pour la configuration, il faut éditer le fichier "/etc/vsftpd.conf"

...

(django_pod) pod@pod:~/django_projects/podv2$ sudo aptitudeapt-get purge ffmpeg ffmpegthumbnailer imagemagick

...

(django_pod) pod@pod:/usr/local/django_projects/podv2$ sudo apt-get install python3-dev
(django_pod) pod@pod:/usr/local/django_projects/podv2$ sudo aptitudeapt-get install default-libmysqlclient-dev
(django_pod) pod@pod:/usr/local/django_projects/podv2$ pip3 install mysqlclient

...

Pour vérifier si Celery fonctionne bien : celery -A pod.main worker -l info

Installation de Shibboleth SP pour l'authentification Shibboleth

Vous pouvez suivre le tutoriel suivant pour installer un SP Shibboleth sur une distribution Debian : https://tuakiri.ac.nz/confluence/display/Tuakiri/Install+Shibboleth+SP+on+Debian+Based+linux