I have a new installation of NextCloud using the instructions from Marksei found at the URL below. Overall they are excellent instructions and I was basically up and running with an admin account in shortly thereafter, however, he only provides instructions on how to install Let-Encrypt and not actual live SSL certificates.
https://www.marksei.com/how-to-install-nextcloud-16-on-ubuntu/
In my previous snap
install of NextCloud installing the certs via the occ
command was easy. There are commands to like nextcloud.enable-https
to enable https and nextcloud.import
to upload your certs including your private key. These do not exist with the current NextCloud version 16. There is the occ security:certificates:import
command but it only works with the cert.pem
and chain.pem
file and it fails with the private key import.
root@nc:/var/www/nextcloud# occ security:certificates:import /home/admin/pem_files/privkey.pem
In Certificate.php line 63:
Certificate could not get parsed.
security:certificates:import \<path\>
root@nc:/var/www/nextcloud#
I would like to know what this command actually does to the nextcloud configuration. I think it updates the ../core/signature.json
file, but It’s not clear.
Since that didn’t work, I simply updated the nextcloud.conf
file managed by apache2 and added the certs there which works fine.
<VirtualHost *:443\>
ServerName cloud.mydomain.net
DocumentRoot /var/www/nextcloud
SSLCertificateFile /etc/apache2/certs/cert.pem
SSLCertificateKeyFile /etc/apache2/certs/privkey.pem
SSLCertificateChainFile /etc/apache2/certs/chain.pem
<Directory /var/www/nextcloud/>
Require all granted
AllowOverride All
Options FollowSymLinks MultiViews
SetEnv HOME /var/www/nextcloud
SetEnv HTTP_HOME /var/www/nextcloud
<IfModule mod_dav.c>
Dav off
</IfModule>
</Directory>
</VirtualHost>
The website looks and tests “good” and secure with my SSL certs, but I get this message when I open up the NextCloud in the browsers under the settings | overview tab:
Some files have not passed the integrity check. Further information on how to resolve this issue can be found in the [documentation]. ([List of invalid files…] / [Rescan…]
I also see this message when I click “List of invalid files…”.
Technical information
=====================
The following list covers which files have failed the integrity check. Please read
the previous linked documentation to learn more about the errors and how to fix
them.
Results
=======
- core
- EXCEPTION
- OC\IntegrityCheck\Exceptions\InvalidSignatureException
- Certificate is not valid.
Raw output
==========
Array
(
[core] => Array
(
[EXCEPTION] => Array
(
[class] => OC\IntegrityCheck\Exceptions\InvalidSignatureException
[message] => Certificate is not valid.
)
)
)
Here are some other details about the configuration.
Nextcloud version: 16.0.0
Operating system and version: Ubuntu 19.10
Apache version: 2.4.41 (Ubuntu)
PHP version: 7.3
The output of your config.php file in /var/www/nextcloud/config
(make sure you remove any identifiable information!):
root@nc:/var/www/nextcloud/config# cat config.php
<?php
$CONFIG = array (
'instanceid' => 'XXXXXXXX',
'passwordsalt' => 'XXXXXXXXX',
'secret' => 'XXXXXXXXX',
'trusted_domains' =>
array (
0 => '192.168.1.XXX',
1 => 'cloud.mydomain.net',
),
'datadirectory' => '/var/www/nextcloud/data',
'dbtype' => 'mysql',
'version' => '16.0.0.9',
'overwrite.cli.url' => 'http://192.168.1.XXX/nextcloud',
'dbname' => 'nextcloud',
'dbhost' => 'localhost',
'dbport' => '',
'dbtableprefix' => 'oc_',
'mysql.utf8mb4' => true,
'dbuser' => 'user',
'dbpassword' => 'XXXXXX',
'installed' => true,
'maintenance' => false,
'memcache.locking' => '\OC\Memcache\Redis',
'memcache.distributed' => '\OC\Memcache\Redis',
'memcache.local' => '\OC\Memcache\APCu',
'redis' => [
'host' => 'localhost',
'port' => 6379,
],
);
The output of your Apache/nginx/system log in /var/log/____
:
Apache2 seems to be running pretty well right now. I did start and stop the sevice many times testing various configurations.
Nov 14 20:09:01 nc CRON[2052]: (root) CMD ( [ -x /usr/lib/php/sessionclean ] && if [ ! -d /run/systemd/system ]; then /usr/lib/php/sessionclean; fi)
Nov 14 20:09:01 nc systemd[1]: Starting Clean php session files...
Nov 14 20:09:01 nc systemd[1]: phpsessionclean.service: Succeeded.
Nov 14 20:09:01 nc systemd[1]: Started Clean php session files.
Nov 14 20:17:01 nc CRON[2110]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
Nov 14 20:39:01 nc CRON[2141]: (root) CMD ( [ -x /usr/lib/php/sessionclean ] && if [ ! -d /run/systemd/system ]; then /usr/lib/php/sessionclean; fi)
Nov 14 20:39:01 nc systemd[1]: Starting Clean php session files...
Nov 14 20:39:01 nc systemd[1]: phpsessionclean.service: Succeeded.
Nov 14 20:39:01 nc systemd[1]: Started Clean php session files.
Nov 14 20:46:09 nc systemd[1]: Starting The Apache HTTP Server...
Nov 14 20:46:09 nc systemd[1]: Started The Apache HTTP Server.
Nov 14 21:08:37 nc freshclam[887]: Thu Nov 14 21:08:37 2019 -> Received signal: wake up
Nov 14 21:08:37 nc freshclam[887]: Thu Nov 14 21:08:37 2019 -> ClamAV update process started at Thu Nov 14 21:08:37 2019
Nov 14 21:08:37 nc freshclam[887]: Thu Nov 14 21:08:37 2019 -> main.cvd is up to date (version: 58, sigs: 4566249, f-level: 60, builder: sigmgr)
Nov 14 21:08:37 nc freshclam[887]: Thu Nov 14 21:08:37 2019 -> daily.cld is up to date (version: 25633, sigs: 1988123, f-level: 63, builder: raynman)
Nov 14 21:08:37 nc freshclam[887]: Thu Nov 14 21:08:37 2019 -> bytecode.cvd is up to date (version: 331, sigs: 94, f-level: 63, builder: anvilleg)
Nov 14 21:09:01 nc CRON[2581]: (root) CMD ( [ -x /usr/lib/php/sessionclean ] && if [ ! -d /run/systemd/system ]; then /usr/lib/php/sessionclean; fi)
Nov 14 21:09:01 nc systemd[1]: Starting Clean php session files...
Nov 14 21:09:01 nc systemd[1]: phpsessionclean.service: Succeeded.
Nov 14 21:09:01 nc systemd[1]: Started Clean php session files.
Nov 14 21:17:01 nc CRON[2666]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
Nov 14 21:39:01 nc CRON[2736]: (root) CMD ( [ -x /usr/lib/php/sessionclean ] && if [ ! -d /run/systemd/system ]; then /usr/lib/php/sessionclean; fi)
Nov 14 21:39:01 nc systemd[1]: Starting Clean php session files...
Nov 14 21:39:01 nc systemd[1]: phpsessionclean.service: Succeeded.
Nov 14 21:39:01 nc systemd[1]: Started Clean php session files.
Nov 14 21:40:11 nc systemd[1]: Stopping The Apache HTTP Server...
Nov 14 21:40:12 nc systemd[1]: apache2.service: Succeeded.
Nov 14 21:40:12 nc systemd[1]: Stopped The Apache HTTP Server.
Nov 14 21:40:12 nc systemd[1]: Starting The Apache HTTP Server...
Nov 14 21:40:12 nc systemd[1]: Started The Apache HTTP Server.
Nov 14 22:08:37 nc freshclam[887]: Thu Nov 14 22:08:37 2019 -> Received signal: wake up
Nov 14 22:08:37 nc freshclam[887]: Thu Nov 14 22:08:37 2019 -> ClamAV update process started at Thu Nov 14 22:08:37 2019
Nov 14 22:08:37 nc freshclam[887]: Thu Nov 14 22:08:37 2019 -> main.cvd is up to date (version: 58, sigs: 4566249, f-level: 60, builder: sigmgr)
Nov 14 22:08:37 nc freshclam[887]: Thu Nov 14 22:08:37 2019 -> daily.cld is up to date (version: 25633, sigs: 1988123, f-level: 63, builder: raynman)
Nov 14 22:08:37 nc freshclam[887]: Thu Nov 14 22:08:37 2019 -> bytecode.cvd is up to date (version: 331, sigs: 94, f-level: 63, builder: anvilleg)
Nov 14 22:09:01 nc CRON[2921]: (root) CMD ( [ -x /usr/lib/php/sessionclean ] && if [ ! -d /run/systemd/system ]; then /usr/lib/php/sessionclean; fi)
Nov 14 22:09:01 nc systemd[1]: Starting Clean php session files...
Nov 14 22:09:01 nc systemd[1]: phpsessionclean.service: Succeeded.
Nov 14 22:09:01 nc systemd[1]: Started Clean php session files.
Nov 14 22:17:01 nc CRON[3005]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
- My first priority is to make sure my SSL certs are installed properly.
- Secondly, I would like to request any advise/updates/improvements to these config files. Right now my NextCloud site is running terrible meaning very very slow, which seems to be related to caching, but I will open another thread to address those issues.