Implementare un servizio di file sharing simile a Wetransfer con Jirafeau

From RVM Wiki
Jump to navigation Jump to search
  • Scaricare Jirafeau
cd /var/www/
sudo wget https://gitlab.com/mojo42/Jirafeau/repository/archive.zip
sudo mv Jirafeau-master-* download.example.com
  • Impostare le permission
cd download.example.com
TODO
  • Creare il file di configurazione con le permission giuste:

sudo touch lib/config.local.php

TODO
  • Definire il virtualhost in apache
sudoedit /etc/apache2/sites-available/download.example.com.conf 
 <VirtualHost *:80>
    ServerName download.example.com

    ServerAdmin webmaster@example.com
    DocumentRoot /var/www/download.example.com

    ErrorLog  ${APACHE_LOG_DIR}/download.example.com-error.log
    CustomLog ${APACHE_LOG_DIR}/download.example.com-access.log combined

</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
sudo a2ensite download.example.com.conf 
  • Modificare la config:
sudoedit lib/config.local.php
$cfg['upload_password'] = array ('mySecretPassword'); 
$cfg['admin_password'] = 'mySecretPassword';
$cfg['style'] = 'custom';
  • Copiare il tema customizzato in
media/custom
  • Impostare il cronjob che pulisce i files:
sudoedit /var/www/download.example.com/jirafeau.cron
# m h dom mon dow user  command
12 3    * * *   www-data  php /var/www/download.pubblistil.it/admin.php clean_expired > /dev/null
16 3    * * *   www-data  php /var/www/download.pubblistil.it/admin.php clean_async   > /dev/null
cd /etc/cron.d
sudo ln -s  /var/www/download.example.com/jirafeau.cron

Riferimenti