Tuesday, 14 January 2014

OwnCloud Raspberry Pi




Owncloud is like dropbox, but then local and hosted on your OWN Raspberry Pi!
Features of Owncloud:
Acces your data
Sync your data
share your data
Calendar share
And more!

Here we go!

sudo aptitude install nginx php5-fpm php5-sqlite php5-gd
[ENTER]
cd /etc/nginx/sites-available
[ENTER]
sudo nano owncloud.vhost
[ENTER]
Copy this txt info the owncloud.vhost file

# redirect http to https.
#server {
#  listen 80;
#  server_name owncloud.example.org;
#  rewrite ^ https://$server_name$request_uri? permanent;  # enforce https
#}
 
# owncloud (ssl/tls)
server {
  #listen 443 ssl;
  listen 80;
  #ssl_certificate /etc/nginx/certs/server.crt;
  #ssl_certificate_key /etc/nginx/certs/server.key;
  #server_name localhost;
  root /usr/share/nginx/www/owncloud;
  index index.php;
  client_max_body_size 1000M; # set maximum upload size
 
  # deny direct access
  location ~ ^/(data|config|\.ht|db_structure\.xml|README) {
    deny all;
  }
 
  # default try order
  location / {
    try_files $uri $uri/ @webdav;
  }
 
  # owncloud WebDAV
  location @webdav {
    fastcgi_split_path_info ^(.+\.php)(/.*)$;
    fastcgi_pass unix:/var/run/php5-fpm.sock;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    #fastcgi_param HTTPS on;
    include fastcgi_params;
  }
 
  # enable php
  location ~ \.php$ {
    fastcgi_pass unix:/var/run/php5-fpm.sock;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    #fastcgi_param HTTPS on;
    include fastcgi_params;
  }
}




sudo ln -s /etc/nginx/sites-available/owncloud.vhost /etc/nginx/sites-enabled/
[ENTER]
sudo nano /etc/php5/fpm/php.ini
ADD THE FOLLOWING:
extension=sqlite.so
extension=zip.so
extension=json.so
extension=xmlrpc.so
extension=curl.so
extension=gd.so
Hit control + X to close/save the file.
Now download Owncloud. 
Check the website for the newest release: http://mirrors.owncloud.org/releases/
cd /home/pi
[ENTER]
wget http://download.owncloud.org/community/owncloud-4.5.7.tar.bz2
[ENTER]
sudo tar -xjf owncloud-4.5.7.tar.bz2

(CHANGE THE 4.7.5 TO THE CURRENT VERSION)

sudo chown -R www-data:www-data owncloud
[ENTER]
sudo mkdir /usr/share/nginx/www/owncloud[ENTER]sudo mv owncloud /usr/share/nginx/www/
[ENTER]
sudo /etc/init.d/nginx start[ENTER]sudo nano /etc/php5/fpm/php.ini
And change the  
upload_max_filesize = 2M (from 2MB to the max size you want)
post_max_size = 6M (To the size you want)

Reboot your raspberry pi:
Sudo reboot now
[ENTER]

Now acces the Owncloud page! http://RASPBERRYPIIPADRES




Register your own account, you are good to go!

No comments:

Post a Comment

Amazon

Donate

Donate Towards More Raspberry PI's for Projects