ownCloud + Nextcloud: Large rework completed

Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
Post Reply
User avatar
MichaIng
Legend
Posts: 546
Joined: Sat Nov 18, 2017 5:21 pm

ownCloud + Nextcloud: Large rework completed

Post by MichaIng » Wed Dec 13, 2017 7:08 pm

Hey guys,

we recognized that many of you use ownCloud and Nextcloud on your DietPi. Thus we started to do a great rework of their automated installation and configuration to offer you the best optimized ready to use instances. You can follow the progress on github: https://github.com/Fourdee/DietPi/issues/1067

The rework includes:
  • Optimized PHP settings to suppress warnings on web ui admin panel.
  • Optimized Apache and Nginx configuration, selective for your instance subdirectory.
  • Usage of Redis server for transactional file locking.
  • Configure system cron to schedule ownCloud/Nextcloud cron jobs.
  • Shortcuts for occ commands: Simply type 'occ' on ownCloud and 'ncc' on Nextcloud, without 'sudo -u www-data php /var/www/*cloud/'.
  • 4-byte character support on database, to allow storing of emojis inside apps.
  • Automated appliance of maintenance:mode on DietPi's maintenance tasks.
  • Ongoing improvements are planned.
The majority of the rework is done, with the second Phase implemented and fixed with DietPi v159. The DietPi updater will schedule an automated reinstallation of both, if installed. Don't worry about your data and in case manual webserver and/or ownCloud/Nextcloud configurations. All data will remain and existing configuration will be touched carefully to implement optimisations without destroying manual adjustments.
But as we want to be careful, we are not able to include all the changes we made into existing instances.
Thus if you want to enjoy the total set of improvements, simply uninstall ownCloud/Nextcloud via dietpi-software and install it again afterwards. Configurations, including selective webserver config files, will be removed that way, but your data will stay in place and your database will be dumped into the userdata folder. Afterwards, install the instance again and directly restore the nextcloud/owncloud database backup to fully restore all data inside your instance.

Caution:
  • Even that DietPi automatically creates a MySQL/MariaDB backup, we recommend to please always do a manual backup of database and datafolder by yourself, before doing significant changes. You may want to use 'dietpi-backup', or in scheduled way 'dietpi-sync' for this.
  • Read the MariaDB instructions on how to dump and restore the database: https://mariadb.com/kb/en/library/backu ... -overview/. This is valid for MySQL databases as well.
Review, feedback and feature requests from you are highly appreciated. You may wan't to use this thread or directly file an issue on github: https://github.com/Fourdee/DietPi/issues

User avatar
WarHawk
Posts: 424
Joined: Thu Jul 20, 2017 7:55 am

Re: ownCloud + Nextcloud: Large rework completed

Post by WarHawk » Thu Dec 14, 2017 6:38 am

Awesome...I have a working install of Nextcloud (between my wife and my phones have like 24GB already stored on the drive)...will definitely be doing this method...

My v159 update went like a champ without a hitch

Thanks for the hard work and keeping with the updates and software! Great job!

User avatar
MichaIng
Legend
Posts: 546
Joined: Sat Nov 18, 2017 5:21 pm

Re: ownCloud + Nextcloud: Large rework completed

Post by MichaIng » Thu Dec 14, 2017 4:20 pm

Thanks for the nice feedback! If there is any question or any wish, just ask. I am perfectionist, which means that I will practically never stop to improve this and also improve the way of implementing new features as smooth as possible :D.

aterhorst
Posts: 3
Joined: Fri Jul 13, 2018 5:59 am

Re: ownCloud + Nextcloud: Large rework completed

Post by aterhorst » Fri Jul 13, 2018 8:03 am

I have set up an owncloud instance on my Raspberry Pi Zero W. Works well with Lighttpd. However, I am struggling with a couple things.

First, it is not clear how to enable SSL on my owncloud server. CertBot is designed for Apache and Nginx, it seems. I cannot find a tutorial that explains how to set up SSL in my instance (Dan says one that exists on this forum is outdated/not needed).

Second, while I can access my owncloud via a specific open port on my router IP address, as soon as I try do the same with a domain name, I get as far as the generic Lighttp page (my.domain.com). Note my URL redirect on afraid.freedns.org points my.domain.com to XXX.XXX.XXX.XXX:PPPP. As soon as I add /owncloud/ to the domain URL I am presented a blank page (my.domain.com/owncloud). This does not happen when I type in the actual IP address e.g. XXX.XXX.XXX.XXX:PPPP/owncloud. Obviously I failed to configure something. I edited /var/www/owncloud/config/config.php so that both my Raspberry Pi, router IP address, and my.domain.com are seen as trusted domains. Any advice would be appreciated.

Thanks in advance.

User avatar
MichaIng
Legend
Posts: 546
Joined: Sat Nov 18, 2017 5:21 pm

Re: ownCloud + Nextcloud: Large rework completed

Post by MichaIng » Mon Jul 16, 2018 11:28 am

@aterhorst
To enable SSL, no matter if Apache, Nginx or Lighttpd is used, install CertBot and run dietpi-letsencrypt to configure it. CertBot itself brings automated webserver configuration modules for Apache and Nginx only. But it allows to use any existing webserver or even it's own standalone solution, so verify the domain and place the certificate+key. dietpi-letsencrypt then handles the installation of those into Lighttpd.

Just to be sure, so far now you don't use SSL at all and access your ownCloud via http:// right?
Hmm, I am not sure how trusted domains handle custom ports, never tested this. But obviously it works since XXX.XXX.XXX.XXX:PPPP/owncloud works and as well ownCloud does not make a difference between 80 and 443 there, I guess ports are completely ignored anyway.

Does my.domain.com:PPPP/owncloud work?

aterhorst
Posts: 3
Joined: Fri Jul 13, 2018 5:59 am

Re: ownCloud + Nextcloud: Large rework completed

Post by aterhorst » Sun Jul 29, 2018 6:25 am

Hi Michael

I am struggling here. I tried this command line:

./letsencrypt-auto certonly --webroot -w /var/www/owncloud/ -d my.domain.com

And get this error:

- The following errors were reported by the server:

Domain: my.domain.com
Type: unauthorized
Detail: Invalid response from
http://my.domain.com/.well-known/acme-c ... fSTiXZ1Vig
[213.218.170.140]: 403

It seems the permissions for /var/www/.well-known/ may be an issue? My A record in freedns.afraid.org for my.domain.com matches 213.218.170.140.

I read that I may need to change a rewrite rule in .htaccess in /var/www/owncloud?

My feeling is that dietpi software configuration has an unresolved permissions issue. This should run out the box on a vanilla installation of dietpi using standard installation parameters. Owncloud works out the box, beautifully as http://my.domain.com:7053/owncloud/. I just want to to add SSL to secure it better.

Admittedly, I am not an expert in Linux! Your help would be appreciated.

aterhorst
Posts: 3
Joined: Fri Jul 13, 2018 5:59 am

Re: ownCloud + Nextcloud: Large rework completed

Post by aterhorst » Sun Jul 29, 2018 1:08 pm

OK, I figured out the problem. I needed to change my router admin port to 8080. The DNS was ending up at the router not the owncloud device. Silly me. Thanks for the assistance, Michael.

Post Reply