Install OwnCloud on your Raspberry Pi

Owncloud Logo

OwnCloud is a free (libre), open source equivalent to DropBox.

As well as the program you install on your server, it has free desktop sync clients for Linux, Windows and Mac, and apps for Android and iOS.

I’m just going to cover the server side of things for your Pi in this tutorial, because the desktop client can be found in the Ubuntu repos, and the app is on the Play Store. If you want the Android app free of charge, then install it via F-Droid.

First, install Apache 2 and some other bits.

These are all the bits you need to install before you can run OwnCloud.

sudo apt-get install apache2 php5 php5-gd php-xml-parser php5-intl
sudo apt-get install php5-sqlite php5-mysql smbclient curl libcurl3 php5-curl

Next, Download and Install OwnCloud

If you visit the Owncloud installation page here, you will find the installation file.

Choose “Tar or Zip File” under the server heading.

OwnCloud intsallation download page

Now copy the link address of .tar.bz2 file (you can do this by right clicking and choosing “Copy Link Address” in Chrome or Chromium). At the time of writing, this address is http://download.owncloud.org/community/owncloud-5.0.12.tar.bz2, but it will change when a new version comes out, so it’s worth checking.

Save the address of the UNIX .tar.bz2 file (right click, copy link address in Chrome)

Save the address of the UNIX .tar.bz2 file (right click, copy link address in Chrome). Now, open a secure shell (SSH) into your Pi, and download the file:

wget http://download.owncloud.org/community/owncloud-5.0.12.tar.bz2

The zip file will be downloaded to your home directory (unless you were in some other directory before you ran that command, in which case it will be in there). Now extract the .tar file:

tar -xjf owncloud-5.0.12.tar.bz2

You will now have a sub-directory in your home directory called owncloud. Copy it to Apache’s data directory:

cp -r owncloud /var/www/

This will copy all your owncloud stuff into a directory at /var/www/owncloud, meaning that your owncloud website will be located at yourdomain.com/owncloud/.

Optional: Move OwnCloud to the Root Apache2 Directory

If you would like owncloud to be on the root of your domain (i.e. yourdomain.com takes you straight to owncloud) then you can move the contents of /var/www/owncloud up a directory into /var/www/ with the following command:

cd /var/www/
sudo find owncloud -maxdepth 1 -mindepth 1 -exec mv {} . \;
sudo rmdir owncloud

I got that handy tip from this website, check it out for a great explanation.

A Few Final Touches

Now, make sure that Apache owns all of those files you just added:

sudo chown -R www-data:www-data /var/www/

Now open your Apache virtual host file and change it to enable .htaccess files for OwnCloud (this is necessary so that OwnCloud can do things like override the global maximum file size for uploads):

sudo nano /etc/apache2/sites-enabled/000-default

Change AllowOverride None to AllowOverride All in the Directory /var/www/ section of the file.

Now check if an .htaccess file for OwnCloud exists. If it doesn’t, create it:

cd /var/www/ #use /var/www/owncloud if you didn't move it to /var/www/
ls -al
#look for .htaccess. If it exists, skip the next two lines
sudo touch .htaccess
sudo chown www-data:www-data .htaccess

Now run the following two commands to enable some apache modules, and restart apache2:

sudo a2enmod rewrite
sudo a2enmod headers
sudo service apache2 restart

Port Forwarding and DNS

If you want to access your ownCloud installation from outside your LAN, you'll need to forward ports 80 and 443 (for HTTP and HTTPS) to the Pi from your router.

If you haven't done this already, you may want to use my tutorials to set up a DNS A record to map your domain name to your public IP address, and make use of ddclient to update your DNS records when they change if you have a dynamic IP address.

Testing

Test your installation, by visiting your server’s URL. Either use http://yourdomain.com/owncloud if you didn’t move owncloud to Apache’s root directory, or http://yourdomain.com if you did.

You should be greeted with an installation wizard.

Owncloud database drivers error

