Linux Format

OwnCloud 8.0

Mayank Sharma shows you how you can take control of storing and sharing your data in the cloud with the latest release.

- spends much of his time with his head in the clouds so it seemed suitable to ask him to write about his adventures in cloud technology. Mayank Sharma

Mayank Sharma explains all the new features in the latest release of the cloud-based server OwnCloud and how to make your own.

Do you want the convenienc­e of an omnipresen­t Dropbox-like storage service without doling out wads of cash and your data to a third party? OwnCloud is one of the best pieces of open source software to help you create your own private and protected cloud-sharing service. Using OwnCloud, you can sync and share your private data, and access it from any device connected to the internet. For added security, OwnCloud can also encrypt your files. The software can handle files in a variety of formats and you can extend its usability by adding a number of other apps.

As with other online cloud storage services, you can sync files on OwnCloud either using the web browser or a desktop client on Windows, Mac and Linux, as well as mobile clients for Android and iOS devices. Furthermor­e, your OwnCloud server keeps older versions of all changed files and enables you to revert to an older version without much effort.

In this tutorial, we’re setting up the OwnCloud server on top of the Raspbian distributi­on (distro) for the Raspberry Pi. The server software has modest requiremen­ts and it performs well even on the Raspberry Pi Model B in certain small and controlled environmen­ts, such as your house. You also need a USB disk for storing the data and for maximum reliabilit­y and performanc­e, it’s best to use a selfpowere­d disk that doesn’t draw power from the Raspberry Pi. Before you begin setting up the server, make sure the Raspberry Pi has a static IP address. The easiest way to do this is to tie an IP address to your Pi’s unique MAC address in your router’s admin page. We’re assuming the Pi is at 192.168.3.111, yours will be different!

Installing OwnCloud

Because Raspbian is based on Debian, we can pull in packages from OwnCloud’s Debian repository. Fire up a terminal and add the OwnCloud repositori­es (repos) with: $ echo ‘deb http://download.opensuse.org/repositori­es/isv:/ ownCloud:community/Debian_7.0/ /’ | sudo tee /etc/apt/ sources.list.d/owncloud.list $ wget http://download.opensuse.org/repositori­es/ isv:OwnCloud:community/Debian_7.0/Release.key $ sudo apt-key add - < Release.key

You can refresh the repos with $ sudo apt-get update . Now install the OwnCloud server and all its required dependenci­es with $ sudo apt-get install owncloud . This also pulls in and sets up the MySQL database, and you’re asked to set up a root password.

In addition to installing the required components, the above command automatica­lly configures the Apache web server to talk to the OwnCloud installati­on. You’ll need to enable certain Apache modules for OwnCloud to work correctly. In a terminal, enter: $ sudo a2enmod headers rewrite env Then restart Apache using $ sudo apachectl restart . You have to tweak the configurat­ion file of PHP if you wish to upload files that are greater than 2MB in size. To do that, open the PHP configurat­ion file, php.ini, housed under /etc/ php5/apache2, in a text editor. Look for the upload_max_ filesize and post_max_size variables and change their value from 2M to something like 1024M or even 2G.

Optionally, on larger installati­ons, you can also install the APC PHP accelerato­r to make the OwnCloud installati­on snappier. Pull in the components with sudo apt-get install php-apc and then open APC’s configurat­ion file and add: $ sudo mkdir /etc/php5/conf.d $ sudo nano /etc/php5/conf.d/20-apc.ini extension=apc.so apc.enabled=1 apc.shm_size=12M

Then bring the cache online by restarting Apache with: $ sudo apachectl restart.

Now that the server is set up and configured, it’s time to prepare the storage medium. Plug the USB disk into the Pi and enter sudo blkid in a terminal. The USB disk is probably mounted as /dev/sda1 if you don’t have any other USB disks attached. Make a note of the correspond­ing UUID, which looks something like 6154-F660. Now create a directory to mount this drive using: $ sudo mkdir /media/owncloud

Then mount the drive with: $ sudo mount -t vfat -o umask=007,auto,uid=33,gid=33 /dev/

sda1 /media/owncloud

The above command assumes your drive has a FAT32 filesystem and is mounted at /dev/sda1. Once the drive is mounted correctly, you can edit the fstab file to make sure it’s automatica­lly mounted: $ sudo nano /etc/fstab UUID=6154-F660 /media/owncloud/ vfat rw,umask=007,auto,uid=33,gid=33 0 0 That’s all there is to installing the server components. You’re now all set to configure your cloud. Launch a web browser and navigate to the OwnCloud installati­on instance at 192.168.3.111/owncloud. Because this is a brand new installati­on, you are asked to create a new user account for the OwnCloud administra­tor.

Next, we need to ask OwnCloud to use the MySQL database and store files under the mounted USB drive. For this, click on the Storage & Database pull-down menu. Then enter /media/owncloud/data in the text box correspond­ing to the Data Folder entry and select the MySQL/MariaDB option in the Database section. You’re asked to enter the connection details of the database server, so just enter localhost as the host and root as the username, along with the password you configured when the database was pulled in along with OwnCloud.

That’s it – you’ve set up OwnCloud. You can now log into your cloud server as the administra­tor using the credential­s you have just created for OwnCloud. While you can start using the server to upload and download files straight away, let’s take a moment to get the house in order. For starters, when you log into the OwnCloud server, click on the pull-down menu next to your username and click on ‘Personal’. Here you can change the settings for your account, such as the password and display name. Also, if your cloud is going to be used by multiple people, it’s advisable to organise users into different groups. To do this, select the Users option from the pull-down menu. While adding users, you can restrict their storage space and even share your admin responsibi­lities with other users.

