Installing ownCloud on a Fedora webserver

Whats ownCloud then ?

ownCloud is an opensource equivalent to DropBox, it provides a way of keeping all folders and files under a monitored directory in syncronisation across multiple machines, the main difference being that it is your server controlling the syncronisation and not a third party such as the DropBox servers holding the master/syncronised copies of your files.

For those that don’t want to skip to the end to see the results… it works (tested with a F17 server, and desktops were running F17 and F20). Obviously I haven’t tested any windowz desktop clients, anyone that still uses a windowz desktop/laptop is unlikely to have anything suitable to install an ownCloud server on anyway.

What this walkthrough will, and will not cover

First off there are packages for many flavours of linux, this document covers Fedora and using reposositories (to automatically resolve dependencies in minutes instead of spending months hunting down what is needed for a tarball/source install).

Secondly something that may make this walkthrough useless for most users is that I decided that (for now anyway) I am using the embedded ‘sqllite’ database that comes with the application rather than using my webserver mysql database… the reason being portability (the application directory can be tar’ed up and moved to another machine and just carry on working (assuming the php packages needed are installed) without the need for mysql database dumps/restores by using the embedded database). I have tested this by moving the app directory to different places/names and also onto an external drive, it keeps working.

Thirdly, I don’t use a LDAP server so it doesn’t cover setting up LDAP groups/users… if you use a LDAP server you already know how to do all that. And know they shouldn’t be exposed to the internet

Also this post covers installation and testing using a Fedora 17 server and desktop, with a Fedora 20 desktop used for secondary tests… mainly beacuase even though Fedora 17 is unsupported now some applications critical to me broke after F17 so I keep a desktop and server at that level ( and just upgrade the rest of my machines to new releases :-) ).

What this post will do is show how a Fedora user can get OwnCloud installed and running with minimal effort. By following this post you should have
* an owncloud server running
* a web interface you can use to upload files to your owncloud server
* one (or more) desktops having their local directories kept in sync with your owncloud server

Step 1 – Install it from repositories

Add the owncloud repository

Create a new file /etc/yum.repos.d/owncloud.repo, the contents should be as below. Note that I disabled gpgcheck here; if you have enough linux knowledge to track down and install the keys by all means do so and enable gpgcheck again, this post is not covering that exercise, there are plenty of tutorials on using rpm to import keys on the web already, fast install is use the below…


[owncloud-base]
name=ownCloud $releasever RPM Packages -
failovermethod=priority
baseurl=http://download.opensuse.org/repositories/isv:/ownCloud:/community/Fedora_$releasever/
enabled=1
gpgcheck=0
retries=1
priority=50

Use yum to check it works, the Fedora repositories have owncloud clients but not the server ‘owncloud’, if owncloud shows up you are ready.

[root@osprey yum.repos.d]# yum search owncloud
Loaded plugins: langpacks, presto, refresh-packagekit
owncloud-base                                            | 1.6 kB     00:00     
owncloud-base/primary                                    | 3.2 kB     00:00     
owncloud-base                                                             10/10
============================ N/S Matched: owncloud =============================
owncloud.noarch : ownCloud Server - Private file sync and share server
owncloud-3rdparty.noarch : 3rdparty libraries for ownCloud
... then a list of clients from fedora repo starting with mirall

Install it using yum

Then install it, selinux must be disabled from this point on, or configuration steps will fail. By using ‘yum’ the fedora repositories will be searched for any pre-requisite packages which will be installed automagically.

setenforce 0
yum install owncloud owncloud-3rdparty

The application installs into /var/www/html/owncloud

if you had selinux in enforcing mode to start with…

Remember to use “setenforce 1” to flick selinux back into deny mode.

Step 2 – Move the entire application somewhere

You probably do not want lots of large files dumped under your webserver directory by users. As installed files, photos, apps etc seem to be stored in the “data” directory under the owncloud installation… I think that is good, as it is entirely self contained it is portable (if you do not use an external database like mysql but use the embedded sqllite !).

What I did as my webserver is setup to follow symlinks was (using a 1Tb external disk mounted as /mnt/GB1000A) move the entire owncloud bundle to an external drive, and create a symbolic link to that location… the idea (untested) being updates via yum will follow the link and update as needed. That may not work as yum may not follow the link, but it does work as far as running the application goes. Obviously replace /mnt/GB1000A with a filesystem you have a lot of free space in.

cd /mnt/GB1000A
cp -rp /var/www/html/owncloud .
cd /var/www/html
rm -rf owncloud
ln -s /mnt/GB1000A/owncloud owncloud

Also… chcon -R xx:xx:xx:xx /mnt/GB1000A/owncloud (replace xx:xx:xx:xx with whatever a ls -laZ shows as the perms in your webserver html directory) and chown -R apache:apache /mnt/GB1000A/owncloud (replacing apache with your webserver userid) or it will obviously not work due to security permissions.

