Resource icon

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

Platter7

Dabbler
Joined
Sep 22, 2018
Messages
35
I still get a 522 error from Cloudflare. Even after I portforwarded ports 80 and 443 to my JAIL_IP in pfsense.
entering from the LAN:
Code:
404 Site 192.168.30.67 is not served on this interface


we are not quite there yet :)
 
Last edited:

Apollo

Wizard
Joined
Jun 13, 2013
Messages
1,449
@Apollo: did you get Nextcloud to work with the combination of HAProxy - Pfsense when you used the standard Nexcloud-plugin ? I also use pfsense since I am totally stuck with the script I am now looking at HAproxy as alternative to configure a setup with a reversed proxy setup...
@Platter7, I am using Haproxy on pfsense to serve wildcard and non wildcard domains. I think I had it working with the plugin just to play around.
I am currently using the NC script when it was still based on Apache24. I have not been able to use haproxy with Caddy at this point. It seems to be an issue with Haproxy as it is not https2 capable yet.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,456
404 Site 192.168.30.67 is not served on this interface
This is expected; Caddy isn't configured to serve the site via its IP address. You need to use the hostname, which means that the hostname needs to resolve to the jail's IP address on your LAN. This is ideally something you'd configure on your router, if it has the necessary capabilities. Otherwise, you can edit the hosts file on your client computer.
 

Platter7

Dabbler
Joined
Sep 22, 2018
Messages
35
This is expected; Caddy isn't configured to serve the site via its IP address. You need to use the hostname, which means that the hostname needs to resolve to the jail's IP address on your LAN. This is ideally something you'd configure on your router, if it has the necessary capabilities. Otherwise, you can edit the hosts file on your client computer.

I tried the host-file-method first, I found this on the Nextcloud website to be very helpful:

On Windows go to C:\Windows\System32\drivers\etc and open the hosts file in a text editor.
Add the IP and domain name like this:

192.168.0.33 your.domain.com

This will make your computer directly connect via LAN and HTTPS will still work and also there will be no error messages about trusted domains.

After editing the hostfile (open it as administrator) I was finally able to acces the Nextcloud server from the LAN with the domain name!

So I guess there is some work to do in my pfsense-router. I will start with the acces from LAN. The dns-resolver in pfsense should be the answere to that… although still strugling with it.
 
Last edited:

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,456
The dns-resolver in pfsense should be the answere to that
It is--you'd set this as a host override in the DNS resolver configuration. You'll need to take it out of the hosts file to make sure it's working, of course.
 

leonbusch

Cadet
Joined
Oct 24, 2019
Messages
8
Hey!
My Nextcloud is now up and running. Even from my PC inside the local network after adding the domain to the hosts-file.
But there is another issue:
I want to sync my photos to Nextcloud from my iPhone also in the local network. I can access it from an external Wifi or mobile Data. I am certain it is a certificates issue. Is it possible to have a certificate for both the domain and the IP? Like one self-signed and one standalone? If yes; how could I do it?
Unfortunately there seems to be no way to edit some kind of hosts file in the iPhone if it is not jailbroken.
I think there is nothing like a host-override option for my router.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,456
I think there is nothing like a host-override option for my router.
That's the way to do it if you can.
Is it possible to have a certificate for both the domain and the IP?
Yes, but not from Let's Encrypt. And really, this installation is designed to only work with the hostname; Caddy doesn't serve the site over the bare IP address.
 

Semmel

Dabbler
Joined
Dec 6, 2019
Messages
14
when i download the repository and open the config file it shows up empty.. is this correct?
 

Semmel

Dabbler
Joined
Dec 6, 2019
Messages
14
OK, above was a stupid question.. :D

I got everything installed now, but when i try to acces Nextcloud i get a Cloudflare 521 Error...
I have the ports 80 and 443 forwarded in my router.. I am trying to acces the config.php file, but for some reason this is not working..
 

Semmel

