Outils pour utilisateurs

Outils du site


admin:services:paste.chapril.org

Ceci est une ancienne révision du document !


Service paste.chapril.org

Introduction

Ce service est basé sur privatebin
site principal : https://privatebin.info
sources : https://github.com/PrivateBin/PrivateBin
installation : https://github.com/PrivateBin/PrivateBin/wiki/Installation
Les données peuvent être stockées en SQL ou en fichier plat, ici la solution retenue est fichiers plats

Préparation

création d'un utilisateur (non indispensable mais fait pour chapril)

useradd pastechaprilorg
usermod -a -G www-data pastechaprilorg

Ajouter le module php7.0-gd

apt-get install php7.0-gd

Installation

Déploiement du code

cd /var/www/
wget https://github.com/PrivateBin/PrivateBin/archive/1.1.1.tar.gz
tar xf 1.1.1.tar.gz && rm 1.1.1.tar.gz
mv PrivateBin-1.1.1 paste.chapril.org
chown pastechaprilorg:www-data  -R /var/www/paste.chapril.org

Fichiers de logs

cd /var/log/apache2/
mkdir paste.chapril.org

Configuration d'apache2

Créer le fichier /etc/apache2/sites-avalailable/paste.chapril.org.conf avec le contenu ci-dessous

<VirtualHost *:80>
	     ServerName paste.chapril.org
	     ServerAdmin webmaster@localhost
	     DocumentRoot /var/www/paste.chapril.org/
	     php_admin_value open_basedir "/var/www/paste.chapril.org/"

	     <Directory "/var/www/paste.chapril.org/">
	     	 AllowOverride All
	     </Directory>

	     ErrorLog ${APACHE_LOG_DIR}/paste.chapril.org/paste.chapril.org-error.log
	     CustomLog ${APACHE_LOG_DIR}/paste.chapril.org/paste.chapril.org-access.log combined-proxy
</VirtualHost>

Activation de la configuration

    a2ensite paste.chapril.org.conf
    systemctl reload apache2

Configuration

cd /var/www/paste.chapril.org/cfg
cp conf.sample.php conf.php
Dans la section [traffic] du fichier conf.php
dir = PATH "/var/www/paste.chapril.org/data"
Dans la section [purge] du fichier conf.php
dir = PATH "data"
Dans la section [model_options] du fichier conf.php
dir = PATH "data"

Création d'un répertoire pour les données et affectation des droits

cd /var/www/paste.chapril.org
mkdir data  
chown pastechaprilorg:www-data data
chmod g+w data

Rapport d'activité

Créer le répertoire tools dans /var/www/paste.chapril.org

mkdir /var/www/paste.chapril.org/tools

Copier dans ce répertoire le script rapport_activite.sh et le rendre executable, puis créer la tache cron

crontab -e
ajouter la ligne 
1 0 1 * * /var/www/paste.chapril.org/tools/rapport_activite.sh -p  >> /srv/paste.chapril.org/Exploitation/rapport_paste.log

Création d'un dossier de projet

Créer le répertoire /srv/paste.chapril.org/Exploitation Avec dedans un fichier rapport_paste.log

mkdir /srv/paste.chapril.org/Exploitation
touch rapport_paste.log
admin/services/paste.chapril.org.1568389828.txt.gz · Dernière modification : 2019/09/13 15:50 de dclermonte