Configuració Nginx per a l'Owncloud a una Raspberry Pi

A la Rasbperry Pi 2, tinc Raspbian totalment actualitzat (apt-get update && apt-get upgrade) i he instal·lat un Owncloud en una base de dades sqlite des dels següents paquets:


apt-get install nginx php5-sqlite sqlite php5 php5-curl php5-fpm php-xml-parser php5-json

Aquest és el fitxer /etc/nginx/sites-available/default de l'Nginx, ja que tinc instal·lat l'Owncloud a l'arrel de /var/www/html:


server {
listen 80 default_server;
listen [::]:80 default_server;

root /var/www/html;

# Add index.php to the list if you are using PHP
index index.php index.html index.htm index.nginx-debian.html;

server_name _;

# Deny all attempts to access hidden files such as .htaccess, .htpasswd, .DS_Store (Mac).
location ~ /\. {
deny all;
access_log off;
log_not_found off;
}

client_max_body_size 10G; #

rewrite ^/caldav(.*)$ /remote.php/caldav$1 redirect;
rewrite ^/carddav(.*)$ /remote.php/carddav$1 redirect;
rewrite ^/webdav(.*)$ /remote.php/webdav$1 redirect;
rewrite ^/apps/calendar/caldav.php /remote.php/caldav/ last;
rewrite ^/apps/contacts/carddav.php /remote.php/carddav/ last;
rewrite ^/remote/(.*) /remote.php last;

location ~ ^(.+?\.php)(/.*)?$ {
try_files $1 =404;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$1;
fastcgi_param PATH_INFO $2;
fastcgi_param HTTPS $https;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_intercept_errors on;
fastcgi_index index.php;
fastcgi_buffers 64 4K;
}

location ~* ^.+\.(jpg|jpeg|gif|bmp|ico|png|css|js|swf)$ {
expires 30d;
access_log off;
}
}

Si una vegada instal·lat Owncloud, veiem que dóna problemes de permisos el directori /data farem el següent:


/var/www/html# chown -R www-data:www-data data/

Finalment, pots descarregar-te un client d'OwnCloud, tant per a GNU/Linux, MacOs X o Windows a l'adreça https://owncloud.com/download/#desktop-clients