Ncp-update fails from login shell

Running sudo ncp-update from my login shell has failed, and I dunno why.

I’m currently running v0.28.2, and when I ran sudo ncp-update from my login shell, I received the following error:

Unpacking pwauth (2.3.11-0.2) ...
Setting up libapache2-mod-authnz-external (3.3.2-0.1+b1) ...
apache2_invoke: Enable module authnz_external
apache2_reload: Your configuration is broken. Not restarting Apache 2
apache2_reload: AH00526: Syntax error on line 15 of /etc/apache2/sites-enabled/ncp.conf:
apache2_reload: Invalid command 'AuthType', perhaps misspelled or defined by a module not included in the server configuration

The end of the installation output closes with the following:

To activate the new configuration, you need to run:
  systemctl restart apache2
NextCloudPi updated to version v0.30.0

When I tried to activate the new configuration, it went thusly:

pi@grumpy:~ $ systemctl restart apache2
Failed to restart apache2.service: The name org.freedesktop.PolicyKit1 was not provided by any .service files
See system logs and 'systemctl status apache2.service' for details.

Here is the relevant bit from the ncp.conf file:

<Directory /var/www/ncp-web/>

  AuthType Basic
  AuthName "ncp-web login"
  AuthBasicProvider external
  AuthExternal pwauth

Any thoughts about why this is happening? I can provide the full installer output if that seems germane.

have you installed / configured other things manually aside from NCP?

Ahh…yesssssssssss, I did. :expressionless: I was experimenting a few days earlier with replacing the host SSH keys, and, as I did not particularly know what I was doing, managed to screw things up royally. I had originally thought that I was working on a different machine, but I now realize that this was on my NCP installation Pi. I’ve managed to fix a few things, but I think that rather than troubleshoot at this point, it’s going to just be easier to start over and re-install from scratch.

This leads me to an interesting question though – if I regenerate the SSH host keys (properly) on an existing NCP installation, will it break that installation? Perhaps this would be better phrased as “what would I need to do to regenerate my host SSH keys without breaking my NCP installation running?”

you can (re)generate SSH keys anytime, no problem with that

Confirmed (when you do it right). Many thanks. And for those who may be wondering, here’s how to regenerate host keys properly:

How to generate stronger RSA host key in Raspbian