Raspberry Pi as an OwnCloud Server
Categories: Linux, RaspberryPi
First, see http://gregwoods.co.uk/2012/08/setting-up-the-raspberry-pi-the-basics/
Install Apache
sudo apt-get install apache2 php5 php5-gd php5-sqlite libcurl4-openssl-dev php5-curl php5-common php-xml-parser sqlite
Test the webserver works. Can browse to http://
Set up the USB disk for OwnCloud
- Format the disk as NTFS
- Plug it into the RaspberryPi
sudo mkdir /media/disk
- Check user id with
sudo nano /etc/passwd
user ‘pi’ probably has an id of 1000
- Check disk device name with
sudo parted
print all
shows disk is /dev/sda and partition number is 1 (in my case)
quit
sudo nano /etc/fstab
Add an entry…
/dev/sda1 /media/disk ntfs permissions 0 0
save and quit nano
sudo mount /media/disk
sudo mkdir /media/disk/web
sudo chown -R www-data:www-data /media/disk/web
#a chmod doesn’t seem to be needed, it already has 0770 permissions
Install OwnCloud
sudo apt-get install sqlite
- check latest release at http://download.owncloud.org/releases
sudo wget http://download.owncloud.org/releases/owncloud-4.0.7.tar.bz2 sudo tar -xjf owncloud-4.0.6.tar.bz2 sudo cp -r owncloud /var/www sudo chown -R www-data:www-data /var/www/owncloud
Upgrading OwnCloud
NOTE: I’ve only done this once, so I’ll ikely find a better way of doing it next time.
This method doesn’t preserve config - try preserving it next time.
Looks like it rescans the folders, possibly recreating the database
COnfig is in /var/www/owncloud/config
Maybe need to compare old and new config files after an upgrade
Probably best to disconnect all clients. Not sure if possible to do this from the server. Stopping apache would likely do it.
Delete the extracted owncloud files, and the owncloud installation
sudo rm -r ~/owncloud sudo rm -r /var/www/owncloud
Then the same instructions as a new install
First Use / Setup of OwnCloud
- http://
/owncloud/ - You MUST choose the advanced settings
- Create admin user and password
- location of data is: /media/disk/web
ToDo
sudo apt-get install php-apc
to speed things up in php
Now go and download an OwnCloud client, and enjoy your local network DropBox-like functionality
Comments