Nextcloud not working after reboot ubuntu

I have nextcloud 12.0 running on ubuntu desktop 16.4 the system working as well
After rebooting my ubuntu I found that the nextcloud stop working
I am trying to start Apache2 service but nothing happened
This is the first time I reboot my server

Is Apache active?
Did you also restart your DB (MySQL or alike)?

Well in most cases Apache won’t start with broken config files. This would be my first point of interest. Also check all your system logs.

Also check out the configtest option in apachectl
https://httpd.apache.org/docs/2.4/programs/apachectl.html

sudo apachectl -t

I have the same problem. I just installed Nextcloud on Ubuntu Server following this tutorial here:

https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-nextcloud-on-ubuntu-16-04

After rebooting the system, Nextcloud is no longer working. Prior to the reboot, all was working fine.

I’m a beginner, so this may well be a pretty basic point that I missed. Any help is much appreciated.

I would recommend following the Nextcloud manual instead of 3rd party tutorials, unless you need to do something beyond what the manual covers. In this case, they walk you through step by step on Ubuntu.
https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html#example-installation-on-ubuntu-16-04-lts-server

Can you please elaborate? This could mean too many different things to troubleshoot.

Did you try any of the suggestions mentioned above? Jakobssystems makes a good point that this type of problem is likely a problem with the Apache config. You can get it working, then break the config and restart Apache, but it secretly continues using the last working config until you reboot, then it’s totally broken.

Many thanks, much appreciated. I will work through the official manual as soon as I have time and report back (not in the next couple of days).

I did not (intentionally) alter the apache configuration.

On a side note: During Ubuntu installation, I was asked if I would like to have encryption turned on, which I confirmed. This led to issues with my ssh keys (which are then only readable, after I login first with a password). Not sure if this feature could also lead to similar problems with Nextcloud.

So here is an update. Initially, the problem was the ufw firewall which was wrongly configured and prevented access (in particular, once ssl was active). So with sudo ufw disable this was solved.

After rebooting, I now at least get the following error message, which indeed seems to point towards an issue with apache:

So here is what happend so far:

  • Installed Ubuntu Server 16.04
  • Installed Nextcloud 12 via snap (sudo snap install nextcloud)
  • Enabled SSL (sudo nextcloud.enable-https self-signed)
  • Created the admin account via web wizard
    –> Up to this point, nextcloud works just fine, also via iOS App.
  • Rebooted the system
  • Now I get the error screen above

Any hints/instructions on how to fix this would be much appreciated.

The official installation manual seems to mention various additional steps, but it is unclear to me if these are required when installing nextcloud via snap. My (naive) impression was, that snap would take care of more or less everything (which it did, up to the reboot).

1 Like

One step further now. Executing the steps described in the installation manual under Apache Webserver Configuration (https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html#apache-configuration-label) helped bring nextcloud back.

After rebooting the system, I still get the Apache message/screen copied above. With sudo service apache2 restart this can then again be fixed.

I still have not yet found the missing piece in order to have Nextcloud work properly immediately upon reboot of the system, without a manual restart of apache. Could this behavior be related to the fact that I have opted to encrypt my home directory when installing ubuntu server (see above). How could this be checked/fixed?

Interesting. What files do you have in /etc/apache2/sites-enabled? Can you post the config files (feel free to change the domain name)?

As already said back in November. Something in your Apache config files is mismatched. Your /sites-available conf should look like this with all the required virtual websites parameters of course. It’s hard to guess without knowing something about your apache configuration.

<VirtualHost *:80>
ServerName cloud.yourname.com
DocumentRoot /var/www/cloud.yourname.com

<Directory “/var/www/cloud.yourname.com”>

< / Directory>

Redirect 301 / https://cloud.yourname.com

< / VirtualHost>

<VirtualHost *:443>

ServerName cloud.yourname.com
DocumentRoot /var/www/cloud.yourname.com

<Directory “/var/www/cloud.yourname.com”>

< / Directory>

SSLEngine on
SSLCertificateFile …
SSLCertificateKeyFile …
SSLCACertificateFile …

< / VirtualHost>

1 Like

I installed nextcloud with snap and whten reboot ubuntu I realize that nextcloud not working.
My solution was to disable apache2
sudo service apache2 stop
I guess snap was going in conflict with apache2. Try this!

3 Likes

NicolasFM…nice! This worked instantly.
Do you know how to disable Apache service so it won’t start?

Got it:
To disable apache2 simply type:

sudo update-rc.d apache2 disable

Now this worked for me, but my install is on Ubuntu 18 Desktop installed Nextcloud from the software manager, then configured the web cert for ssl.
Used above to disable apache2, as NicolasFM mentioned it is interfering with Nextcloud starting on boot.

I had posted my issue in another thread then found this one.

Just wanted to add that the service apache2 stop worked for me as well.

But reboot the server and the issue returns.

I’m guessing the permanent disable is the trick?

However (and I am pretty new to all this) doesn’t Nextcloud SNAP require Apache2 to run?

And 2) what happened during the update that seems to have installed a “useless” Apache2? If I can just disable it an the site works, why is it there? Can you just get rid of it?

if you used snap to install next cloud, just stop the apache server:
sudo service apache2 stop

if it’s showing a blank white page after you reboot ubuntu after installing next cloud apps, then the permissions haven’t been enacted and saved to the newly installed apps and as a result shows a blank white screen at login. Provide the permission to the entire next cloud directory:
sudo chown -R www-data:www-data /var/www/html/nextcloud/
sudo chmod -R 755 /var/www/html/nextcloud/

you are done. enjoy!

I had the exact same issue, and the solution was simply to disable the firewall.
Upvoting this for visibility.