Install Nextcloud 12 on FreeNAS 11 - all guides not working

Status
Not open for further replies.

cunningorb

Explorer
Joined
Feb 5, 2018
Messages
58
I'm brand new to FreeNAS, and not having a very wonderful experience yet. Hoping we can change that.

I want my brand new installation of FreeNAS to run Nextcloud 12 and eventually 13 when it is out of beta.

There are several existing guides which would walk through step by step how to accomplish this.
https://forums.freenas.org/index.ph...3-on-freenas-11-with-all-checks-passed.58634/
https://ramsdenj.com/2017/06/05/nextcloud-in-a-jail-on-freebsd.html
https://forums.freenas.org/index.php?threads/please-help-me-install-nextcloud-12-in-jail.57855/ (great work @dureal99d you paved a good path)

What none of these tutorials cover currently is how to install Nextcloud 12 using the current stable version of FreeNAS, 11.1.

I have already been at this about 30-40 hours estimated but no matter what I run into some kind of game-ending error. The only time I was able to see Nextcloud in working form was when I installed using the plugin in the Old UI.

How far I've gotten:
*Old UI: I was able to get to the part where we install MariaDB 10.1, however the mysql service would not start. Multiple errors and no fix could work. Most common error was the same type of issue with sockets and not being able to remove mariaDB package that this person had: https://forums.freenas.org/index.php?threads/help-building-mediawiki-into-jail.60614/
*Old UI: I also tried from scratch again (both reinstalling the entire FreeNAS OS, and just removing and starting with a new jail) but using ports. This seemed like it might have worked except for the warnings about no ports being supported anymore. I even added allow unsupported system = yes to make.conf which allowed the install to happen, but in the very end the install still failed. Some file or other could not be found.
*New UI: The new UI wasn't showing any releases under creating a jail, but somehow I got lucky and fetched iocage 11.1 based on the ramsdenj guide above. Still, adding this jail from the beta UI I could not do anything because I was getting errors when trying to stop and start the jail. If I tried to stop it, the "dataset does not exist" error came up. I saw I was not the only person with this error either: https://forums.freenas.org/index.php?threads/cannot-destroy-iocage-jail.60058/

Bottom line, I have never gotten past installing MariaDB. That is like 15% of the guide so I'm starting to wonder if FreeNAS is just too much for me. I'm going to set a personal goal line after which if I can't figure this out, I will just adopt an OS that won't drive me crazy and lose the feature set that appears to come with FreeNAS. I know this may come across as negative when read online, but I only mean it as a pragmatic solution to how I can best use my free time. That is in limited supply and so far I have lost an amazing amount of it with no clear progress.

Before you ask, "Why don't you just run Nextcloud from another OS?" I was hoping to use the replication, file sharing, and possibly vpn features found in FreeNAS. I was also eager to attempt file duplication between the Nextcloud setup and my local network file sharing so that when remote, I sync via Nextcloud. When at home I work on the wired network. Both would be the same files. I was also contemplating the use of a Plex server.

If anyone could write a guide for installing Nextcloud 12 on FreeNAS 11.1 using the absolute latest of everything this would be a huge help for me. I understand if that is asking too much though!
 
Last edited by a moderator:

Nick2253

Wizard
Joined
Apr 21, 2014
Messages
1,633
Your first link looks like what you're looking for. I can't imagine than enough changed between FreeNAS 11 and 11.1 to cause that guide to significantly stop working.

Go through that guide, carefully, line by line, and make sure that you understand each sequence of events. It's pretty dense, so it might help to copy it into a text program, so you can rearrange it to more useful chunks.

Then, I'd recommend starting over from scratch. New dataset, new jail. Once you get to the MariaDB install, if you get any errors getting the service to start, post back here and we'll troubleshoot.

EDIT: doing some more research, I stand corrected. This post seems to address the issue with 11.1. The commands here are useful for making the jail: https://forums.freenas.org/index.ph...th-all-checks-passed.58634/page-6#post-436144
 
Last edited:

cunningorb

Explorer
Joined
Feb 5, 2018
Messages
58
That post came at just the right time. Amazing.

I was able to install MariaDB and flew through the rest of the tutorial. I am currently in desperate need of sleep but I think I'm close to getting it working. I am just still only getting the "It works!" page when I load my jail's IP address but I will take a crack at that tomorrow. I'll edit this post with my results. Thanks!
*Edit: The document root was set incorrectly in usr/local/etc/httpd.conf. Added nextcloud directory and now it works.
DocumentRoot "/usr/local/www/apache24/data/nextcloud/"
<Directory "/usr/local/www/apache24/data/nextcloud">
 
