Resource icon

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

Antoine1

Cadet
Joined
Apr 19, 2017
Messages
9
Hello,

First of all, thanks for this great script which makes life easy for me and for a lot of us I'm pretty sure.

I would need a bit of help in order to fix an issue with which I am stucked for few days now...

I was previously able to install and run Nextcloud thanks to the script but I change my router few days ago and had no more access to Nextcloud.
I decided to start for scratch so I deleted the jail, and run the script in order to re-install it.

My router is behind my internet box.
DMZ from my internet box to my Asus Router
Redirection of port 80 and 443 from outside to the same port on the local IP of my Nextcloud
I am on Freenas 11.2-U5 and here is the config file:

JAIL_IP="192.168.0.145"
DEFAULT_GW_IP="192.168.0.1"
INTERFACE="vnet0"
POOL_PATH="/mnt/Storage/iocage/jails/nextcloud"
FILES_PATH="/mnt/Storage/Nextcloud/files"
JAIL_NAME="nextcloud"
TIME_ZONE="Europe/Paris" # See http://php.net/manual/en/timezones.php
HOST_NAME="*******.*****.**"
STANDALONE_CERT=1
SELFSIGNED_CERT=0
CERT_EMAIL=********@****.***

Installation is going fine, no warning message but at the end, I am not able to access to Nextcloud from inside:
http://192.168.0.145:80 >> ends up on Freenas login page
https://192.168.0.145:443 >> ends up on this:
1566023616143.png


So no success to access to the Admin page of Nextcloud internally.

Strange this is that if I try with my cell phone over GSM network, through my NoIP hostname using https://*******.*****.**:443 it works...

If any of you has an idea of what's going on and how to solve that would be very much appreciated.

Thanks in advance,

Regards,
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
If any of you has an idea of what's going on and how to solve that would be very much appreciated.
Kind of a strange result you're seeing--what happens if you try to reach it from your LAN using the hostname? I assume that 0.145 is a unique address for the jail? It isn't the same address you're using for your FreeNAS machine?
 

Antoine1

Cadet
Joined
Apr 19, 2017
Messages
9
Hi,

Thanks for taking in account my issue.

From my laptop or another computer I have I can't access through domain name or IP.
What is strange, is that I can access trhough GSM network or even from my wifi using the nextcloud app on my Android phone using the domain name...

The Nas is on 0.142 and the nextcloud jail on 0.145

I tried a dozen of time to reinstall the jail, with different settings and result is the same.
 

Antoine1

Cadet
Joined
Apr 19, 2017
Messages
9
Sorry, didn't found how to edit my previous post.

For info, I have no issue with the Plex jail (0.143) and Deluge jail (0.144)
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
From my laptop or another computer I have I can't access through domain name or IP.
What happens when you try to reach the jail by the domain name?
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
The failure when browsing via IP address is expected--Caddy is looking to serve a site for your FQDN, not for your IP address. But the failure via the hostname is not expected. From your client computer, what do you get if you run host or nslookup to look up the IP address of the hostname you gave the jail? For best results, it should return 192.168.0.145.
 

Antoine1

Cadet
Joined
Apr 19, 2017
Messages
9
When I run nslookup on
  1. the domain name it returns 192.168.0.1 which is the IP address of my router and the external IP of my internet box
  2. 192.168.0.145 it returns 192.168.0.1 which is the IP address of my router and then the jail on 192.168.0.145
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
the domain name it returns 192.168.0.1 which is the IP address of my router and the external IP of my internet box
I'm afraid that doesn't make much sense to me. So here's what the output of nslookup looks like under Windows:
1566066564164.png

Are you saying that the second "Address:" line reflects your external IP address? If so, that's probably your problem--the FQDN you're using for the Nextcloud installation really should resolve to the IP address of that jail, when you're on your LAN. The best way for that to happen is for your router to serve that address (consult the documentation for your router to see if this is possible, and if so how to do it). If that isn't possible, you may need to edit your hosts file to make this work.
 

Antoine1

Cadet
Joined
Apr 19, 2017
Messages
9
Could you explain what has to be done to edit the hosts file?

I've looked into all router settings and don't see which settings is incorrect.

Many thanks in advance,

Regards
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Could you explain what has to be done to edit the hosts file?
I don't use Windows, so I couldn't say exactly--but I'm sure Google has an answer.
 

Antoine1

Cadet
Joined
Apr 19, 2017
Messages
9
Thanks very much, I did edit the hosts file and now it works.

Don't know exactly which other colateral impact it can have but it definitely works.

Thanks a lot for your support and again for your work!

Regards,
 

Pancackewaffle

Dabbler
Joined
Aug 19, 2017
Messages
41
I guess I was posting on the wrong thread before so I'll go over everything.

I have had some issues with installation; I wasn't interested in a verified certificate so I did self signed, installed multiple times with different host names and IP addresses but every time, accessing the web GUI would be the same as Antoine1 (no access). The IP via HTTP or HTTPS would end with the interface is not supported or a secure connection could not be established.
I then made the jail DHCP so that my router had the proper information in its tables, edited my DNS on my computer to reflect the routers IP, and tried the hostname in my browser. Same thing!
I was getting pretty pissed now and didn't want to edit my hosts file but that's what I ended up doing. I could now ping the jail by hostname but I STILL COULDNT GET TO THE WEB GUI!

I really didn't want to open the public ports of 80 and 443 but I did; reinstalled the jail again with the STANDALONE_CERT option with my hostname being my name via NoIP. And then it would frickin work. Although I am pretty positive that I cannot access it locally, only via my public domain.

I'm wondering that when you do a self signed certificate, it would potentially depend on a certificate authority? I have my FreeNAS setup with a self signed certificate and it is also the certificate authority; no issues there.

Regardless, the STANDALONE_CERT option worked like a charm. I appreciate your work very much DanB as this has been a project I've been working on for like 2 years now and have not been happy with it, until now.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
I'm wondering that when you do a self signed certificate, it would potentially depend on a certificate authority?
No, the self-signed cert is generated completely locally, uses no outside CA or other resources, and it's working fine for many people (including myself) without the jail being open to the outside world in any way. But unfortunately, "it doesn't work" doesn't help me at all in figuring out what's going on.
 

bermau

Dabbler
Joined
Jul 4, 2017
Messages
28
Hi everyone,
I would like to install the script without ssl certificate, because in my box freenas I have a jail with reverse proxy (for now, working only with transmission), with active https protocol.
Therefore, I would like to install nextcloud and direct the reverse proxy to the nextcloud jail. For a few days I played with the Freenas Nextcloud plugin, but I'm not satisfied, too many errors.
Does anyone have experience with this script behind nginx reverse proxy? is it sufficient to modify the script in "NO_CERT = 1"?
thanks to those who can help me.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
is it sufficient to modify the script in "NO_CERT = 1"?
Setting NO_CERT=1 in the config file will have Nextcloud running on HTTP. Any further configuration would be on the proxy system, of course.
 
Top