Step 3 – Initial admin user setup

Point your web browser at the URL, if you followed the examples above http://localhost/owncloud would work as it will (if your webserver allows symlinks to be followed) throw up a screen asking you to define the initial admin user/password. I found selinux had to be disabled during this step also.

Provide a userid and a secure password and logon to the owncloud application (as we are using the embedded sqllite database here we have skipped all the messing about with creating mysql database/users).

Then logoff. Under /mnt/GB1000A/owncloud/data (or wherever you copied it) there will be a sqllite owncloud.db plus a directory for the admin userid you created.

If the file and directory are there it is now installed and working.

As we are ignoring LDAP here, logging onj again as the admin user you have created you can use the droptown list on the right top to manually add other users that can use your ‘owncloud’.

NOTE: file upload size is a max of 513Mb using the web interface upload option.

Step 4 – Desktop applications

Now the server is setup install the client application on a desktop machine. My desktops are also Fedora and the mirall client is in the Fedora repositories, so simply
yum install mirall mirall-common

No command line, where did it put it, ahh it’s a desktop app.
[root@phoenix etc]# rpm -q -filesbypkg mirall
mirall /usr/bin/owncloud
mirall /usr/share/applications/owncloud.desktop
mirall /usr/share/icons/hicolor/48×48/apps/owncloud.png

The “owncloud desktop” icon/application is installed under gnome. Starting it prompts for servername/userid/password.
Entered those (server name is the same URL as you use to get to the logon web page), it warned about my self-signed ssl cert and carried on ok. Created a ~/ownCload directory, and gave an option to view the local directory or the remote one (selecting the remote one just starts a firefox session to the website logon page).
The local option showed nothing had been synced to the desktop, checked via command line also, nothing.
Exited the application and restarted it… it reported files had been synced and the command line showed the sample files had been pulled to the desktop this time.

Testing performed using this client

Created a one line test file in the local directory. It appeared in the remote folder in around 5mins so that would seem to be the poll interval.
Edited the file on the remote folder… not syncing to local folder ?

Installed the mirall packages on a F20 server, did the same client steps and it pulled down the files from the owncloud server ok, it has the updated testfile, still not updated on the F17 desktop.

Updated the test file on the F20 server. After around 5mins the file upodated on the second desktop appeared on the first desktop.

Used the web interface to upload a second test file to the owncloud server, after a few minutes it appeared on the local directories of both test desktop servers.

Deleted the second test file from the local directory on the F20 desktop. After a few minutes it was deleted from the F17 desktop and the owncloud server.

Conclusion, based on desktop testing

It works correctly, if you give it enough time. If you were working remotely and using largish files you probably would not want to power off a laptop for at least 15mins after the last file update or the changes may not be on your desktop when you get home.
There doesn’t seem to be a desktop activity indicator to show pending requests that can be used to keep an eye on it.
ALSO once the owncloud application is started from the gnome icon, even when the gui interface is exited the owncloud task keeps running to keep files in sync… so start it once when needed. Obviously don’t autostart it from the gnome autostart directories or you would have to hard-code the server/username/password somewhere which is bad; start on demand and prompt is good.

And don’t directly edit the files on the remote ownCloud server. It seems to need “a push”, whether from a changed file on on a client or a file upload through the web interface before syncronisation is triggered, a file directly edited on the ownCloud server (in my testing anyway) is ignored as a change, which is fair enough and makes perfect design sense.

Step 5 – Mobile applications

There are mobile apps on the apple ‘app store’ and on ‘google play’ that can access your owncloud server; as I don’t have a smart phone I have not tried those, nor would I as smart phones don’t have a lot of storage so why would you want to sync.
Pherhaps there are some ‘push only’ ones to get files onto the server.
But I won’t be testing those.

Update 20 Nov 2019

As mentioned in my more recent posts the Fedora update frequency is too fast for 3rd party repos to keep up with, the version of owncloud compatible with f29 and f30 was only made available at the owncloud site one month before the F30 OS was no longer supported by Fedora, and no f31 version available yet.
I am switching infrastructure from Fedora to CentOS for stability; if you have any software you expect to keep running more than six months you should as well.

About mark

At work, been working on Tandems for around 30yrs (programming + sysadmin), plus AIX and Solaris sysadmin also thrown in during the last 20yrs; also about 5yrs on MVS (mainly operations and automation but also smp/e work). At home I have been using linux for decades. Programming background is commercially in TAL/COBOL/SCOBOL/C(Tandem); 370 assembler(MVS); C, perl and shell scripting in *nix; and Microsoft Macro Assembler(windows).
This entry was posted in Unix. Bookmark the permalink.