NCP upgrade to NC21.0.4 and now NC is not accessible on it's alternate port

I upgraded NCP to 1.39.6 and then upgraded to NC21.0.4. I’ve been using port 8080 for NC and now it’s not accessible on that port. NCP still works fine but to access Nextcloud on port 8080 again I need to manually change it in /etc/apache2/sites-enabled/nextcloud.conf (possibly the wrong conf file, it’s been so long since I changed the port I don’t remember where I originally reconfigured it). If I run letsencrypt, the port reverts back to 443. Today I upgraded to 1.39.7 and ran letsencrypt again with the same result.

Maybe the solution provided here:

will also help you.

I agree, I’ve been watching all the threads on the 1.39.6 issues, but I’m a bit skittish as I have the added wrinkle of using an alternative port. If the results of applying that fix can be of any use to @nachoparker then I’ll be happy to try it.

LE doesn’t work with other ports than 80 and 443. Running it will restore things to default ports as you discovered, so if you want to use alternate ports you’ll want to disable LE, and use an alternate LE method, like the DNS challenge.

The method we use automatically in NCP requires 80 and 443, no way around that.

Strange, I’ve had NC listening on port 8080 for years and I’ve been running LE for several months now with no issues. The problems only started after the recent upgrade.

Edit: I do have my NCP instance behind a NAT firewall and I have port 443 on the firewall forwarded to port 8080 on NCP (in addition to a regular forward of port 80 to NCP). This has allowed me to renew my certificates with no issues. Is the forcing of the NC port back to 443 by LE a recent change?

yes, we made the apache config generation more sophisticated, so now it gets regenerated every time. With some development effort we could take into account the current ports, but not currently under the radar

1 Like

Thanks for letting me know. I’ll figure something out.