Resource icon

Scripted installation of Nextcloud 28 in iocage jail 2018-03-23

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
You can snapshot the jail if you want, but everything that's changed in the update is stored outside the jail. This also means that snapshotting only the jail won't help you.

Edit: Wrong, see below.
 
Last edited:

listhor

Contributor
Joined
Mar 2, 2020
Messages
133
So, 'config' dataset includes everything in /usr/local/www/?
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
So, 'config' dataset includes everything in /usr/local/www/?
I'm glad you made me double-check--no, it doesn't. Yes, you should shapshot the jail. And still snapshot (recursively) the Nextcloud dataset, since it contains your database.
 

listhor

Contributor
Joined
Mar 2, 2020
Messages
133
I'm glad you made me double-check--no, it doesn't. Yes, you should shapshot the jail. And still snapshot (recursively) the Nextcloud dataset, since it contains your database.
Thanks, now I understand it and I have a general overview. To sum up:
1/ Do recursive snapshots of poolname/iocage/jails/nextcloud and poolname/nextcloud
2/ If there's a need to rollback, do it for poolname/iocage/jails/nexcloud/root and poolname/nextcloud/config, poolname/nextcloud/theme, poolname/nextcloud/db. OR, alternatively is it good enough to rollback only 'root' (recursive) snapshots: poolname/iocage/jails/nextcloud and poolname/nextcloud?

BTW, wouldn't be a good idea to have content of /usr/local/www/ in config dataset?
 

kwessel

Dabbler
Joined
Mar 30, 2015
Messages
44
I have had two machines running with your script for two years. One crashed. I moved three data drives to a new machine and installed Freenas 11.3-U5. I then ran the new version of your script.

I restored my pool from the data drives with following datasets:

tank/db
tank/files

I then added tank/config and tank/themes which is apparently not consistent with your instructions. Regardless, I ran your script and now have Nextcloud running on the new machine.

Directory structure as follows:

1602453118529.png


I have thousands of documents in the legacy files (directories). Is there an easy way to set mnt/tank/files as my data directory for Nextcloud as opposed to mnt/tank/nextcloud/files ?
 

RSVP

Explorer
Joined
Feb 11, 2016
Messages
73
I have retried the script now with Caddyv2 and I didnt have any of the issues I had in the previously. Thanks

I have been messing around with this install since I finally was able to get it to work behind pfsense and haproxy using the no cert option.

I still have two things I am trying to work on:

1.Mail App - is just slow on any install I have used. Wondering if you have had slow issues on your similar setup. Not sure how to speed it up.


2. migrating database over from my older plugin setup. I do not seem to be able to restore the mysqldump from the plugin also on vs 19 on this jail. I get error 1227 (42000) at line 18: Access denied; you need (at least one of) the SUPER privilege(s) for this operation.

Edited to add that I found solution to the migration of database here https://help.poralix.com/articles/m...u-need-the-super-privilege-for-this-operation

Any experience regarding these would be appreciated..
Cheers
 
Last edited:

AznRaven

Cadet
Joined
Oct 12, 2020
Messages
3
after running this ---> git clone https://github.com/danb35/freenas-iocage-nextcloud
where is the file located so i can run this ---> script nextcloud.log ./nextcloud-jail.sh

i get this.

root@freenas[~]# script nextcloud.log ./nextcloud-jail.sh
Script started, output file is nextcloud.log
script: ./nextcloud-jail.sh: no such file or decrectory
script done, output file is nextcloud.log
 
Joined
Jan 4, 2014
Messages
1,644
Did you change to the directory freenas-iocage-nextcloud?
 

InGenetic

Contributor
Joined
Dec 18, 2013
Messages
183
hi Mr. danb35,

can i use your script for build nextcloud on my freenas but only for LAN ? because i don't have any public address here, i wish i could use nextcloud just for LAN network , and if it will be work with onlyoffice document server without ssl ?

Please advice.

Thanks n regards,
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Basil would have to comment about OnlyOffice. But yes, you should be able to use it locally. A couple of points to consider:
  • Without a public domain name, you won't be able to use Let's Encrypt. That means you'd need to either use a self-signed cert, or no cert (and therefore no TLS) at all.
  • If you have the ability to set up local DNS (probably through your router), it'd probably be preferred to use a local domain, in which case HOST_NAME might be something like cloud.lan. Otherwise, you could use the IP address of the jail.
 

airflow