If you get an error about database drivers, then try installing php5-mysql again – for some reason, it didn’t install properly first time for me, although no errors were shown:

sudo apt-get install php5-mysql
sudo reboot

You should no longer see the error if you visit the page again.

Database Username and Password

The OwnCloud installation wizard will ask you for a database username and password.

If you haven’t set up any other databases on this server before (and therefore don’t have a root database user and password) then you will have to create a root database username and password before you can continue. If you are already using software that uses databases (like WordPress) then you probably already have a database root username and password, and can skip this step.

Install mysql server and client:

sudo apt-get update
sudo apt-get install mysql-server mysql-client

The package installation will bring up a configuration wizard. Enter the username you’d like to use, and a password. Write these down, you’ll need them later.

Now you can complete the installation. Go back to your browser with the OwnCloud setup wizard, and choose a username and password for your OwnCloud user account. You also need to enter the database root username and password, and choose a name for the OwnCloud database (“owncloud” will do). The database location is localhost.

Some extras

1) Cut Page Loading Times with a PHP Cache

PHP is a server side scripting language. When you request a page on the server, the server has to compile the page from the PHP source.

Because your Pi is such a low powered machine, this can be really slow.

Luckily, there’s a PHP cache you can use that will store a pre-compiled copy of pages in your RAM after they have been visited already. This makes a MASSIVE difference – before installing the cache, it took 21 seconds to load the index page, afterwards a mere 7-8 seconds.

Install it by using this command:

sudo apt-get install php-apc

Now restart the Apache web server using:

sudo service apache2 restart

The first time you visit a page may be slow, but if you navigate away and then come back to it you should notice a significant improvement.

Thanks to Steve Riley at Kubuntuforums for this tip.

2) Put all your data on an external hard drive

If you have moved your Pi’s root filesystem to a USB flash drive then you may have enough storage to use OwnCloud as it is.

However, one of the main advantages of using OwnCloud instead of Dropbox is that you can easily plug in as many hard drives as you like and wave goodbye to that 5GB storage limit.

I attached a self-powered 500GB hard drive to mine, and it works beautifully. Remember, the Pi doesn’t have enough power to run a passport drive without an external hub to provide power.

Before we start, format your hard drive with a journalling filesystem such as ext3 or ext4.

First, make the directory ready to mount your drive:

sudo mkdir /media/owncloud

Plug in your drive to your Pi, and type:

sudo blkid

Make a note of the output for the device you want to mount. Here’s an example (it’s for one of my laptop’s partitions, hence /dev/sda6, yours will be a whole drive, e.g. /dev/sdX)

/dev/sda6: LABEL="Data" UUID="f052e620-9e88-4b19-9b9a-d6dce4d6603b" TYPE="ext4"

Now edit the file /etc/fstab, which controls how and where drives are mounted at boot.

sudo nano /etc/fstab

Edit the file so it looks something like this, but replace my UUID with yours and update the filesystem type from ext4 to whatever you are using if necessary:

proc            /proc           proc    defaults          0       0
/dev/mmcblk0p1  /boot           vfat    defaults          0       2
/dev/mmcblk0p2  /               ext4    defaults,noatime  0       1
UUID="96f64567-c459-4d3d-9f52-e6aabee544d2"     /media/owncloud         ext4    defaults    0       2
# a swapfile is not a swap partition, so no using swapon|off from here on, use  dphys-swapfile swap[on|off]  for that

Now reboot the Pi and check your drive is mounted properly:

cd /media/owncloud
ls -al

Stop Apache2:

sudo service apache2 stop

Now we need to move Owncloud’s data directory, and create some symbolic links so that the rest of Owncloud still knows where to look for data.

Where you’re moving stuff from depends on whether or not you moved owncloud to Apache’s root (/var/www). If you did move it, then owncloud is currently installed at /var/www; if you didn’t move it then it’s in /var/www/owncloud.

