Great investigation! That sounds broken indeed. However, Iām afraid Iām not familiar enough with Nextcloud to know the purpose of that table, nor the ramifications of modifying it by hand. Note that you can get into the database via the included client: sudo nextcloud.mysql-client.
This seems to be a Nextcloud issue thatās not specific to the snap. I suggest opening a new topic with this same information to get more eyes from core Nextcloud folks.
The only issue Iāve faced is the inability to put nextcloud data on a separate drive. But that could be classified alternatively as a feature request.
Just wanted to say big thanks for making nextcloud snap, setting up literally was four steps:
Installed Ubuntu on an inexpensive new server (dell poweredge t30).
@sunrisen thank you for the kind words! As for storing your data on an external drive, thatās already supported: Please see the README for more details.
I only have had one issue so far, and it probably lies at my feet (lack of experience or completely missing existing documentation), but:
(A) There isnāt a way to edit the apache config file for virtual hosts (so that I could have, say, blog.mydomain.comet.al alongside NC) - at least insofar as the snap package goes. Most support pages I found talk about the manual installation folders (/var/www/html/nextcloud, etc) instead of /snap/nextcloud/.
(B) and could not for the life of me find any documentation or previous support issues that address virtual hosts/subdomains with the snap package. Iām assuming from your blog post here that opening up the guts to be edited is something you arenāt keen to doā¦so Iām at a loss if this is even possible.
Aside from that, I love how absolutely easy it was to setup Nextcloud with this snap; even with limited knowledge of linux, it was a breeze to set up at mydomain.com and get the certs from lets-encrypt. Not much has been this easy!
Hey there @thegreyfawkes, thanks for the questions. Theyāre really the same question, heh. Youāre right, the Apache contained within the snap is not meant to be used by anything other than Nextcloud. Basically: this is the Nextcloud snap, not the Apache snap. If we had to support all the numerous uses of Nextcloud as well as the numerous uses of Apache weād die in a support fire! Not to mention, if we opened the Apache config, weād immediately be married to Apache for all time, precluding the ability to ever move to anything else (e.g. nginx).
Think of the snap as a standalone thing. You shouldnāt need to care that it uses Apache. If you want to run your own Apache instance, with other vhosts, then change the port on which Nextcloud is listening and proxy to it from your Apache.
New Domain => New certificate => How to get it active at Nextcloud snap
With registering to a new domain I retriggered the nextcloud.enable-https script for obtaining a new certificate. The script did run successfully.
When using the new domain to access my nextcloud I receive the message that the certificate does not fit to the new domain. A quick check revealed that still the old certificate for the previous domain was returned.
Question is now how can I de-activate the old certificate and take the new one into use?
I did already:
Use the disable-https script and enable-https script consecutively.
Stopped and restarted the nextcloud snap
Checked at var/snap/nextcloud/current/certs folder. The new certificate seems to be present even though not actively used.
I just added a second domain to my cert a little while ago, and did exactly that-- ran nextcloud.enable-https lets-encrypt again, this time with both domains. That script restarts Apache, which picked up the new cert. Have you tried restarting Apache yourself?
If that doesnāt work, and youāve verified that the new certs are correct and the old certs arenāt around, Iām not sure whatās going on there, but we can take the nuclear option.
First of all, disable HTTPS (this just removes a symlink, it doesnāt remove any certs):
$ sudo nextcloud.disable-https
Then blow away any certs that are there (this includes self-signed certs, Letās Encrypt certs, everything). Make sure you get this command right, you donāt want to delete anything else in the current/ dir:
$ sudo rm -rf /var/snap/nextcloud/current/certs
Then pretend youāre enabling HTTPS for the first time:
Actually, re-reading your post, it sounds like youāre not adding a new domain (thus having multiple), but replacing one. Correct? In that case, do you have multiple directories in /var/snap/nextcloud/current/certs/certbot/live? If so, thatās the issue. The fix is really the same, but please let me know if this is the case, because thatās an experience we could improve.
There are two directories at /var/snap/nextcloud/current/certs/certbot/config/live/ . Each named according to my domains, the old one and the new one.
Have you tried restarting Apache yourself?
The āenable-httpsā script was outputting that it restarts apache. In addition I did stop and restart the whole snap. Anyway I restarted the apache server again with the command provided by you. Situation did not change.
Was going now with the ānuclear optionā, laying waste to the certificates and creating a new one.
Worked fine .
Thanks a lot for your feedback.
P.S.: FYI, binding a new domain to my nextcloud is due to a DDNS Service provided for free by a manufacturer of internet-routers (AVM). This particular DDNS Service is actually bound to the internet-router devices. With replacing my device and registering it for the DDNS Service, a new domain was assigned.
I have installed the snap in Raspbian 2017-11-29-raspbian-stretch-liteRaspbian 2017-11-29-raspbian-stretch-lite.
I needed to change the port. This I did and I can access it on the local network. However I am unable to access via my domain name. I need to be able to add it to trusted domains but the command line utility: nextcloud.occ is not recognised. So I navigated to the nextcloud snap bin directory and ran as: sudo ./occ config:system:get trusted_domains
This returned: ./occ: 3: .: Canāt open /utilities/mysql-utilities
I also want to enable https.
Further to this I am running raspbian now because the Ubuntu 16.04 LTS wouldnāt even install the snap - I put that down to the kernel. After spending a lot of time on this I abandoned it and tried Raspbian where I have had much more success.
You canāt run stuff from within the snap manually. You need to run things from /snap/bin, which should be on the PATH. You may need to logout/login in order to get it on there, though. I havenāt tried running snaps from Raspbian, but they should definitely work on Ubuntu 16.04. Not sure what issues you ran into there, unless the kernel you were using was non-standard (in which case itās not really Ubuntu).
As you can see I have already tried to run the command from the bin directory, as you stated, but it threw up an error. Also the button, which appears on the page, that is presented when there is no connection on the remote url is badly formed - i.e. I think there is a bug there. Part of the url is this:
index.php/settings/admin?trustDomain=
I canāt see that being correct. The query string should follow āindex.phpā if anything. I tried modifying it to no avail. So now I am in a situation where Nextcloud runs but it is useless in practice because I canāt run it remotely.
The snap commands appear to work - for example i was able to change the port, but those that are supposed to run directly via sudo donāt woprk - even from within the bin directory as ./ or with the path included in the command.
The Ubuntu 16.04 was one I installed from a Pi image a while ago and is fully updated, it is my server. The snap, as I say, didnāt even finish installation on Ubuntu. So, all in all a failure for snaps as far as I am concerned. I tried a standard install on Ubuntu too, I got problems there too
Iām afraid thatās not what I stated. In fact, youāre doing exactly what I told you not to do. Please read my comment again.
Those commands are in /snap/bin, as I said. Not āthe bin of the snap,ā but literally the path /snap/bin.
Classic Ubuntu doesnāt have a Pi image, so it sounds like youāre running something non-standard. Canāt really help you there. Snaps need some specific kernel features.
I am guessing the issues I am facing is mostly about the lack of documentation. Installation was pretty easy. However figuring out the rest has been a big waste of time.
The out-of-snap product functions greatly but it is not sufficient for practical purposes even for a skill-less admin like me. In addition to the snap-version, I would like to use a secure connection, figure out where my data is (in order to set up a back-up system in case of failures) and configure apache (in order to set up a subdomain instead of an ip). The nextcloud documentation regarding these configurations assumes manual installation.
If you need help with a snap, itās always best to see what snap info says about it:
$ snap info nextcloud
<snip>
contact: https://github.com/nextcloud/nextcloud-snap
<snip>
Thatās the only documentation over which we have control. If the Nextcloud folks are interested, we can certainly add some information about how to use the snap to the docs.
Iām new to Linux, new to VPS, and new to NC. If there is a more appropriate thread for me to post in please let me know.
I followed this:
to install NC on my DO droplet and itās working just fine. Amazingly simple!
Iāve read the thread from the top and it seems that if I want to host a website on the same VPS, my best bet might be to uninstall the snap package and proceed with a LAMP stack followed by a manual install of NC. Is this correct?
P.S. Iāll take the opportunity of my first post to praise the great efforts the staff has put into ensuring decorum here.
Oh no, you can set it up however you like! The only limitation you have is that you canāt modify the Apache bundled with the snap. Thatās okay, you can install your own Apache and change the default ports of the snap, and setup a vhost that proxies to the snap (and another vhost for your other website, etc.). The setup I use personally is to have every website (including the snap) in its own lxd container, and have another lxd container running haproxy to get traffic into the cluster of containers.
Thanks! I get the basic idea of what you are recommending. Iām a bit foggy on the particulars but Iāll read up an learn some new skills. Just one consideration, will running an additional Apache and the lxds use more system resources than a manual install of LAMP + NC?