How to install NextCloud 12.3 on FreeNAS 11 with all checks passed

jasemo

Dabbler
Joined
Mar 15, 2018
Messages
30
Thanks for that, but I'm getting an error when I try:

* Starting Nextcloud
+ Start FAILED
ifconfig: interface msk0 does not exist
jail: /sbin/ifconfig msk0 inet 192.168.100.134/24 alias: failed

I'm guessing that's because the ip address (192.168.100.134) that I entered for my FreeNAS box with the iocage create command changed when I soon after fixed some settings in my router.

How do I go about changing the ip saved to the current one in the iocage jail?

Thanks again...
 

spetke

Cadet
Joined
Mar 25, 2015
Messages
5
Yea.. I also had to change the interface name when creating the jail. My ethernet cards are called em0 and em1 instead of msk0 so adjust your iocage create command accordingly.

You can delete the faulty jail with iocage destroy.
 

jasemo

Dabbler
Joined
Mar 15, 2018
Messages
30
Sorry for clogging up the thread, but thank you spetke - that was awesome.

Not only did the ip address need fixing but you picking up on the ethernet card name (mine's totally different again) save me hours of hair-pulling.
 

jasemo

Dabbler
Joined
Mar 15, 2018
Messages
30
Hopefully my last question:

A bit of my problem is that dureal99d's instruction:

Code:
iocage create -n xxxx ip4_addr="msk0|192.168.x.xxx/24" -r 11.1-RELEASE

where the XXX's are after the -n is your jail name for the IP is emo or whatever you nic is called (you can see this in the freenas gui under network settings) the xxx in the IP is your IP address.

Is a little hard to parse for a beginner.

Is the IP address you need to finish here the one your FreeNAS box is has? Or is it meant to be a unique one just for the Nextcloud jail? If so how do you know what to enter? Is it arbitrary? And will my router which is acting as a DHCP server care?

Thanks again.
 

spetke

Cadet
Joined
Mar 25, 2015
Messages
5
The IP should be unique for the jail and has to be in your lan address space and not part of your dhcp-scope.
 

jasemo

Dabbler
Joined
Mar 15, 2018
Messages
30
Thanks spetke. Your help has been great, but if that's the case, I think I'm out.

I'll keep an eye on the forums & see if a less complex or more clear guide comes up in future.

Thanks again for the help.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
if that's the case, I think I'm out.
Why's that? There are three requirements stated there--you need to choose an IP address that:
  • Is unique--it hasn't been assigned to anything else on your network
  • Is in your network--if everything on your network is 192.168.1.xxx, don't assign this 192.168.100.xxx
  • Is outside of the DHCP range of your router/DHCP server. Typically those are configured to serve only a portion of the address space in your network. So, if your network is 192.168.1.0/24 (which would cover .1.1 to .1.254), your DHCP server might cover only .1.100 to .1.250. You'd then want to assign an address outside of that range--below .1.100 or above .1.250. You can find this range in your router's setup pages.
 

jasemo

Dabbler
Joined
Mar 15, 2018
Messages
30
danb35 - thanks for the explanation, I'll give it a go.

I've just never got on with IP & DNS in my router and I'm wary of clogging the thread up with noob questions. So the prospect of going further and possibly running into later errors without knowing if I'd messed this bit up was a little unappealing.

Cheers for the advice.
 

jasemo

Dabbler
Joined
Mar 15, 2018
Messages
30
Okay, I've got a bit further but am now stuck at:

Touch file: (I used a cloud.* subdomain, if you're not using a sub, remove the 'cloud.')

$ touch YOURDOMAIN.com or org or gov.conf

$ nano YOURDOMAIN*

make your secure file in this format (simply copy and paste):
Be sure to edit the YOURSITE.COM part of the below file with your domain info
(Example) if your domain is "tocool.no-IP.org" enter that and the domain name matches your touch file name.

I don't know what any of this means. - When I set up Nextcloud on my Thecus NAS a couple of years ago, I didn't need a YOURDOMAIN or YOURSITE. I just gave the client an IP to connect to the server.
What is this bit about?
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
If you want to get a trusted certificate for your installation to do HTTPS, you'll need a public domain name. If not, you don't need that. In that case, you could just call the file nextcloud.conf.
 

Muzzy

Cadet
Joined
Mar 22, 2017
Messages
9
After this step, i don't see nextcloud after opening http://myip in browser, but when i open http://myip/nextcloud.
Please, where is the mistake?

Add virtual Host info :
Navigate to: /usr/local/etc/apache24/Includes
Code:
cd /usr/local/etc/apache24/Includes

Touch file: (I used a cloud.* subdomain, if you're not using a sub, remove the 'cloud.')

$ touch YOURDOMAIN.com or org or gov.conf

$ nano YOURDOMAIN*

make your secure file in this format (simply copy and paste):
Be sure to edit the YOURSITE.COM part of the below file with your domain info
(Example) if your domain is "tocool.no-IP.org" enter that and the domain name matches your touch file name.
Code:
<VirtualHost *:80>
DocumentRoot "/usr/local/www/apache24/data/nextcloud"
ServerName YOURSITE.com
RewriteEngine on
RewriteCond %{SERVER_NAME} =YOURSITE.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,QSA,R=permanent]
#ErrorLog ${APACHE_LOG_DIR}/error.log
#CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory /usr/local/www/apache24/data/nextcloud/>
Options +FollowSymlinks
AllowOverride All
<IfModule mod_dav.c>
Dav off
</IfModule>
SetEnv HOME /usr/local/www/apache24/data/nextcloud
SetEnv HTTP_HOME /usr/local/www/apache24/data/nextcloud
Satisfy Any
</Directory>
</VirtualHost>

Restart Apache:
$ service apache24 restart
 

jasemo

Dabbler
Joined
Mar 15, 2018
Messages
30
Obviously I'm not going to be much help - but I just checked Muzzy's post and can second the fact that Nextcloud opens at http://myip/nextcloud and not http://myip. Though I'm not informed enough to know if that's not how its meant to be.

Spretke, copy/pasting the "redis" part has seemed to have gone all right for me. - Wish I could give back & help you out.

My question is about the section from "Add virtual host info :" - danb35 explained that it's about getting a trusted certificate. I'd like this as I was unable to work that out on my previous Nextcloud install and I would always have preferred to connect via https. Furthermore, I know its an aspect of Nextcloud a lot of other users - including some on these forums - have said they were stumped by. This would help them too.

So could anyone contextualize what this section is doing?

For example, what are the requirements of the public domain name? We're talking a "www.whatever.com" or ".com.xx", yeah? How is it used? Is it just a temporary tool? Or will it be linked with the Nextcloud install? - I have one, but it's not really related to my Nextcloud usage. Could this work?
 
Last edited:

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
I think I may have glanced over that virtual host info piece too quickly. Though I'm working on the script I mentioned in another thread that will hopefully automate 99% of the process.

As far as the domain name--the name of the file is really rather arbitrary, though it's a good practice for it to match the actual domain name you're using. In the contents of that file, though, the ServerName directives do need to match the FQDN that you're going to use to access the Nextcloud installation.

To get a cert from Let's Encrypt, you're going to need to own (or at least control) a domain, and that domain is going to need to be pointed at your Nextcloud installation.
 

cunningorb

Explorer
Joined
Feb 5, 2018
Messages
58
I think I may have glanced over that virtual host info piece too quickly. Though I'm working on the script I mentioned in another thread that will hopefully automate 99% of the process.

As far as the domain name--the name of the file is really rather arbitrary, though it's a good practice for it to match the actual domain name you're using. In the contents of that file, though, the ServerName directives do need to match the FQDN that you're going to use to access the Nextcloud installation.

To get a cert from Let's Encrypt, you're going to need to own (or at least control) a domain, and that domain is going to need to be pointed at your Nextcloud installation.
Are you implying that we can't really do this without a subdomain? My domain points to the server and I can load the apache data directory from my fqdn as well as public IP. I can't even load the nextcloud directory anymore once I got past the ssl portion of the nextcloud 13 guide. I have no idea why.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Are you implying that we can't really do this without a subdomain?
Domain vs. subdomain is really a fairly arbitrary distinction--it doesn't matter if the hostname is domain.tld, www.domain.tld, cloud.domain.tld, or whatever else. What does matter, both for purposes of obtaining a cert and of avoiding certificate errors, is that that hostname points to your Nextcloud jail, both from outside your LAN* and inside.

I appear to have the script mostly working; hopefully I'll have it up at github shortly. Edit: https://github.com/danb35/freenas-iocage-nextcloud

* Strictly speaking, "outside" isn't necessary if you use DNS validation to get your certificate, which is what I do most of the time--but that requires having a DNS host with a compatible API to be practical.
 
Last edited:

cunningorb

Explorer
Joined
Feb 5, 2018
Messages
58
Domain vs. subdomain is really a fairly arbitrary distinction--it doesn't matter if the hostname is domain.tld, www.domain.tld, cloud.domain.tld, or whatever else. What does matter, both for purposes of obtaining a cert and of avoiding certificate errors, is that that hostname points to your Nextcloud jail, both from outside your LAN* and inside.

I appear to have the script mostly working; hopefully I'll have it up at github shortly. Edit: https://github.com/danb35/freenas-iocage-nextcloud

* Strictly speaking, "outside" isn't necessary if you use DNS validation to get your certificate, which is what I do most of the time--but that requires having a DNS host with a compatible API to be practical.
I'll try testing this script.

Why don't you have a donate button somewhere? I understand giving back to a community, but forum rules don't exclude someone just giving you a gift out of good will. If you start your own thread for this I'll reply in there with my test results. I don't have a git account so I won't be able to comment on your repo.
 

danb35

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

Muzzy

Cadet
Joined
Mar 22, 2017
Messages
9
My nextcloud is mostly working. I can reach it via http over the internet.

How do I resolve the ssl issue I'm having or what troubleshooting must I try? I've rerun certbot command with no errors. Apache restart has no errors. The guide had me add a "Listen 443" below "Listen 80" which I've verified is there. I added all the text in httpd.conf and .htaccess that was suggested by the guide and made sure my domain was correctly spelled.

When attempting to access over https I just get "ERR_SSL_PROTOCOL_ERROR" in chrome. Also, the forced redirect from http to https is not working as I can still type the http and be sent to the http site.

Edit: cert test said this:
  • No secure protocols supported - if you get this message, but you know that the site supports SSL, wait until the cache expires on its own, then try again, making sure the hostname you enter uses the "www" prefix (e.g., "www.ssllabs.com", not just "ssllabs.com").

I have the same problem, can anyone help?
 

cunningorb

Explorer
Joined
Feb 5, 2018
Messages
58
I have the same problem, can anyone help?
Not yet, but why don't you give the script above a go? It does most of the work for you and it may help rule out whether you're having a network config issue or a freenas/nextcloud config issue. Note, you'll want to do this from a somewhat fresh slate so you'll need to remove any existing nextcloud iocage jails. From freenas userspace: iocage destroy -f nameofjail
 
Top