I’m going to assume that you did move Owncloud. If you didn’t, then you need to insert /owncloud after /var/www in each of these steps.

Move /var/www/data to /media/owncloud:

sudo mv /var/www/data /media/owncloud/data

Create a symbolic link to the new owncloud directory.

sudo ln -s /media/owncloud/data /var/www/data

Now do the same for the config folder:

sudo mv /var/www/config /media/owncloud/config
sudo ln -s /media/owncloud/config /var/www/config

Now check that the ownership of the moved files is Apache (www-data):

sudo chown -R www-data:www-data /media/owncloud

Now start Apache2 again:

sudo service apache2 start

Any data you now upload should go in your external hard drive.

I owe thanks to Steve Riley (again!) at OwnCloud forums for this one.

3) Force SSL (https) Connection

You can force your users to connect to OwnCloud using an HTTPS connection.

Simply change the virtual hosts file for apache2 to enable .htaccess as before: open /etc/apache2/sites-available/default-ssl and change AllowOverride None to AllowOverride All under the Directory /var/www/. Make sure you have the line SSLEngine on, and your SSLCertificateFile and SSLCertificateKeyFile point to the certificates you’d like to use.

Now enable the Apache SSL module:

sudo a2enmod ssl

Enable the SSL site:

sudo a2ensite default-ssl

Reload Apache:

sudo service apache2 reload

Now visit https://yourdomain.com/owncloud if you didn’t move apache to your root, or https://yourdomain.com if you moved owncloud to your root directory.

Using the drop-down menu, navigate to admin –> admin, and under the Security header, tick the Enforce HTTPS box.

Check the Enforce HTTPS box

Note that you will only be able to do this if you are connected with https (otherwise you’d lock yourself out!)

All done. Now all your communications between the client machines and your server will be encrypted. If you try to visit the http version of OwnCloud, you will be redirected to https.

If you don't already have a SSL certificate, you may want to generate your own and get it signed by CAcert for free.

Hope you found that useful. If there’s anything else you’d like to know, leave a comment!

Type: 

Comments

This time round, don't move the config folder and see what happens (I suggested this before you started over).

If you did as you suggested with the symbolic links at the end of your comments, you would have two links that both pointed to the same thing, i.e.

/var/www/owncloud/data linking to a directory on the external HDD (/media/owncloud), which contained directories called data and config.

To the system, this would look like:

/var/www/owncloud/data/config
/var/www/owncloud/data/data
/var/www/owncloud/config/config
/var/www/owncloud/config/data

...which is not what we're aiming for!

Here's an example of what you should be doing, in a test directory on my laptop - pretend ~/test/HDD is /media/owncloud and ~/test/owncloud is /var/www/owncloud. I had to create the data directory and some dummy files ("foo", "bar" and "baz") so you can see them in the folder once it's moved:

sam@T440s:~$ mkdir test
sam@T440s:~$ cd test
sam@T440s:~/test$ wget https://download.owncloud.org/community/owncloud-8.2.2.tar.bz2
--2016-02-24 20:57:34--  https://download.owncloud.org/community/owncloud-8.2.2.tar.bz2
Resolving download.owncloud.org (download.owncloud.org)... 188.40.68.177, 213.239.207.26, 188.40.127.122, ...
Connecting to download.owncloud.org (download.owncloud.org)|188.40.68.177|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 28922075 (28M) [application/x-bzip2]
Saving to: ‘owncloud-8.2.2.tar.bz2’

owncloud-8.2.2.tar.bz2  100%[============================>]  27.58M  1.33MB/s    in 11s     

2016-02-24 20:57:45 (2.51 MB/s) - ‘owncloud-8.2.2.tar.bz2’ saved [28922075/28922075]