Last edited:

jasemo

Dabbler
Joined
Mar 15, 2018
Messages
30
So I'm glad cunningorb could get this to work, but I have no idea how.

I've been trying to get it to work for a number of days now and have reinstalled FreeNAS half a dozen times and I still am having no joy.
I'd really like to get a recent version of Nextcloud up and running but I'm about to giving up.

Are there any other more easy to understand or up to date guides?
 

cunningorb

Explorer
Joined
Feb 5, 2018
Messages
58
While I did get it running, I wouldn't say it was working 100%. I could never get the ssl portion working right. There is no current version guide that walks you through start to finish. My next attempt will likely be done using another OS to install nextcloud where it is more supported. I don't want to run two operating systems but I feel we are left no choice if we want the latest version and not to spend 100+ hours in setup and trouble (shooting).
 
Last edited by a moderator:

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504

dureal99d

Contributor
Joined
Aug 3, 2017
Messages
156
While I did get it running, I wouldn't say it was working 100%. I could never get the ssl portion working right. There is no current version guide that walks you through start to finish. My next attempt will likely be done using another OS to install nextcloud where it is more supported. I don't want to run two operating systems but I feel we are left no choice if we want the latest version and not to spend 100+ hours in setup and trouble (shooting).
I assure you the version 13 tutorial works with ssl and all as i just used this guide last night to set mine up.
 

cunningorb

Explorer
Joined
Feb 5, 2018
Messages
58
Not even this one? It certainly looks both complete and current.
That guide is the one I've used from January until now. It is by far the best and most complete. I am very grateful that it exists and I got farther than I imagined possible. The issue is that there are still parts of that guide which do not work for me and when it doesn't work I don't have enough FreeBSD knowledge to fall back on and fix the issue. If you read the comments below the guide, many of the issues mentioned are the same which I encounter. While the fixes someone work, they are not one size fits all I've found and so eventually I get stuck.
I believe my issue is related to my own knowledge level and so I'm not saying the guide is a cause for my specific issues. It's just that installing nextcloud on FreeNAS is a high difficulty level, not for a noob like me.
 
Last edited by a moderator:

cunningorb

Explorer
Joined
Feb 5, 2018
Messages
58
I assure you the version 13 tutorial works with ssl and all as i just used this guide last night to set mine up.
I will try it one more time on FreeNAS because I really am grateful for all the work you did on the guide. I bought new hardware recently which may help my effort. This attempt may be delayed because I am running a full schedule right now.
 
Last edited by a moderator:

dureal99d

Contributor
Joined
Aug 3, 2017
Messages
156
That guide is the one I've used from January until now. It is by far the best and most complete. I am very grateful that it exists and I got farther than I imagined possible. The issue is that there are still parts of that guide which do not work for me and when it doesn't work I don't have enough freeBSD knowledge to fall back on and fix the issue. If you read the comments below the guide, many of the issues mentioned are the same which I encounter. While the fixes someone work, they are not one size fits all I've found and so eventually I get stuck.
I believe my issue is related to my own knowledge level and so I'm not saying the guide is a cause for my specific issues. It's just that installing nextcloud on freenas is a high difficulty level, not for a noob like me.
no worries, see your P.M.
 

dureal99d

Contributor
Joined
Aug 3, 2017
Messages
156
I will try it one more time on freenas because I really am grateful for all the work you did on the guide. I bought new hardware recently which may help my effort. This attempt may be delayed because I am running a full schedule right now.
See your inbox and let me know what time!!!!!!!!
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
That guide is the one I've used from January until now.
It can't be; it wasn't posted until the end of February.
It's just that installing nextcloud on freenas is a high difficulty level, not for a noob like me.
I think it's more accurate to say that installing Nextcloud at all is complex, and there are a number of moving pieces--you need a web server, a database, file storage, potentially a TLS certificate, and there are lots of options for all of those. And when you're doing it in a jail, you're starting from square one and have to install and configure everything. The systems that make it easy have one (or both) of two characteristics: (1) they start with most of the big pieces installed, and/or (2) they make a lot of assumptions which may or may not be appropriate for your use case.

Edit: It'd be really nice if someone could put together a script to do all the work, as @kjake has done with (for example) unifi. But I think there's enough complexity in a Nextcloud installation that this wouldn't be so practical.
 
Last edited:

cunningorb

