How to install own cloud 7 on Raspberry Pi

0

How to install own cloud 7 on Raspberry Pi:

owncloud login

Raspberry Pi – Requirements:

Following software will be used for this complete setup:
• ownCloud 7
• Nginx
• OpenSSL
• php 5
• Raspbian Wheezy:

Raspberry Pi | How To Tune Up With Raspberry Pi:

There are few changes that are required to be made under Raspberry Pi configuration:
sudo raspi-config
a. To have sufficient space for the cloud the root file system has to be expanded:
“Expand Filesystem” needs to be selected.
b. en_US.UTF8 is changed from local.
“Internationalisation Options” needs to be selected.
c. To video graphics, memory split 16M is allocated (if X-server is not been used).
“Advanced Options” –> “Memory Split” needs to be selected.
d. This is an optional step to Overclock to Modest or Medium
“Overclock” needs to be selected, (rebooting needs to be done if you are asked to)
Raspberry Pi packaging lists are being updated:
sudo apt-get update
sudo apt-get upgrade
Users are being created Raspbian may previously have is user & group:
sudo groupadd www-data
sudo usermod -a -G www-data www-data
Packages to be installed:
sudo apt-get install nginx openssl ssl-cert php5-cli php5-sqlite php5-gd php5-common php5-cgi sqlite3 php-pear php-apc curl libapr1 libtool curl libcurl4-openssl-dev php-xml-parser php5 php5-dev php5-gd php5-fpm memcached php5-memcache varnish

Raspberry Pi |Make this certain that php5-curl is not installed:

sudo apt-get –purge remove php5-curl

Raspberry Pi | How to create your SSL Certificates for two years:

sudo openssl req $@ -new -x509 -days 730 -nodes -out /etc/nginx/cert.pem -keyout /etc/nginx/cert.key
sudo chmod 600 /etc/nginx/cert.pem
sudo chmod 600 /etc/nginx/cert.key

Web server Ngnix is being Configured
sudo nano /etc/nginx/sites-available/default
The entire content below should be Copied and replaced:
Note: technet.example.com has to be replaced with the local IP of your Raspberry Pi or with the domain name (Keep in mind that it matches the details that were provided at the time to create the certificate otherwise the cloud will not work. If you are planning to utilize any Dynamic DNS domain and then you can use your domain name as an alternative of the local IP address.
upstream php-handler {
server 127.0.0.1:9000;
#server unix:/var/run/php5-fpm.sock;
}
server {
listen 80;
server_name technet.example.com;
return 301 https://$server_name$request_uri; # enforce https
}

server {
listen 443 ssl;
server_name technet.example.com;

ssl_certificate /etc/nginx/cert.pem;
ssl_certificate_key /etc/nginx/cert.key;

# Path to the root of your installation
root /var/www/owncloud;

client_max_body_size 1000M; # set max upload size
fastcgi_buffers 64 4K;

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

index index.php;
error_page 403 /core/templates/403.php;
error_page 404 /core/templates/404.php;

location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}

location ~ ^/(?:\.htaccess|data|config|db_structure\.xml|README) {
deny all;
}

location / {
# The following 2 rules are only needed with webfinger
rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last;

rewrite ^/.well-known/carddav /remote.php/carddav/ redirect;
rewrite ^/.well-known/caldav /remote.php/caldav/ redirect;

rewrite ^(/core/doc/[^\/]+/)$ $1/index.html;

try_files $uri $uri/ index.php;
}

location ~ \.php(?:$|/) {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param HTTPS on;
fastcgi_pass php-handler;
}

# Optional: set long EXPIRES header on static assets
location ~* \.(?:jpg|jpeg|gif|bmp|ico|png|css|js|swf)$ {
expires 30d;
# Optional: Don’t log access to assets
access_log off;
}

}
view rawdefault hosted with ❤ by GitHub

Raspberry Pi – Max upload limit configured in php:

sudo nano /etc/php5/fpm/php.ini

ctrl+w can be used to explore below lines and update:

upload_max_filesize = 1000M
post_max_size = 1000M

PHP configuration:
sudo nano /etc/php5/fpm/pool.d/www.conf
Change the following line from:
listen = /var/run/php5-fpm.sock
to
listen = 127.0.0.1:9000

sudo nano /etc/dphys-swapfile
Change the following line from:
CONF_SWAPSIZE=100
to
CONF_SWAPSIZE=512

Web server and Php to be restarted:

sudo /etc/init.d/php5-fpm restart
sudo /etc/init.d/nginx restart

OwnCloud (version 7.0.1 is utilized here) is being installed:

sudo mkdir -p /var/www/owncloud
sudo wget https://download.owncloud.org/community/owncloud-7.0.1.tar.bz2
sudo tar xvf owncloud-7.0.1.tar.bz2
sudo mv owncloud/ /var/www/
sudo chown -R www-data:www-data /var/www
rm -rf owncloud owncloud-7.0.1.tar.bz2

Raspberry Pi | How To Setup admin account:

Path to the data folder should be provided while you setup the admin account. Your NAS drive or external drive that was perhaps mounted by you can be set ideally. If the path of data directory is not readable and is not writable by the user www- data and is also not readable by others then Own cloud will complain and will not continue with the admin account. It that case you have to setup appropriate permission before going further. Login the IP address of Raspberry Pi or you can use your domain name if you have configured it and then you can utilize that and setup the admin account.

Share.

About Author

Leave A Reply