sam@T440s:~/test$ tar -xf owncloud-8.2.2.tar.bz2 
sam@T440s:~/test$ l
owncloud/  owncloud-8.2.2.tar.bz2
sam@T440s:~/test$ mkdir HDD
sam@T440s:~/test$ cd owncloud
sam@T440s:~/test/owncloud$ ls
3rdparty  console.php   db_structure.xml  l10n  ocs-provider  robots.txt  version.php
apps      COPYING-AGPL  index.html        lib   public.php    settings
AUTHORS   core          index.php         occ   remote.php    status.php
config    cron.php      indie.json        ocs   resources     themes                         
sam@T440s:~/test/owncloud$ mkdir data
sam@T440s:~/test/owncloud$ cd data                                                           
sam@T440s:~/test/owncloud/data$ touch foo bar baz
sam@T440s:~/test/owncloud/data$ l                                                            
bar  baz  foo
sam@T440s:~/test/owncloud/data$ cd ~/test 
sam@T440s:~/test$ mv owncloud/data HDD/data
sam@T440s:~/test$ ln -s ~/test/HDD/data ~/test/owncloud/data
sam@T440s:~/test$ ls owncloud
3rdparty  console.php   data              indie.json  ocs           resources   themes
apps      COPYING-AGPL  db_structure.xml  l10n        ocs-provider  robots.txt  version.php
AUTHORS   core          index.html        lib         public.php    settings
config    cron.php      index.php         occ         remote.php    status.php
sam@T440s:~/test$ ls owncloud/data
bar  baz  foo

At the end of this, the system still sees the data files in owncloud/data, even though they are actually in HDD/data, because of the symbolic link.

Sam

Hi Sam,

I think it is working now...but will celebrate once I've heard back from...

I followed your advice and only moved and linked the data directory to the HDD. My outputs are as follows:

admin@pi-box:~ $ ls /var/www/owncloud
3rdparty core indie.json public.php themes
apps cron.php l10n remote.php version.php
AUTHORS data lib resources
config db_structure.xml occ robots.txt
console.php index.html ocs settings
COPYING-AGPL index.php ocs-provider status.php
admin@pi-box:~ $ sudo ls /var/www/owncloud/data
admin index.html owncloud.db owncloud.log updater_backup

and...

admin@pi-box:~ $ ls -al /var/www/owncloud
total 180
drwxr-xr-x 13 www-data www-data 4096 Feb 25 19:49 .
drwxr-xr-x 4 www-data www-data 4096 Feb 25 19:14 ..
drwxr-xr-x 28 www-data www-data 4096 Feb 25 19:14 3rdparty
drwxr-xr-x 21 www-data www-data 4096 Feb 25 19:14 apps
-rw-r--r-- 1 www-data www-data 477 Feb 25 19:14 AUTHORS
drwxr-xr-x 2 www-data www-data 4096 Feb 25 19:26 config
-rw-r--r-- 1 www-data www-data 2532 Feb 25 19:14 console.php
-rw-r--r-- 1 www-data www-data 34520 Feb 25 19:14 COPYING-AGPL
drwxr-xr-x 19 www-data www-data 4096 Feb 25 19:14 core
-rw-r--r-- 1 www-data www-data 5418 Feb 25 19:14 cron.php
lrwxrwxrwx 1 root root 23 Feb 25 19:49 data -> /media/owncloudHDD/data
-rw-r--r-- 1 www-data www-data 23886 Feb 25 19:14 db_structure.xml
-rw-r--r-- 1 www-data www-data 2178 Feb 25 19:32 .htaccess
-rw-r--r-- 1 www-data www-data 179 Feb 25 19:14 index.html
-rw-r--r-- 1 www-data www-data 2026 Feb 25 19:14 index.php
-rw-r--r-- 1 www-data www-data 2595 Feb 25 19:14 indie.json
drwxr-xr-x 2 www-data www-data 4096 Feb 25 19:14 l10n
drwxr-xr-x 6 www-data www-data 4096 Feb 25 19:14 lib
-rw-r--r-- 1 www-data www-data 283 Feb 25 19:14 occ
drwxr-xr-x 2 www-data www-data 4096 Feb 25 19:14 ocs
drwxr-xr-x 2 www-data www-data 4096 Feb 25 19:14 ocs-provider
-rw-r--r-- 1 www-data www-data 2969 Feb 25 19:14 public.php
-rw-r--r-- 1 www-data www-data 4521 Feb 25 19:14 remote.php
drwxr-xr-x 3 www-data www-data 4096 Feb 25 19:14 resources
-rw-r--r-- 1 www-data www-data 26 Feb 25 19:14 robots.txt
drwxr-xr-x 13 www-data www-data 4096 Feb 25 19:14 settings
-rw-r--r-- 1 www-data www-data 1817 Feb 25 19:14 status.php
-rw-r--r-- 1 www-data www-data 12 Feb 25 19:14 .tag
drwxr-xr-x 3 www-data www-data 4096 Feb 25 19:14 themes
-rw-r--r-- 1 www-data www-data 163 Feb 25 19:14 .user.ini
-rw-r--r-- 1 www-data www-data 233 Feb 25 19:14 version.php

