Skip to content

NEXTCLOUD

Giancky79 edited this page Jul 2, 2021 · 30 revisions

Info lxc:

  • Debian 10
    
  • Non Privilegiato 
    

Features da attivare:

  • Nesting
    

Comandi installazione:

  •   apt update -y && apt upgrade -y && reboot
    
  •   dpkg-reconfigure tzdata
    
  •   apt install -y mariadb-server apache2 php libapache2-mod-php php-xml php-cli php-cgi php-mysql php-mbstring php-gd php-curl php-zip php-intl php-bcmath php-gmp php-apcu php-imagick imagemagick
    
  •   systemctl start mariadb && systemctl enable mariadb
    
  •   mysql -u root -p 
    

Nessuna password, se volete renderlo più sicuro

  •   mysql_secure_installation
    

Configurazione MariaDB:


CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';

CREATE DATABASE IF NOT EXISTS nextcloud CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;

GRANT ALL PRIVILEGES ON nextcloud.* TO 'username'@'localhost';

FLUSH PRIVILEGES;

quit;


Comandi per scaricare nextcloud:

  1.  wget https://download.nextcloud.com/server/releases/latest.tar.bz2
    
  2.  tar -xjvf latest.tar.bz2 -C /var/www
    
  3.  rm -f latest.tar.bz2
    
  4.  chown -R www-data:www-data /var/www/nextcloud
    

Configurazione Apache2


  •  nano /etc/php/7.3/apache2/php.ini
    

memory_limit = 512M

upload_max_filesize = 500M

post_max_size = 500M

max_execution_time = 300


  •  nano /etc/apache2/sites-available/nextcloud.conf
    

<VirtualHost 127.0.0.1:8080> Alias /nextcloud "/var/www/nextcloud/"

<Directory /var/www/nextcloud/>
    Options +FollowSymlinks
    AllowOverride All

    <IfModule mod_dav.c>
        Dav off
    </IfModule>

    SetEnv HOME /var/www/nextcloud
    SetEnv HTTP_HOME /var/www/nextcloud
</Directory>

ErrorLog /var/log/apache2/nextcloud-error_log
CustomLog /var/log/apache2/nextcloud-access_log common

<VirtualHost *:80> ServerAdmin [email protected] DocumentRoot /var/www/nextcloud/ ServerName nextcloud.example.com

 Alias /nextcloud "/var/www/nextcloud/"

 <Directory /var/www/nextcloud/>
    Options +FollowSymlinks
    AllowOverride All
    Require all granted
      <IfModule mod_dav.c>
        Dav off
      </IfModule>
    SetEnv HOME /var/www/nextcloud
    SetEnv HTTP_HOME /var/www/nextcloud
 </Directory>

 ErrorLog ${APACHE_LOG_DIR}/error.log
 CustomLog ${APACHE_LOG_DIR}/access.log combined

<VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/www/nextcloud Alias /nextcloud "/var/www/nextcloud/"

<Directory "/var/www/nextcloud/"> Options +FollowSymlinks AllowOverride All

Dav off

Require all granted

SetEnv HOME /var/www/nextcloud SetEnv HTTP_HOME /var/www/nextcloud

ErrorLog ${APACHE_LOG_DIR}/nextcloud_error_log CustomLog ${APACHE_LOG_DIR}/nextcloud_access_log common


  1.  a2ensite nextcloud.conf     
    
  2.  a2enmod rewrite headers env dir mime
    
  3.  a2dissite 000-default.conf
    
  4.  systemctl reload apache2 && systemctl restart apache2
    
  5.  systemctl enable apache2
    

Ottimizzazioni Nextcloud:

  1.  nano /var/www/nextcloud/config/config.php
    

   'default_phone_region' => 'IT', 
   'memcache.local' => '\OC\Memcache\APCu', 

N.B potrebbero passare parecchi minuti prima che si possa accedere, stessa cosa anche dopo aver creato utenza admin nella configurazione

Clone this wiki locally