Can not get HTTPS to work since I changed my IP

Nextcloud 11.0.1 (stable)
Ubuntu 16.04.03LTS
Apache/2.4.18 (Ubuntu)
PHP 7.0.22-0ubuntu0.16.04.1

The issue you are facing:

Over the weekend I had to change my IP address scheme from 192.168.211.x to 192.168.11.x

I have already went into the config.php file and updated it to the latest IP address. But I can not get HTTPS to work.

When I go i get “site can not be reached” but when I do HTTP i can get in just fine.

I also tried running the following

user@nextcloud:~$ sudo nextcloud.enable-https lets-encrypt

got the following error.

sudo: nextcloud.enable-https: command not found

I am not sure what else to do.

Is this the first time you’ve seen this error? (Y/N):y

The output of your Nextcloud log in Admin > Logging:


Fatal	webdav	Sabre\DAV\Exception\BadRequest: HTTP/1.1 400 expected filesize 1024000 got 176128
/var/www/html/nextcloud/apps/dav/lib/Connector/Sabre/File.php - line 104: OCA\DAV\Connector\Sabre\File->createFileChunked(Resource id #68)
/var/www/html/nextcloud/apps/dav/lib/Connector/Sabre/Directory.php - line 137: OCA\DAV\Connector\Sabre\File->put(Resource id #68)
/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 1072: OCA\DAV\Connector\Sabre\Directory->createFile('20171204_122217...', Resource id #68)
/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php - line 525: Sabre\DAV\Server->createFile('InstantUpload/C...', Resource id #68, NULL)
[internal function] Sabre\DAV\CorePlugin->httpPut(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
/var/www/html/nextcloud/3rdparty/sabre/event/lib/EventEmitterTrait.php - line 105: call_user_func_array(Array, Array)
/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 479: Sabre\Event\EventEmitter->emit('method PUT', Array)
/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 254: Sabre\DAV\Server->invokeMethod(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
/var/www/html/nextcloud/apps/dav/appinfo/v1/webdav.php - line 60: Sabre\DAV\Server->exec()
/var/www/html/nextcloud/remote.php - line 165: require_once('/var/www/html/n...')
{main}

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'instanceid' => 'ocu6oy39v6e8',
  'passwordsalt' => 'gKu18lAsvHhlLKPE7rV/Trr9tDUM+M',
  'secret' => 'MD8sBlZKvYChbkG5duDcWY3NRcstdw/iUduJDOLzUhI23Urp',
  'trusted_domains' => 
  array (
    0 => '192.168.11.227',
  ),
  'datadirectory' => '/mnt/datastore_network',
  'overwrite.cli.url' => 'http://192.168.11.227/nextcloud',
  'dbtype' => 'mysql',
  'version' => '11.0.1.2',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'nextclouduser',
  'dbpassword' => 'nextcloud123',
  'logtimezone' => 'UTC',
  'installed' => true,
);


The output of your Apache/nginx/system log in /var/log/error.log:

[Mon Feb 19 06:25:02.121538 2018] [mpm_prefork:notice] [pid 1006] AH00163: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Mon Feb 19 06:25:02.121574 2018] [core:notice] [pid 1006] AH00094: Command line: '/usr/sbin/apache2'
[Mon Feb 19 13:29:18.382358 2018] [mpm_prefork:notice] [pid 1027] AH00163: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Mon Feb 19 13:29:18.384677 2018] [core:notice] [pid 1027] AH00094: Command line: '/usr/sbin/apache2'
[Mon Feb 19 13:30:48.036871 2018] [mpm_prefork:notice] [pid 1027] AH00169: caught SIGTERM, shutting down
[Mon Feb 19 13:31:06.729858 2018] [mpm_prefork:notice] [pid 899] AH00163: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Mon Feb 19 13:31:06.742649 2018] [core:notice] [pid 899] AH00094: Command line: '/usr/sbin/apache2'
[Mon Feb 19 13:58:47.326330 2018] [:error] [pid 993] [client 192.168.11.226:37713] script '/var/www/html/status.php' not found or unable to stat
[Mon Feb 19 13:58:54.964039 2018] [:error] [pid 994] [client 192.168.11.226:46763] script '/var/www/html/status.php' not found or unable to stat
[Mon Feb 19 14:01:35.869463 2018] [:error] [pid 997] [client 192.168.11.226:55452] script '/var/www/html/status.php' not found or unable to stat
[Mon Feb 19 14:01:38.686746 2018] [:error] [pid 997] [client 192.168.11.226:55452] script '/var/www/html/status.php' not found or unable to stat
[Mon Feb 19 14:01:39.116991 2018] [:error] [pid 997] [client 192.168.11.226:55452] script '/var/www/html/status.php' not found or unable to stat
[Mon Feb 19 14:01:39.255813 2018] [:error] [pid 997] [client 192.168.11.226:55452] script '/var/www/html/status.php' not found or unable to stat
[Mon Feb 19 14:01:39.397822 2018] [:error] [pid 997] [client 192.168.11.226:55452] script '/var/www/html/status.php' not found or unable to stat
[Mon Feb 19 14:01:39.551103 2018] [:error] [pid 997] [client 192.168.11.226:55452] script '/var/www/html/status.php' not found or unable to stat
[Mon Feb 19 14:01:39.676507 2018] [:error] [pid 997] [client 192.168.11.226:55452] script '/var/www/html/status.php' not found or unable to stat
[Mon Feb 19 14:14:38.882264 2018] [mpm_prefork:notice] [pid 899] AH00169: caught SIGTERM, shutting down
[Mon Feb 19 14:14:59.251570 2018] [mpm_prefork:notice] [pid 903] AH00163: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Mon Feb 19 14:14:59.255747 2018] [core:notice] [pid 903] AH00094: Command line: '/usr/sbin/apache2'

i have also opened the ports on the FW on my ubuntu box.

Try to change http to https. Otherwise you will always land on http.
Do you only connect over local network (lan)?
If no: Are you portforwarding to the ip in the firewall? The port there isn´t 80. It´s 443 :slight_smile:

yes i only connect over local lan, and I made the change to the config and it does not work. but if I try http it does work.

https and ip have nothing related.

Clean your browser cache. The HSTS might be causing that. The CA store in your browser need a good clean.

Did that. I even did a powerwash on my Chromebook a till can not get the https:

Could it be a stopped service?

Please check with apache2ctl -M if the module ssl is loaded by apache. :wink:
Is https working outside of the nextcloud folder?

harold@nextcloud:~$ apache2ctl -M
AH00558: apache2: Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1. Set the ‘ServerName’ directive globally to suppress this message
Loaded Modules:
core_module (static)
so_module (static)
watchdog_module (static)
http_module (static)
log_config_module (static)
logio_module (static)
version_module (static)
unixd_module (static)
access_compat_module (shared)
alias_module (shared)
auth_basic_module (shared)
authn_core_module (shared)
authn_file_module (shared)
authz_core_module (shared)
authz_host_module (shared)
authz_user_module (shared)
autoindex_module (shared)
deflate_module (shared)
dir_module (shared)
env_module (shared)
filter_module (shared)
mime_module (shared)
mpm_prefork_module (shared)
negotiation_module (shared)
php7_module (shared)
rewrite_module (shared)
setenvif_module (shared)
status_module (shared)
harold@nextcloud:~$

Check https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html#enabling-ssl

Maybe your solution is that:
a2enmod ssl
a2ensite default-ssl
service apache2 reload

Edit: I compared your list now with mine and you need to enable ssl module.

Look at this reduced list:
env_module (shared)
filter_module (shared)
headers_module (shared)
http2_module (shared)
mime_module (shared)
mpm_prefork_module (shared)
negotiation_module (shared)
php7_module (shared)
proxy_module (shared)
proxy_fcgi_module (shared)
reqtimeout_module (shared)
rewrite_module (shared)
setenvif_module (shared)
socache_shmcb_module (shared)
ssl_module (shared)
status_module (shared)

check your apache (v)host-configs and on which socket apache is configured to listen.
Did you issue a cert to an IP-address? In this case you’ll probably have to re-issue.
GOOD LUCK!