and my external HDD...

admin@pi-box:~ $ ls -a /media/owncloudHDD
. .. data
admin@pi-box:~ $ sudo ls -a /media/owncloudHDD/data
. admin index.html owncloud.db updater_backup
.. .htaccess .ocdata owncloud.log

I didn't attempt to move the config (yet)...

Please advise if this is now, hopefully correct.

Many thanks.

Jo

Looks much better. Can you also list the permissions in your HDD?

ls -al /media/owncloudHDD/data

Don't bother moving the config, I don't think it's necessary.

Does owncloud load now in the browser, or do you get the same error? If you still get errors, what's in /var/log/apache2/error.log (or whichever log file is for that virtualhost)?

Sam

Hi Sam,

Here's my owncloudHDD permissions:

admin@pi-box:~ $ sudo ls -al /media/owncloudHDD/data
[sudo] password for admin:
total 28
drwxrwx--- 4 www-data www-data 4096 Feb 25 19:32 .
drwxr-xr-x 3 www-data www-data 4096 Feb 25 19:48 ..
drwxr-xr-x 5 www-data www-data 4096 Feb 25 19:59 admin
-rw-r--r-- 1 www-data www-data 284 Feb 25 19:32 .htaccess
-rw-r--r-- 1 www-data www-data 0 Feb 25 19:32 index.html
-rw-r--r-- 1 www-data www-data 0 Feb 25 19:32 .ocdata
-rw-r--r-- 1 www-data www-data 1024 Feb 25 19:26 owncloud.db
-rw-r----- 1 www-data www-data 508 Feb 25 19:32 owncloud.log
drwxr-xr-x 2 www-data www-data 4096 Feb 25 19:32 updater_back

I can view owncloud in a browser on my LAN, but I saw at school today I couldn't access pi-box.co.uk/owncloud from outside the LAN. I thought there may be a clash of some sort because of courseworkresources.com using the same router ip and is where my current email server is on another pi, so I removed the dns A record for courseworkresources.com on namecheap. I'll be moving (creating) the email server on my pi-box domain soon...so I'll also check some other settings for access from outside my LAN.

Regards,

Jo

Jo,

Permissions look OK to me!

You don't need to remove the old DNS A record (you can have many domains pointing to one IP address - in fact you need to if you want more than one website on different virtualhosts).

You might need to update the port forwarding rules for 80 and 443 though, to make sure HTTP and HTTPS traffic is routed to your owncloud Pi.

Sam

Hi Sam,

You're right once again! I checked my port forwarding and ensured that http/https is forwarding to the correct raspi (I have too many probably). Checked mac addresses with ifconfig and saw it was pointing to a different raspi - fixed it and also named my port forwards with proper names.

I can access pi-box.co.uk/owncloud from LAN, but I get the following before the login process:

You are accessing the server from an untrusted domain. Please contact your administrator. If you are an administrator of this instance, configure the "trusted_domain" setting in config/config.php.