Explorer
Joined
Feb 5, 2018
Messages
58
If we had a script with form input for the things that are specific to each individual setup that would be heavenly. I realize though that creating that and maintaining it is essentially the opposite of the spirit of FreeNAS. People who need scripts (like me) tend to use Windows products because you run an exe and you're done. The whole reason we would want FreeNAS to run nextcloud is to break free from that closed ecosystem.

Anyway, more to the topic I may have time today to try the version 13 guide. It was created based on some additional posts that had been in the guide which I did try. I'll tell everyone how it goes.
 
Last edited by a moderator:

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
I realize though that creating that and maintaining it is essentially the opposite of the spirit of FreeNAS.
OTOH, FreeNAS has plugins, and that's kind of the same thing. But in this case, to do it right, I think it'd be a good bit more complicated than the Unifi jail setup. Installing all the relevant packages is easy enough, and can be done at the time of the jail's creation, but the tricky bit is generating a sensible configuration for all the relevant pieces. You'd need to generate configs for Apache, PHP, MySQL/MariaDB, Nextcloud, Redis, and probably a few other things I haven't thought of. Some of those could just be things where you'd drop in a pre-written config file, but I don't think that'd be true of everything.
 
Last edited by a moderator:

cunningorb

Explorer
Joined
Feb 5, 2018
Messages
58
OTOH, FreeNAS has plugins, and that's kind of the same thing. But in this case, to do it right, I think it'd be a good bit more complicated than the Unifi jail setup. Installing all the relevant packages is easy enough, and can be done at the time of the jail's creation, but the tricky bit is generating a sensible configuration for all the relevant pieces. You'd need to generate configs for Apache, PHP, MySQL/MariaDB, Nextcloud, Redis, and probably a few other things I haven't thought of. Some of those could just be things where you'd drop in a pre-written config file, but I don't think that'd be true of everything.
Much agreed.

I went through the installation as written in the new guide. I did not encounter any errors until attempting to enforce https redirect at which point I now only get http 500 error access denied or ssl error depending on which protocol I try to use.

My domain is not using a subdomain. The A record points to my public IP. In my router port forwarding is forwarding all port 443 and port 80 traffic to my jail's ip address.

I also can't access nextcloud from the jail's IP address and this stops working once I do the secure section of the tutorial. Prior to that I am able to access nextcloud and the setup goes fine.

Edit: here's the error I get when I try to recert with certbot
Failed authorization procedure. mydomain.com (http-01): urn:acme:error:unauthorized :: The client lacks sufficient authorization
Invalid response from
http://mydomain.com/.well-known/acme-challenge/6uDkFZXUN51afr0AJJ6R17ilNSA3r1daDyETX3vVJKI:
"<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p"
 
Last edited:

blue_ice

Dabbler
Joined
Mar 24, 2018
Messages
15
Hi,

I'm trying to install nextcloud in a jail, I've read all manuals and tried everything, so far I can't past Mariadb install, I've got fdatasync error.
Please can somebody explain me how to install MariaDb flawlessly?

FreeNAS-11.1-U4
Mariadb 10.2

Thanks
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504

Harbicool

Dabbler
Joined
May 24, 2018
Messages
10
Hello Guys

I hope you can help me as I'm unable to overcome this issue with MariaDB, I was follow the first link guide and after trying for several time to run the wizard script with below command in order to log into MariaDB but I'm getting error ERROR 2002 (HY000).

Command:
root@nextcloud:~ # mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2 "No such file or directory")
Enter current password for root (enter for none):
 

dureal99d

Contributor
Joined
Aug 3, 2017
Messages
156
Hello Guys

I hope you can help me as I'm unable to overcome this issue with MariaDB, I was follow the first link guide and after trying for several time to run the wizard script with below command in order to log into MariaDB but I'm getting error ERROR 2002 (HY000).

Command:
root@nextcloud:~ # mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2 "No such file or directory")
Enter current password for root (enter for none):
What type of jail are you using? if you are using warden this is your issue. I suggest you use iocage.
 

Harbicool

Dabbler
Joined
May 24, 2018
Messages
10
What type of jail are you using? if you are using warden this is your issue. I suggest you use iocage.
Thanks Dureal99d

I'll try that now but i was wondering how can I add storage to the same jail as you mentioned in your guide while using iocage since it's working with command only

Add Storage to the same jail you just created

Jail: nextcloud

Code:
Source = /mnt/Cloud/files
Destination = /mnt/files

Jail: nextcloud
Code:
Source = /mnt/Cloud/db
Destination = /var/db/mysql
 
Status
Not open for further replies.
Top