Contributor
Joined
May 29, 2014
Messages
111
Hello danb35, your script already helped me a lot in the past and it is very nicely done, thank you for your effort!

I have a question regarding running nextcloud in a Freenas-jail, although I cannot use your exact script for a reason. I did, however study and borrowed a lot of it. :smile: I completely understand that you don't want to troubleshoot problems not directly connected to your script, but perhaps you still have an idea or can point me to the right direction.

Basically I use exactly the same software-componentes as you do (jail, mariadb, caddy, redis, php-fpm etc) and bring them together to provide the nextcloud service. It's just that I use my own collection of scripts for that and that I build the ports instead of using the pre-packaged binaries.

Since a while a have the problem that the webserver presents me with an error-message instead of the nextcloud-login:

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.

The caddy-logfile doesn't help, also the php-fpm logfile contains nothing. I tried to tune the php.ini file to log more, but it didn't change anything. Also the nextcloud.log is empty (regarding this problem). I use exactly the same config-files as you for redis, php-fpm, and caddy (however this contains other added sections as well).

The caddy-server also provides other simple webservices besides nextcloud, which continue to work. I have the suspicion that it has to do with php-fpm, or caddy and php-fpm communicating together properly. But I don't see any mistake/problem in the config/logs however and I cannot bring it to be more verbose.

It is so strange, because when I update the port from the state of the jail were still everything works (and update the Caddyfile to the new version style), to an up-to-date ports-tree, it works as long as I don't restart the jail. But the moment I do (restart the jail), it stops working and above error appears. I have a snapshot were everything still works (with Caddy v1 still), so I can revert to that after a night of failed troubleshooting. :smile:

Any comment/insight appreciated - Thanks!
 
Joined
Jan 4, 2014
Messages
1,644
@airflow This usually indicates a malformed config.php. Check that you have a comma at the end of the line for every parameter. It's easy to overlook this.
 
Joined
Jan 4, 2014
Messages
1,644
if it will be work with onlyoffice document server without ssl ?
Even though I've got unencrypted (HTTP) communication set up for both Nextcloud and OnlyOffice servers on the local network, I've not been successful getting them to work together without also engaging a reverse proxy. For me, personally, Caddy was the enabler for OnlyOffice and Nextcloud integration.

EDIT: It appears some forum members have it working without SSL (refer to the OnlyOffice-Nextcloud discussion area starting at this post).
 
Last edited:

airflow

Contributor
Joined
May 29, 2014
Messages
111
@airflow This usually indicates a malformed config.php. Check that you have a comma at the end of the line for every parameter. It's easy to overlook this.
You mean the config-file from nextcloud, right? There is no other file with that name in my jail. I'm afraid it's not that, as I haven't modified this file at all... I checked and it looks good. But even if this is the right direction - do you know any way of checking/troubleshooting/enabling better logging, better output about where the error is rooted in? My problem is that I couldn't find any logfile (I even sorted *all* of them by modification time to find anything) with some info about this problem.
 
Joined
Jan 4, 2014
Messages
1,644
You mean the config-file from nextcloud, right? There is no other file with that name in my jail. I'm afraid it's not that, as I haven't modified this file at all... I checked and it looks good. But even if this is the right direction - do you know any way of checking/troubleshooting/enabling better logging, better output about where the error is rooted in? My problem is that I couldn't find any logfile (I even sorted *all* of them by modification time to find anything) with some info about this problem.
There's a config.sample.php in the same directory as config.php. Swap your config.php out with it and if NC then responds, it will confirm the issue lies in your config file.
 

airflow

Contributor
Joined
May 29, 2014
Messages
111
Otherwise, I know you've said there's nothing interesting in caddy.log, but could you post it anyway?
I am happy to report that I found the issue! I think this information will be helpful for you, as you didn't run yet into this issue, but I assume you will too.

The source of the problem lies within mariadb. In one of the latest updates of the ports, the default MySQL socket location has moved from /tmp to /var/run/mysql for both client and server packages.

This change has to be incorporated in the php.ini file. I have to explicitly set
pdo_mysql.default_socket=/var/run/mysql/mysql.sock

As soon as I added this, the server error went away. I found the error by updating every package step by step and observe when the problem starts to happen.
 
Joined
Jan 4, 2014
Messages
1,644
The source of the problem lies within mariadb. In one of the latest updates of the ports, the default MySQL socket location has moved from /tmp to /var/run/mysql for both client and server packages.

What version of MariaDB are you using?
 
Top