...etc

Any idea?

Regards,

Jo

Great :)

Sure, this is one of the things they changed in a more recent version of ownCloud (version 8 I think) so I should probably add it to the tutorial. In fact, the whole thing could probably do with a rewrite.

Go to owncloud/config/config.php and edit the trusted domains section so it looks like this:

  'trusted_domains' => 
  array (
    0 => 'yourdomain.com',
  ),

You can put more than one domain in there if you like.

Sam

Hi Sam,

Once again your support turned out to be invaluable! Thank you so much!

Accessing it from WAN now. (I'm using Owncloud 8.2.2)

Now to start from scratch and do all the email server stuff on this Pi.

Regards and many thanks again,

Jo

Hi Sam,
When I'm using owncloud outside home I have to add the trusted doimains to the local server. I have my file on an external HDD.
I put in the terminal this code:
sudo nano /var/www/owncloud/config/config.php
and afeter I modified this:
array (
0 => '192.168.1.128',
),

to this

array (
0 => '192.168.1.128', 'myhost.zapto.org/owncloud',
),

After do this the server is not responsive.
When I try to connect to the server:
Internal Server Error

The server encountered an internal error and was unable to complete your request.
Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
More details can be found in the server log.

I don't know where's Apache log files...

Thank you

That's a syntax error, I think it should be:

array (
0 => '192.168.1.128',
1 => 'myhost.zapto.org',
),

Sam

Hi Sam,

Great tutorial - I thought I'd follow this one before I started on the email server!

I followed most of the tutorial here to set up ownCloud on [let's call it owncloud-pi] on my home network: installed LAMP as described, did the setup with MySQL and an external drive etc. When accessing ownCloud by directly accessing owncloud-pi (http://owncloud-pi's-ip-address/owncloud) from my home network, everything is fine. I even uploaded a file. Waheyy!

The complication is that I have an internet-facing pi [..let's call it web-pi] running an Express server that provides HTTPS only. I tweaked this express server to reverse-proxy requests to https://web-pi/owncloud/ to http://owncloud-pi's-ip-address/owncloud/, and thus, I believe, provide a secure connection to my ownCloud from the interwebs. Right?

I thought it had worked, as I browsed to https://web-pi/owncloud and was presented with the ownCloud splash/login page. I was very impressed with myself, what with me not being a web developer in the slightest. I tried to log in and....... splash/login page.

I opened up dev-tools in chrome and had a look at the network tab, and I'm getting net::ERR_CONNECTION_TIMED_OUT on a few files from owncloud (In fact, javascripts such as https://wep-pi/owncloud/core/vendor/es6-promise/dist/es6-promise.js?v=2283f8413653a56b24f06ec30a36f55b referenced by owncloud/index.php) I've since installed php-apc which has improved page load time somewhat but still a few timeouts.

So I was wondering if you'd seen this before (you fixed it with php-apc, didn't you :/) or if there was anything more I can do to speed up my little Raspberry Pi B? Owncloud/Apache is literally all it's doing..

Or is it indeed reverse-proxy related?

Love the site, very valuable resources here!

Hello again!

Be careful with your proxy settings, that was one of the first serious configuration errors I made with my server, and I was messing around trying to do exactly what you are doing!

To be honest, even after I addressed the configuration error I didn't think a reverse proxy was worth the hassle, (it didn't speed things up much).

To investigate this I would log in to both pi with ssh and run tail -f /var/log/apache2.log to see what happens on each server as the requests are handled, make sure the server behind the proxy receives all of the requests etc.

Sam

Hi :)

I only run Apache2 on the owncloud-pi - the proxying is handled by a NodeJS application on the web-pi. It used to serve HTTP (over port 80), but I rejigged the Express app to serve HTTPS and deal with SSL (thus moved to port 443) - then using a NodeJS module called http-proxy, I added a reverse-proxy route to the Express app which redirects to the owncloud-pi.

