Guida su come installare OpenMediaVault su Raspberry Pi 4, con setup iniziale minimale. Io ho già un Nas in casa, più un cloud con Nextcloud accessibile da internet, sempre su Raspberry Pi 4, ma ho voluto unificare tutto sotto OMV. Il punto forte è quello di avere una unica interfaccia centralizzata, e da lì avviare tutti i servizi di cui un Nas ha bisogno. I servizi fondamentali riguardano la sicurezza, il failover e la ridondanza, e su OMV si possono avere con l’aggiunta anche di plugin esterni. Per questa guida ho usato Raspberry Pi OS Lite.
per il completamento dell’installazione ci vorrà circa 20 minuti, dopodichè il sistema si riavvierà. A questo punto accedere al raspberry pi via WEB GUI, come user=admin e password=openmediavault:
http://Raspberry-ip-address
Per prima cosa all’accesso bisognerà subito modificare un paio di cosette, ricordandosi che le modifiche fatte via WEB GUI hanno la priorità su quelle fatte manualmente, in virtù del fatto che OMV utilizza files di configurazione differenti.
System>General Settings
cambiare porta, Auto logout su disabled, e cambiare password di accesso alla WEB GUI:
Services>SSH
cambiare porta ssh:
System>OMV-Extra
abilitare repository addizionali:
System>Plugins
installare i plugins di cui si ha bisogno (quasi tutti)
successivamente pubblicherò altre guide entrando nel dettaglio su alcune configurazioni fondamentali.
Guida su come installare Nextcloud con Letsencrypt su Raspberry Pi 4, utilizzando Raspberry Pi OS Buster. A differenza della guida precedente, dove utilizzavo Owncloud ed apache2 come web server, adesso utilizzerò Nextcloud ed nginx.
Prerequisiti ed info
Raspberry Pi 4/3
Raspberry Pi OS Buster già installato ed accesso ssh
Il raspberry dovrà avere come dominio/hostname l’equivalente di example.com. Questo può essere modificato in /etc/hostname e poi riavviare.
Il vostro ip pubblico dovrà puntare quindi al dominio, nel caso non si avesse un ip pubblico, utilizzare un servizio di DNS.
Assicurarsi prima, di aprire la porte 80 verso il proprio server, altrimenti non si potranno ottenere i certificati. Successivamente bisognerà aprire la 8443.
Enter current password for root (enter for none): Press Enter
Set root password? [Y/n] Y
Remove anonymous users? [Y/n] Y
Disallow root login remotely? [Y/n] Y
Remove test database and access to it? [Y/n] Y
Reload privilege tables now? [Y/n] Y
creazione user e db per nextcloud:
# mysql -u root -p
inserire password e poi i 5 comandi sotto:
create database nextcloud_db;
create user nextclouduser@localhost identified by 'IN_PASSWORD';
grant all privileges on nextcloud_db.* to nextclouduser@localhost identified by 'IN_PASSWORD';
flush privileges;
exit
IMPORTANT NOTES:
- Congratulations! Your certificate and chain have been saved at:
/etc/letsencrypt/live/example.com/fullchain.pem
Your key file has been saved at:
/etc/letsencrypt/live/example.com/privkey.pem
Your cert will expire on 2021-03-07. To obtain a new or tweaked
version of this certificate in the future, simply run certbot
again. To non-interactively renew *all* of your certificates, run
"certbot renew"
- If you like Certbot, please consider supporting our work by:
Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate
Donating to EFF: https://eff.org/donate-le
5) Download Nextcloud
# apt install wget unzip zip -y# cd /var/www/# wget -q https://download.nextcloud.com/server/releases/latest.zip# unzip latest.zip# chown -R www-data:www-data /var/www/nextcloud
6) Configurazione Virtual Host
# nano /etc/nginx/sites-available/nextcloud
ed incollare dentro, con le rispettive modifiche:
upstream php-handler {
#server 127.0.0.1:9000;
server unix:/var/run/php/php7.3-fpm.sock;
}
server {
listen 80;
listen [::]:80;
server_name example.com;
# enforce https
return 301 https://$server_name:8443$request_uri;
}
server {
listen 8443 ssl http2;
listen [::]:8443 ssl http2;
server_name example.com;
# Use Mozilla's guidelines for SSL/TLS settings
# https://mozilla.github.io/server-side-tls/ssl-config-generator/
# NOTE: some settings below might be redundant
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
# Add headers to serve security related headers
# Before enabling Strict-Transport-Security headers please read into this
# topic first.
#add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;" always;
#
# WARNING: Only add the preload option once you read about
# the consequences in https://hstspreload.org/. This option
# will add the domain to a hardcoded list that is shipped
# in all major browsers and getting removed from this list
# could take several months.
add_header Referrer-Policy "no-referrer" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-Download-Options "noopen" always;
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Permitted-Cross-Domain-Policies "none" always;
add_header X-Robots-Tag "none" always;
add_header X-XSS-Protection "1; mode=block" always;
# Remove X-Powered-By, which is an information leak
fastcgi_hide_header X-Powered-By;
# Path to the root of your installation
root /var/www/nextcloud;
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
# The following 2 rules are only needed for the user_webfinger app.
# Uncomment it if you're planning to use this app.
#rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
#rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last;
# The following rule is only needed for the Social app.
# Uncomment it if you're planning to use this app.
#rewrite ^/.well-known/webfinger /public.php?service=webfinger last;
location = /.well-known/carddav {
return 301 $scheme://$host:$server_port/remote.php/dav;
}
location = /.well-known/caldav {
return 301 $scheme://$host:$server_port/remote.php/dav;
}
# set max upload size
client_max_body_size 512M;
fastcgi_buffers 64 4K;
# Enable gzip but do not remove ETag headers
gzip on;
gzip_vary on;
gzip_comp_level 4;
gzip_min_length 256;
gzip_proxied expired no-cache no-store private no_last_modified no_etag auth;
gzip_types application/atom+xml application/javascript application/json application/ld+json application/manifest+json application/rss+xml application/vnd.geo+json application/vnd.ms-fontobject application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/bmp image/svg+xml image/x-icon text/cache-manifest text/css text/plain text/vcard text/vnd.rim.location.xloc text/vtt text/x-component text/x-cross-domain-policy;
# Uncomment if your server is build with the ngx_pagespeed module
# This module is currently not supported.
#pagespeed off;
location / {
rewrite ^ /index.php;
}
location ~ ^\/(?:build|tests|config|lib|3rdparty|templates|data)\/ {
deny all;
}
location ~ ^\/(?:\.|autotest|occ|issue|indie|db_|console) {
deny all;
}
location ~ ^\/(?:index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|oc[ms]-provider\/.+)\.php(?:$|\/) {
fastcgi_split_path_info ^(.+?\.php)(\/.*|)$;
set $path_info $fastcgi_path_info;
try_files $fastcgi_script_name =404;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $path_info;
fastcgi_param HTTPS on;
# Avoid sending the security headers twice
fastcgi_param modHeadersAvailable true;
# Enable pretty urls
fastcgi_param front_controller_active true;
fastcgi_pass php-handler;
fastcgi_intercept_errors on;
fastcgi_request_buffering off;
}
location ~ ^\/(?:updater|oc[ms]-provider)(?:$|\/) {
try_files $uri/ =404;
index index.php;
}
# Adding the cache control header for js, css and map files
# Make sure it is BELOW the PHP block
location ~ \.(?:css|js|woff2?|svg|gif|map)$ {
try_files $uri /index.php$request_uri;
add_header Cache-Control "public, max-age=15778463";
# Add headers to serve security related headers (It is intended to
# have those duplicated to the ones above)
# Before enabling Strict-Transport-Security headers please read into
# this topic first.
#add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;" always;
#
# WARNING: Only add the preload option once you read about
# the consequences in https://hstspreload.org/. This option
# will add the domain to a hardcoded list that is shipped
# in all major browsers and getting removed from this list
# could take several months.
add_header Referrer-Policy "no-referrer" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-Download-Options "noopen" always;
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Permitted-Cross-Domain-Policies "none" always;
add_header X-Robots-Tag "none" always;
add_header X-XSS-Protection "1; mode=block" always;
# Optional: Don't log access to assets
access_log off;
}
location ~ \.(?:png|html|ttf|ico|jpg|jpeg|bcmap)$ {
try_files $uri /index.php$request_uri;
# Optional: Don't log access to other assets
access_log off;
}
}
se non ci sono errori avremo un output come sotto:
root@example:/var/www# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
creare username e password per l’accesso via web, e poi inserire nextclouduser e nextcloud_db. Nel caso di porta diversa della 443, è meglio inserirla come in figura sopra. I dati di default saranno in /var/www/nextcloud/data. Ma conviene sempre tenerli all’esterno della sd-card. Esempio con usb esterna.
8) Creazione della cartella di storage e relativi permessi:
al riavvio verificare se la usb esterna è stata montata correttamente:
$ df -h
Questa guida consente di avere un server cloud personale, ma bisogna ricordarsi che bisognerà proteggerlo, e quindi integrare delle robuste policy di sicurezza, come fail2ban, iptables, ufw, ecc ecc.
Guida su come connettere il proprio account OneDrive, da linea di comando, utilizzando rclone.
Installazione di rclone:
$ sudo apt install rclone fuse
Configurazione:
$ rclone config
output:
edmond@edmondbox:~$ rclone config
2020/05/25 18:25:55 NOTICE: Config file "/home/edmond/.config/rclone/rclone.conf" not found - using defaults
No remotes found - make a new one
n) New remote
s) Set configuration password
q) Quit config
n/s/q> n
name> myonedrive
Type of storage to configure.
Enter a string value. Press Enter for the default ("").
Choose a number from below, or type in your own value
1 / A stackable unification remote, which can appear to merge the contents of several remotes
\ "union"
2 / Alias for a existing remote
\ "alias"
3 / Amazon Drive
\ "amazon cloud drive"
4 / Amazon S3 Compliant Storage Providers (AWS, Ceph, Dreamhost, IBM COS, Minio)
\ "s3"
5 / Backblaze B2
\ "b2"
6 / Box
\ "box"
7 / Cache a remote
\ "cache"
8 / Dropbox
\ "dropbox"
9 / Encrypt/Decrypt a remote
\ "crypt"
10 / FTP Connection
\ "ftp"
11 / Google Cloud Storage (this is not Google Drive)
\ "google cloud storage"
12 / Google Drive
\ "drive"
13 / Hubic
\ "hubic"
14 / JottaCloud
\ "jottacloud"
15 / Local Disk
\ "local"
16 / Microsoft Azure Blob Storage
\ "azureblob"
17 / Microsoft OneDrive
\ "onedrive"
18 / OpenDrive
\ "opendrive"
19 / Openstack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
\ "swift"
20 / Pcloud
\ "pcloud"
21 / SSH/SFTP Connection
\ "sftp"
22 / Webdav
\ "webdav"
23 / Yandex Disk
\ "yandex"
24 / http Connection
\ "http"
Storage> 17
** See help for onedrive backend at: https://rclone.org/onedrive/ **
Microsoft App Client Id
Leave blank normally.
Enter a string value. Press Enter for the default ("").
client_id>
Microsoft App Client Secret
Leave blank normally.
Enter a string value. Press Enter for the default ("").
client_secret>
Edit advanced config? (y/n)
y) Yes
n) No
y/n> n
Remote config
Use auto config?
* Say Y if not sure
* Say N if you are working on a remote or headless machine
y) Yes
n) No
y/n> y
If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth
Log in and authorize rclone for access
Waiting for code...
Got code
Autorizzare rclone come app sicura:
Choose a number from below, or type in an existing value
1 / OneDrive Personal or Business
\ "onedrive"
2 / Root Sharepoint site
\ "sharepoint"
3 / Type in driveID
\ "driveid"
4 / Type in SiteID
\ "siteid"
5 / Search a Sharepoint site
\ "search"
Your choice> 1
Found 1 drives, please select the one you want to use:
0: (personal) id=72593143d3aac403
Chose drive to use:> 0
Found drive 'root' of type 'personal', URL: https://onedrive.live.com/?cid=72593143d3aac403
Is that okay?
y) Yes
n) No
y/n> y
--------------------
[myonedrive]
token = {"access_token":"EwBoA8l6BAAUO9chh8cJscQLmU+LSWpbnr0vmwwAAcTsM8GrYTxDxI5BKZdaB","expiry":"2020-05-25T19:26:56.661526715+02:00"}
drive_id = 72593143d3aac403
drive_type = personal
--------------------
y) Yes this is OK
e) Edit this remote
d) Delete this remote
y/e/d> y
Current remotes:
Name Type
==== ====
myonedrive onedrive
e) Edit existing remote
n) New remote
d) Delete remote
r) Rename remote
c) Copy remote
s) Set configuration password
q) Quit config
e/n/d/r/c/s/q> q
edmond@edmondbox:~$
creazione punto di mount e montaggio utilizzando fuse:
$ mkdir ~/onedrive$ rclone mount --daemon --vfs-cache-mode writes myonedrive: ~/onedrive
al posto di writes si può utilizzare full, per scaricare tutto in locale. La locazione del file di configurazione si trova col comando:
$ rclone config file
Come alternativa esiste il pacchetto deb di OneDrive che si trova in DebianSid, ma che io non ho testato.
Raspberry con Owncloud Raspbian Buster Letsencrypt Apache
Guida su come realizzare un proprio server cloud, utilizzando owncloud, su raspberry pi 3/4, con Raspbian Buster, ma in alternativa si puo utilizzare un’altro modello di single board o Pc, con OS Debian based. Avevo gia fatto una guida precedentemente, utilizzando Raspbian Stretch. Inoltre utilizzando Let’s Encrypt si avranno certificati SSL gratuiti tramite un processo completamente automatizzato, progettato per eliminare la creazione manuale di certificati, per la convalida, l’installazione e il rinnovo. I certificati rilasciati da Let’s Encrypt sono validi per 90 giorni dalla data di emissione e sono oggi considerati affidabili da tutti i principali browser.
Prerequisiti ed info
Negli esempi sotto utilizzerò come nome di dominio example.com ed i comandi verranno eseguiti da root
Il raspberry dovrà avere quindi come dominio l’equivalente di example.com. Questo può essere modificato in /etc/hostname e poi riavviare.
Il vostro ip pubblico dovrà puntare quindi al dominio, nel caso non si avesse un ip pubblico, utilizzare un servizio di DNS.
Assicurarsi prima di aprire le porte 80/443 verso il proprio server, altrimenti non si potranno ottenere i certificati. Successivamente rimarrà aperta solo la 443.
La guida è stata testata su una installazione pulita di Raspbian Buster
Raspberry con Owncloud Raspbian Buster Letsencrypt Apache
Per ottenere i certificati utilizzeremo certbot, installato precedentemente, che si occuperà dell’acquisizione e del rinnovo degli stessi. Utilizzeremo il plug-in Webroot che funziona creando un file temporaneo nella ${webroot-path}/.well-known/acme-challenge a cui si collegherà Letsencrypt per risolvere il DNS:
IMPORTANT NOTES:
- Congratulations! Your certificate and chain have been saved at
/etc/letsencrypt/live/example.com/fullchain.pem.
Your cert will expire on 2019-02-28. To obtain a new or tweaked
version of this certificate in the future, simply run certbot
again. To non-interactively renew *all* of your certificates, run
"certbot renew"
- If you lose your account credentials, you can recover through
e-mails sent to xxxxxxx@gmail.com.
- Your account credentials have been saved in your Certbot
configuration directory at /etc/letsencrypt. You should make a
secure backup of this folder now. This configuration directory will
also contain certificates and private keys obtained by Certbot so
making regular backups of this folder is ideal.
- If you like Certbot, please consider supporting our work by:
Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate
Donating to EFF: https://eff.org/donate-le
adesso andiamo a riconfigurare il file Virtual Host come sotto:
Rinnovo automatico dei certificati: Come dicevo all’inizio, i certificati di Let’s Encrypt hanno una durata di 90 giorni, dopodichè dovrebbero autorinnovarsi traminte un cronjob, altrimenti aggiornare manualmente con il comando:
inserire password di root, e poi i 5 comandi sotto, e settare la password per l’utente owncloud
1) create database owncloud;
2) create user owncloud@localhost identified by 'password';
3) grant all privileges on owncloud.* to owncloud@localhost identified by 'password';
4) flush privileges;
5) exit;
fare una modifica al file php.ini, nella sezione File Uploads, portando upload_max_filesize = 5000M.
# nano /etc/php/7.3/apache2/php.ini
come ultimo ritocco, aumentare la capacità di upload, andando a modificare il file .user.ini
portando: upload_max_filesize, e post_max_size a 5000M
# systemctl restart apache2
a questo punto il server owncloud è installato, ed è raggiungibile all’indirizzo https://example.com. Se si volesse utilizzare come storage un disco esterno, la guida continua:
Step 5) Creazione della cartella di storage e relativi permessi:
adesso abbiamo bisogno di conoscere UUID del disco usb ed user e group di www-data, che serviranno per configurare /etc/fstab per il montaggio automatico:
# id -u www-data; id -g www-data
# blkid
# nano /etc/fstab
ed aggiungere in una sola riga qualcosa del genere in /etc/fstab:
UUID=32E49E5027A4F8A7 /media/owncloud-usb auto nofail,uid=33,gid=33,umask=0027$,dmask=0027,noatime 0 0
# reboot
Se tutto è andato bene andare all’indirizzo https://ip_dominio_del_server ed apparirà la pagina iniziale, dove si dovrà inserire nome utente e password per l’accesso al server owncloud, nome del database, user e password dell’utente owncloud, ed infine il punto di mount. Username: owncloud Password: password Database: owncloud Server: localhost
Raspberry con Owncloud Raspbian Buster Letsencrypt Apache
L’obiettivo di questa guida è quello di realizzare un proprio server owncloud, e nello specifico io utilizzerò un raspberry pi 3 , ma in alternativa si potrà utilizzare un’altro modello di single board o Pc, con OS Debian based. Avevo gia fatto una guida precedentemente, ma in quell’occasione avevo utilizzato un certificato auto firmato, che chiaramente i browser vedono come non sicuro. In questo caso invece utilizzerò Let’s Encrypt che fornisce certificati SSL gratuiti tramite un processo completamente automatizzato, progettato per eliminare la creazione manuale di certificati, per la convalida, l’installazione e il rinnovo. I certificati rilasciati da Let’s Encrypt sono validi per 90 giorni dalla data di emissione e sono oggi considerati affidabili da tutti i principali browser.
Prerequisiti ed info
Negli esempi sotto utilizzerò come nome di dominio example.com ed i comandi verranno eseguiti da root
Il raspberry dovrà avere quindi come dominio l’equivalente di example.com. Questo può essere modificato in /etc/hostname e poi riavviare.
Il vostro ip pubblico dovrà puntare quindi al dominio, nel caso non si avesse un ip pubblico, utilizzare un servizio di DNS.
Assicurarsi prima di aprire le porte 80/443 verso il proprio server, altrimenti non si potranno ottenere i certificati. Successivamente rimarrà aperta solo la 443.
La guida è stata testata su una installazione pulita di Raspbian Stretch
a questo punto collegandosi al server dovremmo vedere che funziona: Step 3)Chiave e Letsencrypt Creare una chiave robusta Dh (Diffie-Hellman) a 2048 bit, ci vorrà circa 20 minuti.
Per ottenere i certificati utilizzeremo certbot, installato precedentemente, che si occuperà dell’acquisizione e del rinnovo degli stessi. Utilizzeremo il plug-in Webroot che funziona creando un file temporaneo nella ${webroot-path}/.well-known/acme-challenge a cui si collegherà Letsencrypt per risolvere il DNS:
IMPORTANT NOTES:
- Congratulations! Your certificate and chain have been saved at
/etc/letsencrypt/live/example.com/fullchain.pem.
Your cert will expire on 2019-02-28. To obtain a new or tweaked
version of this certificate in the future, simply run certbot
again. To non-interactively renew *all* of your certificates, run
"certbot renew"
- If you lose your account credentials, you can recover through
e-mails sent to xxxxxxx@gmail.com.
- Your account credentials have been saved in your Certbot
configuration directory at /etc/letsencrypt. You should make a
secure backup of this folder now. This configuration directory will
also contain certificates and private keys obtained by Certbot so
making regular backups of this folder is ideal.
- If you like Certbot, please consider supporting our work by:
Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate
Donating to EFF: https://eff.org/donate-le
adesso andiamo a riconfigurare il file Virtual Host come sotto:
Rinnovo automatico dei certificati: Come dicevo all’inizio, i certificati di Let’s Encrypt hanno una durata di 90 giorni, dopodichè bisognerà rinnovarli. Per automatizzare il rinnovo utilizzare un cronjob:
SSLCipherSuite EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH
SSLProtocol All -SSLv2 -SSLv3 -TLSv1 -TLSv1.1
SSLHonorCipherOrder On
#Header always set Strict-Transport-Security "max-age=63072000; includeSubDomai$#Header always set X-Frame-Options DENY#Header always set X-Content-Type-Options nosniff
# Requires Apache >= 2.4
SSLCompression off
SSLUseStapling on
SSLStaplingCache "shmcb:logs/stapling-cache(150000)"
# Requires Apache >= 2.4.11
SSLSessionTickets Off
SSLOpenSSLConfCmd DHParameters "/etc/ssl/certs/dhparam.pem"
# systemctl restart apache2
Owncloud è installato ed è raggiungibile all’indirizzo https://example.com. Se si volesse utilizzare come storage un disco esterno, la guida continua: Step 5) Creazione della cartella di storage e relativi permessi:
adesso abbiamo bisogno di conoscere UUID del disco usb ed user e group di www-data, che serviranno per configurare /etc/fstab per il montaggio automatico:
# id -u www-data; id -g www-data
# blkid
# nano /etc/fstab
ed aggiungere in una sola riga qualcosa del genere in /etc/fstab:
UUID=32E49E5027A4F8A7 /media/owncloud-usb auto nofail,uid=33,gid=33,umask=0027$,dmask=0027,noatime 0 0
# reboot
Se tutto è andato bene andare all’indirizzo https://ip_dominio_del_server ed apparirà la pagina iniziale, dove si dovrà inserire nome utente e password per l’accesso al server owncloud, nome del database, user e password dell’utente owncloud, ed infine il punto di mount. Username: owncloud Password: password Database: owncloud Server: localhost
Aggiornare Owncloud alla versione 10.0.10 su Debian
Guida su come aggiornare Owncloud dalla versione 10.0.9 alla 10.0.10. Il miglior modo per effettuare l’aggiornamento è quello manuale. Il metodo che userò io è un pò “sporco”, ma secondo me risulta semplice veloce ed efficace. Aggiornare Owncloud alla versione 10.0.10 su Debian
Enable Maintenance Mode
cd /var/www/owncloud/ sudo -u www-data php occ maintenance:mode --on
Stop dei servizi essenziali
sudo service apache2 stop sudo service cron stop
Download nuova versione
cd /opt/ sudo wget https://download.owncloud.org/community/owncloud-10.0.10.tar.bz2
Nel mio caso tenendo i miei DATI al di fuori della cartella Owncloud, procedo direttamente all’aggiornamento, sostituendo la cartella:
sudo tar xjvf owncloud-10.0.10.tar.bz2 -C /var/www/
Nel caso i DATI si trovassero all’interno della cartella Owncloud, allora bisognerà copiare il vecchio file di configurazione:
cd /opt/ sudo tar xjvf owncloud-10.0.10.tar.bz2 sudo cp /var/www/owncloud/config/config.php owncloud/config/config.php sudo cp -R owncloud/ /var/www/
Guida su come installare owncloud 10 su Raspberry Pi 3 con già installato Raspbian Stretch. Io ho sempre usato uno dei miei Raspberry come server cloud, accessibile soprattutto da remoto. In questa guida non mi soffermerò sui problemi di sicurezza ed i modi per limitare i danni derivanti da una macchina esposta su internet, ma bensì mi limiterò ai soli step per avere un server cloud pronto all'uso. Io preferisco archiviare i dati direttamente su una chiavetta usb da 128G, piuttosto che direttamente sul raspberry. Quindi, dopo avere installato Raspbian Stretch ed aver collegato alla porta usb la pen drive, servendosi di una prolunga usb che servirà a dissipare il calore, siamo pronti ad iniziare.
inserire password di root, e poi i 5 comandi sotto, e settare la password per l'utente owncloud:
1) create database owncloud;
2) create user owncloud@localhost identified by 'password';
3) grant all privileges on owncloud.* to owncloud@localhost identified by 'password';
4) flush privileges;
5) exit;
Web Server Apache2 con SSL
sotto ci saranno alcune voci da riempire, ma quella più importante è COMMON NAME, che io ho fatto puntare al mio hostname DynDNS per l'accesso da remoto:
che dovrà essere come sotto, aggiungendo ip del server cloud, modificando le voci DocumentRoot, SSLCertificateFile, SSLCertificateKeyFile , e commentando le altre voci che fanno riferimento a SSL.
a questo punto abbiamo bisogno di conoscere UUID della chiavetta usb ed user e group di www-data, che serviranno per configurare /etc/fstab per il montaggio automatico:
# id -u www-data; id -g www-data
# blkid
# nano /etc/fstab
ed aggiungere in una sola riga qualcosa del genere in /etc/fstab:
UUID=32E49E5027A4F8A7 /media/owncloud-usb auto nofail,uid=33,gid=33,umask=0027$,dmask=0027,noatime 0 0
come ultimo ritocco, aumentare la capacità di upload, andando a modificare il file .user.ini
# nano /var/www/html/owncloud/.user.ini
portando: php_value upload_max_filesize, e php_value post_max_size a 5000M
# reboot
Se tutto è andato bene andare all'indirizzo https://ip_del_raspberry ed apparirà la pagina iniziale, dove si dovrà scegliere nome utente e password per l'accesso al server owncloud, ed inserire il nome del database, user e password dell'utente owncloud:
Dopo ogni aggiornamento di ownCloud, quando si cerca di accedere al pannello di controllo, il messaggio che appare è quello nella figura sopra. OwnCloud in Maintenance Mode. Per risolvere il problema:
sudo /var/www/owncloud/config/config.php
ed alla voce maintenance sostituire "true" con "false". Dopodichè ricaricare la pagina e procedere con l'aggiornamento.
Owncloud Client su Debian Jessie/Strech. Dopo aver creato un server Owncloud su raspberry pi 3, lo step successivo è stato quello di installare Owncloud Client su Debian Jessie, su windows, ipad ed iphone. Installando il client direttamente dai repository Debian si incorre in un errore di autenticazione: owncloud client linux error wrong credentials. Per risolvere il problema bisogna scaricare ed installare il client direttamente dal sito ufficiale.
Owncloud 9 Apache Mysql su Raspberry Pi 3 e Raspbian. Io su Raspberry Pi 3, ho un server Webdav e mi trovo bene, qua la guida. ma ho voluto provare Owncloud, poichè è molto più personalizzabile, e ti permette di condividere link, con password e data di scadenza. Io ho utilizzato come disco esterno una pen drive da 128G, formattata in NTFS, ma si può utilizzare anche un hard disk esterno, possibilmente alimentato.
sudo mkdir /media/usb-hdd
identificare la chiavetta con:
sudo tail -f /var/log/messages
oppure:
sudo fdisk -l
conoscere UUID per procedere con il mount automatico:
come ultimo ritocco, aumentare la capacità di upload, andando a modificare il file .htacces, ed installare fail2ban:
sudo nano /var/www/owncloud/.htaccess
portando: php_value upload_max_filesize, e php_value post_max_size a 5000M
sudo apt-get install fail2ban
Se tutto è andato bene andare all'indirizzo https://ip_del_raspberry/owncloud ed apparirà la pagina iniziale, dove si dovrà scegliere nome utente e password per l'accesso, ed inserire il nome del database ed user e password dell'utente owncloud.
Owncloud 9 Apache Mysql su Raspberry Pi 3 e Raspbian