Dabbler
Joined
Dec 6, 2019
Messages
14
2019/12/08 18:33:47 [INFO] Caddy version: v1.0.4
2019/12/08 18:33:47 /usr/local/www/Caddyfile:9 - Error during parsing: Setting up DNS provider 'cloudflare': cloudflare: some credentials information are missing: CLOUDFLARE_EMAIL or some credentials information are missing: CLOUDFLARE_DNS_API_TOKEN,CLOUDFLARE_ZONE_API_TOKEN
2019/12/08 18:38:21 [INFO] Caddy version: v1.0.4
2019/12/08 18:38:21 [INFO][cache:0xc0001c2320] Started certificate maintenance routine
2019/12/08 18:38:21 /usr/local/www/Caddyfile:9 - Error during parsing: Setting up DNS provider 'cloudflare': cloudflare: some credentials information are missing: CLOUDFLARE_EMAIL or some credentials information are missing: CLOUDFLARE_DNS_API_TOKEN,CLOUDFLARE_ZONE_API_TOKEN
2019/12/08 20:04:29 [INFO] Caddy version: v1.0.4
2019/12/08 20:04:29 [INFO][cache:0xc0001c0320] Started certificate maintenance routine
2019/12/08 20:04:29 /usr/local/www/Caddyfile:9 - Error during parsing: Setting up DNS provider 'cloudflare': cloudflare: some credentials information are missing: CLOUDFLARE_EMAIL or some credentials information are missing: CLOUDFLARE_DNS_API_TOKEN,CLOUDFLARE_ZONE_API_TOKEN
2019/12/08 20:10:19 [INFO] Caddy version: v1.0.4
2019/12/08 20:10:19 /usr/local/www/Caddyfile:9 - Error during parsing: Setting up DNS provider 'cloudflare': cloudflare: some credentials information are missing: CLOUDFLARE_EMAIL or some credentials information are missing: CLOUDFLARE_DNS_API_TOKEN,CLOUDFLARE_ZONE_API_TOKEN
2019/12/08 20:16:40 [INFO] Caddy version: v1.0.4
2019/12/08 20:16:40 /usr/local/www/Caddyfile:8 - Error during parsing: Unknown directive 'ca'
2019/12/08 20:17:58 [INFO] Caddy version: v1.0.4
2019/12/08 20:17:58 /usr/local/www/Caddyfile:8 - Error during parsing: Unknown directive 'ca'
2019/12/08 20:18:48 [INFO] Caddy version: v1.0.4
2019/12/08 20:18:48 /usr/local/www/Caddyfile:8 - Error during parsing: Unknown directive 'ca'
2019/12/08 20:29:15 [INFO] Caddy version: v1.0.4
2019/12/08 20:29:15 /usr/local/www/Caddyfile:8 - Error during parsing: Unknown directive 'ca'
2019/12/08 20:36:34 [INFO] Caddy version: v1.0.4
2019/12/08 20:36:34 /usr/local/www/Caddyfile:8 - Error during parsing: Unknown directive 'ca'
2019/12/08 20:40:39 [INFO] Caddy version: v1.0.4
2019/12/08 20:40:39 /usr/local/www/Caddyfile:8 - Error during parsing: Unknown directive 'ca'
2019/12/08 20:40:47 [INFO] Caddy version: v1.0.4
2019/12/08 20:40:47 /usr/local/www/Caddyfile:8 - Error during parsing: Unknown directive 'ca'
2019/12/08 21:15:27 [INFO] Caddy version: v1.0.4
2019/12/08 21:15:27 /usr/local/www/Caddyfile:8 - Error during parsing: Unknown directive 'ca'
2019/12/08 21:16:11 [INFO] Caddy version: v1.0.4
2019/12/08 21:16:11 /usr/local/www/Caddyfile:8 - Error during parsing: Unknown directive 'ca'
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,456
some credentials information are missing: CLOUDFLARE_EMAIL or some credentials information are missing: CLOUDFLARE_DNS_API_TOKEN,CLOUDFLARE_ZONE_API_TOKEN
This is your problem. That information should be in /etc/rc.conf--what are the contents of the lines for caddy_cert_email and caddy_env lines, in code tags (masking the actual API keys)?
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,456
when i made the config file the CL mail and key where in 1 line
Are they on two lines in the rc.conf file? If so, that's your problem--fix it so they're on a single line, then run service caddy restart.
 

Semmel

Dabbler
Joined
Dec 6, 2019
Messages
14
so caddy is working, but i am still not able to reach it.
error.png
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,456
so caddy is working
Are you sure? What's the output of service caddy status? And can you reach the installation on your LAN?
 

Semmel

Dabbler
Joined
Dec 6, 2019
Messages
14
Where can I delete posts? Hehe. That means it's not running no... Tired, been a long day.. I haven't been able to reach it through the Lan either.
 

Semmel

Dabbler
Joined
Dec 6, 2019
Messages
14
2019/12/09 00:12:30 /usr/local/www/Caddyfile:8 - Error during parsing: Unknown directive 'ca'
 
Top