NextCloudPi: tried to enable ssl, ncp doesn't work anymore, 'error editing apache2'

Hello everybody! I successfully installed NextCloudPi on my Raspberry. I read this article about enabling ssl without knowing what I was doing so I ran these commands:

a2enmod ssl
a2ensite default-ssl
service apache2 reload

I reloaded the NextCloudPi login page and an apache site appeared telling me that apache has been installed successfully. In order to undo these commands, I tried to reinstall NextCloudPi but I just got an ‘error editing apache2’. What should I do to make NextCloud work again?

Thanks!

ssl comes enabled by default. do a2dissite default-ssl and restart apache

1 Like

~ S a2dissite default-ssl
Site default-ssl already disabled

~ S sudo service apache2 start
Job for apache2.service failed because the control process exited with error code. See "systemctl status apache2.service" and "journalctl -xe" for details.

~ S systemctl status apache2.service
apache2.service - The Apache HTTP Server Loaded: loaded (/lib/systemd/system/apache2.service; disabled; vendor preset: enabled) Active: failed (Result: exit-code) since Sat 2019-12-21 01:23:06 CET; 8min ago Docs: https://httpd.apache.org/docs/2.4/ Process: 2971 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE) Dez 21 01:23:06 raspberrypi systemd[1]: Starting The Apache HTTP Server... Dez 21 01:23:06 raspberrypi apachectl[2971]: AH00526: Syntax error on line 4 of /etc/apache2/sites-enabled/ncp.conf: Dez 21 01:23:06 raspberrypi apachectl[2971]: Invalid command 'SSLEngine', perhaps misspelled or defined by a module not included in the server configuration Dez 21 01:23:06 raspberrypi apachectl[2971]: Action 'start' failed. Dez 21 01:23:06 raspberrypi apachectl[2971]: The Apache error log may have more information. Dez 21 01:23:06 raspberrypi systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE Dez 21 01:23:06 raspberrypi systemd[1]: apache2.service: Failed with result 'exit-code'. Dez 21 01:23:06 raspberrypi systemd[1]: Failed to start The Apache HTTP Server.

journalctl -xe
-- The process' exit code is 'exited' and its exit status is 1. Dez 21 01:34:20 raspberrypi systemd[1]: nextcloud-domain.service: Failed with result 'exit-code'. -- Subject: Unit failed -- Defined-By: systemd -- Support: https://www.debian.org/support -- -- The unit nextcloud-domain.service has entered the 'failed' state with result 'exit-code'. Dez 21 01:34:25 raspberrypi systemd[1]: nextcloud-domain.service: Service RestartSec=5s expired, scheduling restart. Dez 21 01:34:25 raspberrypi systemd[1]: nextcloud-domain.service: Scheduled restart job, restart counter is at 137. -- Subject: Automatic restarting of a unit has been scheduled -- Defined-By: systemd -- Support: https://www.debian.org/support -- -- Automatic restarting of the unit nextcloud-domain.service has been scheduled, as the result for -- the configured Restart= setting for the unit. Dez 21 01:34:25 raspberrypi systemd[1]: Stopped Register Current IP as Nextcloud trusted domain. -- Subject: A stop job for unit nextcloud-domain.service has finished -- Defined-By: systemd -- Support: https://www.debian.org/support -- -- A stop job for unit nextcloud-domain.service has finished. -- -- The job identifier is 9504 and the job result is done. Dez 21 01:34:25 raspberrypi systemd[1]: Started Register Current IP as Nextcloud trusted domain. -- Subject: A start job for unit nextcloud-domain.service has finished successfully -- Defined-By: systemd -- Support: https://www.debian.org/support -- -- A start job for unit nextcloud-domain.service has finished successfully. -- -- The job identifier is 9504. Dez 21 01:34:25 raspberrypi sudo[8074]: root : TTY=unknown ; PWD=/ ; USER=www-data ; COMMAND=/usr/bin/php /var/www/nextcloud/occ config:system:set trusted Dez 21 01:34:25 raspberrypi sudo[8074]: pam_unix(sudo:session): session opened for user www-data by (uid=0) Dez 21 01:34:25 raspberrypi bash[8059]: Nextcloud is not installed - only a limited number of commands are available Dez 21 01:34:25 raspberrypi bash[8059]: Dez 21 01:34:25 raspberrypi bash[8059]: There are no commands defined in the "config:system" namespace. Dez 21 01:34:25 raspberrypi bash[8059]: Dez 21 01:34:25 raspberrypi sudo[8074]: pam_unix(sudo:session): session closed for user www-data Dez 21 01:34:25 raspberrypi sudo[8090]: root : TTY=unknown ; PWD=/ ; USER=www-data ; COMMAND=/usr/bin/php /var/www/nextcloud/occ config:system:set trusted Dez 21 01:34:25 raspberrypi sudo[8090]: pam_unix(sudo:session): session opened for user www-data by (uid=0) lines 2562-2601/2601 (END) -- The process' exit code is 'exited' and its exit status is 1. Dez 21 01:34:20 raspberrypi systemd[1]: nextcloud-domain.service: Failed with re -- Subject: Unit failed -- Defined-By: systemd -- Support: https://www.debian.org/support -- -- The unit nextcloud-domain.service has entered the 'failed' state with result Dez 21 01:34:25 raspberrypi systemd[1]: nextcloud-domain.service: Service Restar Dez 21 01:34:25 raspberrypi systemd[1]: nextcloud-domain.service: Scheduled rest -- Subject: Automatic restarting of a unit has been scheduled -- Defined-By: systemd -- Support: https://www.debian.org/support -- -- Automatic restarting of the unit nextcloud-domain.service has been scheduled, -- the configured Restart= setting for the unit. Dez 21 01:34:25 raspberrypi systemd[1]: Stopped Register Current IP as Nextcloud -- Subject: A stop job for unit nextcloud-domain.service has finished -- Defined-By: systemd -- Support: https://www.debian.org/support -- -- A stop job for unit nextcloud-domain.service has finished. -- -- The job identifier is 9504 and the job result is done. lines 2562-2584/2601 99%

What should I do?

Just reinstalled the whole Raspbian OS as well as NCP which works now.

thanks. I had the same issue with Ubuntu.

then

sudo a2dismod ssl
a2dissite default-ssl
sudo service apache2 restart