VirtualBox

From Stu2
Jump to navigation Jump to search

OwnCloud

I created a VM under virtualbox to function as a cloud server using 'owncloud', but I don't want the data to reside in the VM. Tried shared folders, but the performance is horrible. I found an article on the web that showed NFS as a better option.

Just create a NFS server on the host OS. http://linuxhomeserverguide.com/server-config/NFS.php

On the server, make sure the NFS share is owned by www-data:www-data so the permissions are correct. The permissions and ownership of the mounted NFS share follow those on the server.

Install guest additions. http://en.ig.ma/notebook/2012/virtualbox-guest-additions-on-ubuntu-server

Installed LAMP:

sudo apt-get install lamp-Server^

Install owncloud using: https://owncloud.org/install/#instructions-server I used a package by adding the repo, which will make it easier to update.

To move the VM, you need to change the IP address in /etc/network/interfaces. Then update fstab.

IPADDRESS:/mount/pont   /var/www   nfs4  bg  0 0 

I used mysql database. The database is stored in the VM.

You can move files to the data directory, but you still have to get the data in the mysql database. Use these commands.

sudo su www-data
cd /path/to/owncloud
php console.php files:scan <user_id> #For rescanning a users file
php console.php files:scan --all #For rescanning the files of all users

When changing IP addresses, make sure to edit /var/www/owncloud/config/config.php. Also, change the IP address in /etc/exports on the server hosting files via NFS.

NFS exports. async speeds things up, but risks data during a crash. no_root_squash allows remote to execute commands as root.

/mount/point	IP Address(rw,async,no_root_squash,no_subtree_check,anonuid=33,anongid=33)

sudo exportfs -av