When I run tail -f /var/www/log/express.log I can see a lot of GET 200 to web-pi/owncloud and other testing shows my proxy route is redirecting calls properly - as evidenced by the 200 code, to be honest, as that's the proxy module talking.

Running tail -f /var/log/apache2/log tells pretty much the same story.

I guess my reply here is basically that it all seems to work, but I'm an idiot using usb wifi on both pis, so how can I speed up apache2 / owncloud on the slower pi (model is B+ ?) so that this works outside my local network - i.e I can not only see the owncloud splash, but use it?

I barely set up Apache2 more that you specified - I enabled the modules you recommended, and after I posted here, I had a browse through the ownCloud docs (from links in the ownCloud admin page that I could see because everything works fine over the local network) to discover that I should tweak the KeepAliveTimeout, MaxKeepAliveRequests, and OtherKeepAliveThing settings for Apache2. Is there more I can do?

Further Googling lead to my disappointment that I have Apache 2.2.2 on the owncloud-pi, and mod_gzip, another potential speedup recommended in the ownCloud docs, requires Apache 2.slightly.more. I don't know how to update my Apache* to get be able to get it :'(
Maybe a more lightweight server than Apache2 would give me a speedup on the puny pi?

So, no cheeky gzip speedup before bedtime yesterday to maybe make the problem go away. Although mod_deflate is enabled at least, so I am doing _some_ compression by default.. having read the post you link to after I posted - and scanning over it having looked at the ownCloud docs (:P), I did look for mod_proxy in mods-enabled, and ponder whether Apache2 needs to know that it is being proxied to. Alas, by then it was like 2am.

Another thing is that it _seems_ to be the same three files each time, that time out (net::ERR_CONNECTION_TIMED_OUT in chrome dev). I can't see any reason that they're unique (as other files of the same type are returned, a .js file with '?3463473456524' on the end of it's filename), but one of them is often underscore.js, which seems to be used quite heavily in the ownCloud interface. I read about a redirect loop you experienced? How would I detect that (I think I may see one due to missing files) - from the Apache2 log as you suggest?

Also I read in the ownCloud documentation that the static assets can be compressed to an assets.zip and thus be delivered quicker to the browser? How do I ensure that is happening?

Another solution to my problem may well be, should I just use ethernet, and how much is one of them ethernet-box things? (switch?)

Sorry, my feeling is that it probably has something to do with your proxy software, which I don't know anything about.

There's a difference between not working at all and not working fast enough, sounds like it doesn't pass on the .js at all?

If you don't see a successful hit on the .js assets for owncloud then maybe the proxy doesn't forward javascript?

Sam

Hi Sam,

I've been seeing error 503 in the express log (server took too long/didn't respond?), I've yet to catch the requests for the files in the apache access.log.

I've got WinSCP set up on my desktop now, so I can inspect these logs a little easier. I'll get back to you after easter, but it looks like a switch would solve my problems, as would finding out more about making ownCloud deliver its static assets as a .zip. - The owncloud-pi gets pretty close to 100% cpu usage (though not for long) when it's handling requests from the proxy, even with a slight overclock/under volt.

I appreciate you're not versed in the ways of NodeJS' http-proxy.. me either ;)

Looks cool, thanks for the link! This kind of solution is great because it can get people started taking their data back under their own control. I still think it's better (if people are technically capable) to teach people to set things up manually, because it means they are more aware of what's under the hood, better prepared to fix things themselves, and less likely to have the box become part of a botnet through neglect (although there is something to be said for the automatic updates).

Sam

Yeah it's pretty neat. Don't get me wrong, I have a slice media player (raspi compute module +hdd in a high spec encosure running openelec), which is a similar thing but for Kodi, it's a really nice product. I'd be stuck if I didn't know my way around the CLI though, because I've had to troubleshoot some weird issues on it that couldn't be solved using the gui.

If you get one of the ownCloud boxes, you should be well placed to enjoy the convenience of it, and troubleshoot any problems if the need arises :) ... looks like they're all out though, or did you manage to swipe one?