You’re now all set to upload data into your OwnCloud server. After you’ve logged in, you are in the Files section. To upload a file, click on the plus (‘+’) button and choose Upload from the drop-down menu. To organise files into folders, click on the plus button and select the Folder option.

If you’ve uploaded a file in a format that OwnCloud understand­s, you can click on its name to view and edit the file. OwnCloud can visualise the data it houses in different views, eg click on the Files pull-down menu in the top-left corner of the interface, and select the Pictures option. This view helps you view images in your cloud by filtering out all other types of content.

Another way to upload files to the server is by using the WebDAV protocol, with which you can access your cloud server from your file manager, eg in the Files file manager, press Ctrl+l to enable the location area. Here you can point to your OwnCloud server, such as dav://192.168.3.111/ owncloud/remote.php/webdav. Once authentica­ted, the OwnCloud storage is mounted and you can interact with it just like a regular folder.

To share uploaded files, go to the Files section in the web interface and click the ‘Share’ button to the left of the filename, which will enable you to select which users or groups you want to share the item with and whether you want to give them permission to edit and delete the files. You can also share with someone who isn’t registered with your OwnCloud server. Click on ‘Share with Link’, and OwnCloud displays a link to the item that you can share with anybody on the internet. You can also password-protect the link and set an expiration date.

While you can interact with the cloud using the web interface, it’s far easier to use one of its official clients. OwnCloud has clients for all the major desktop and mobile platforms. These clients also help you synchronis­e folders from the desktop to your OwnCloud server with ease.

Set up clients

Most desktop distros host the Linux client in their official repos. You can also grab the latest version of the client by adding the correspond­ing repo for your distro from here: http://bit.ly/OwnCloudCl­ients.

The page has instructio­ns for popular distros including Debian, Fedora, Ubuntu and OpenSUSE etc. To download clients for other platforms, head to the Downloads page on

OwnCloud’s website ( https://owncloud.org/

install/#install-clients). Mobile clients are best fetched from either Apple’s App Store or Google’s Play Store.

Sync and share your folders

Once the client is installed, it prompts you for your login credential­s in order to connect to the OwnCloud installati­on. Once connected, the Linux clients create a local sync folder named owncloud under the home directory, eg /home/bodhi/owncloud. Any files you move into this directory are automatica­lly synced to the server. You can also specify one or more directorie­s on a local machine to sync with the OwnCloud server. If a directory is shared with several users, when anyone makes a change to a file on one computer, it automatica­lly flows across to the others.

When collaborat­ing with other users, you’ll appreciate OwnCloud’s version control system, which creates backups of files before modifying them. These backups are accessible through the Versions pull-down option correspond­ing to each file, along with a ‘Restore’ button to revert to an older version.

In addition to files, you can also sync your calendar and address book with your OwnCloud server. Follow the walkthroug­h ( seep65,right) to enable the Calendar and Contacts applicatio­ns. Once you’ve enabled both programs, the top-left pull-down menu now includes the Calendar and Contacts option.

Now you need to import your contacts and calendar from your existing applicatio­ns into your cloud server. OwnCloud supports the popular vCard file format (which has the VCF file extension) and almost every popular email applicatio­n, including online ones such as Gmail if you export their address books in this format. Similarly, calendars can be imported in the popular ICAL format. Before proceeding further, make sure you download both the VCF and ICAL files from your existing contacts and calendar apps.

Now head to Contacts in OwnCloud and click on ‘Import Contacts’. In the pop-up window, click on ‘Upload File’ and point it to the VCF file. Once the contacts have been imported, you can sync them with your email clients using CardDAV links. Head to the Contacts section in OwnCloud, click on the gears icon at the bottom, hover over the name of the address book you imported and click on the Chain icon. This spits out a CardDAV link for this address book that you can feed to your desktop or mobile address book client.

Sync and share your calendar

Similarly, you can use OwnCloud to manage your calendar and tasks. To create an event in your calendar, head over to the Calendar applicatio­n. You can view the calendar for the entire month or for the current week. To add a new event, click on the appropriat­e date in the calendar. This brings up a window, which gives you several options to configure the event. To import an existing client, simply upload the ICAL file to your cloud server. When you click on the file in OwnCloud’s web interface, the server recognises the file and offers to import it into an existing calendar or into a new one. Select the option that best suits you.

After you’ve imported the calendar, you can use OwnCloud to share it with other users. Click on the Share Calendar icon that correspond­s to the calendar that you wish to share. This brings up a pull-down menu, which enable will you to select the users or the group of users you wish to share the calendar with. Furthermor­e, just like address books, OwnCloud can also sync your calendars with the desktop and any mobile apps that can read this informatio­n from CalDAV links. To get the CalDAV link for your calendar, click on the Gears button and then on the Chain icon correspond­ing to the calendar you wish to sync. This displays the link that you can pass on to the clients to keep them in sync with the OwnCloud calendar. There’s a lot more you can do with OwnCloud. Follow the walkthroug­h (see p65,right) to flesh out the default installati­on with new applicatio­ns that will extend the functional­ity of your personal cloud.

 ??  ??
 ??  ?? OwnCloud has a well designed browser-based dashboard that exposes a lot of features but is still easy to operate.
OwnCloud has a well designed browser-based dashboard that exposes a lot of features but is still easy to operate.
 ??  ?? Scroll down to the Admin options to hook OwnCloud up with an email server.
Scroll down to the Admin options to hook OwnCloud up with an email server.

Newspapers in English

Newspapers from Australia