Sam

I am trying to set up Owncloud on RPI Zero with Raspbian Jessie Lite. I am stuck when I am supposed to edit the file: /etc/apache2/sites-enabled/000-default (Change AllowOverride None to AllowOverride All in the Directory /var/www/ section of the file). There is no such file in ... sites-enabled directory. There is file 000-default.conf but it evidently does not serve same purpose - there is no /var/www section in there. Seems to me that in Jessie there is something different from apache install in Wheezy. I am still digging around trying to figure out what to do, but I decided to ask you if you already know what is different ...

Hi Sam!
I have SO bananian on a Banana Pi M1. I have to install owncloud, I installed apache2 and other as your guide. The file /etc/apache2/sites-enabled/000-default does not exists and I don't know how it's possible that... So I cannot access to the web pages to configure owncloud.
Hi from Italy!
Thanks
Gabriele

Hi Gabriele,

The name of the file may have changed slightly in Jessie, or it might not be enabled. Let's list the enabled and available files in your apache config:

ls /etc/apache2/sites-enabled/
ls /etc/apache2/sites-available/

Sam

Hi Sam,
I solved the problem. Now I cannot access to my external HDD, the sym link doesn't work.. If I try to connect throught WebDAV I see about 5 GB and it seems be 300GB... I tried to remake the symlink and it doesn't work again.
Another problem is the max upload of 512MB. I tried to change the value in .htaccess file and in /etc/php5/fpm/php.ini but it doesn't work again.. Thank you a lot
Gabriele

Hi Sam,

Regarding my posts on 28/29 Aug 16 in the main Raspberry Pi Email Server section- I tested my ext HDD and has indeed failed...makes a repetitive clicking sound!

Anyway I have a new ext USB HDD that I formatted with ext4 and partitioned into 2 parts (sda5/sda6). Sda5 I named owncloudPB and sda6 backupPB. One I want to use for owncloud and the other to do backups etc.

I was hoping that I could just replace the HDD, edit /etc/fstab/ with the new details...but it didn't work. The owncloud page pi-box.co.uk/owncloud shows:

Data directory (/var/www/owncloud/data) is invalid
Please check that the data directory contains a file ".ocdata" in its root.

Cannot create "data" directory (/var/www/owncloud/data)
This can usually be fixed by giving the webserver write access to the root directory.

Do I have to redo the whole Owncloud install or is there a simpler way to add the new HDD if the previous one failed?

Regards,

Jo

Jo,

Did you lose the old data? If not, can you copy it over into the new folder?

Owncloud is funny about a change of path, but if you mount it in the same place it should be OK.

Sam

Jo,

I had to do a bind mount on mine to trick owncloud into thinking the data was in /var/www/owncloud/data - I'll have to look it up later to tell you exactly what I did. If you're installing for the first time though, can't you choose the data directory?

Sam

Hi Sam,

Not sure if I understand you correctly regarding the 'installing for the first time', but thank you for time and support.

I think it might be easier and 'wiser' if I do a fresh install of OC on a different RasPi...At the moment I've the non working version of OC as well as my email server (maybe split them up?).

If you think that is 'wiser', how can I completely remove OC with all its links so I just have this RasPi as my email server, without messing up the email server side of things?

Please advise.

Regards,

Jo

You could do that, but remember that you can only forward ports 80 and 443 (for http and https) to one pi, so splitting up the web server will affect squirrelmail. Alternatively, you could completely remove owncloud and then re-install it.

To remove owncloud, you can delete the owncloud user and database using phpmyadmin, and then remove all of the owncloud files (sudo rm -rf /var/www/owncloud or wherever you put them).

Sam

Hi Sam,

Thank you. I will re-install owncloud. It will be good practice...

I forgot about the port forwarding part where you can only forward the ports to one Pi. I shall start the process tonight!

Regards,

Jo

Pages

Add new comment