{"id":2381,"date":"2021-03-26T02:00:03","date_gmt":"2021-03-26T10:00:03","guid":{"rendered":"http:\/\/wonghoi.humgar.com\/blog\/?p=2381"},"modified":"2021-04-07T16:00:14","modified_gmt":"2021-04-08T00:00:14","slug":"nextcloud-setup-notes","status":"publish","type":"post","link":"https:\/\/wonghoi.humgar.com\/blog\/2021\/03\/26\/nextcloud-setup-notes\/","title":{"rendered":"NextCloud setup notes"},"content":{"rendered":"\n<p>Free Horde Webmail client was ugly so I was looking for alternatives to view my email, calendar, contacts and notes. After a bit of research, I decided to try NextCloud. <\/p>\n\n\n\n<p>NextCloud hosts calendar\/tasks (CalDav) and contacts (CardDav) as a server, but do not store emails. Use any email provider (from your ISP or free email services as long as they do IMAP\/POP and SMTP).<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Default welcome\/demo files are under \/core\/skeleton (you can change this by editing <code>\/config\/config.php<\/code>)<\/li><li>If you <a href=\"https:\/\/wonghoi.humgar.com\/blog\/wp-admin\/post.php?post=2354&amp;action=edit\">move the folder<\/a>, you have to edit the database and root location paths in <code>\/config\/config.php<\/code><\/li><li>Need to setup MySQL first. Avoid PostgreSQL option as it does not work out of the box.<\/li><li>Disable sqlite3 PHP extension<\/li><li>If installed on shared hosting, install <strong>without<\/strong> featured app because it will install CODE which is a can or worms.<\/li><li>Collabora Online is a can of worms. See below<\/li><\/ul>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>Collabora Online (LibreOffice engine to edit documents live on web browsers) require special handling:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>There&#8217;s a free community edition called CODE (Collabora Online Development Edition)<\/li><li><span style=\"text-decoration: underline;\">Do NOT install the <strong>BUILT-IN<\/strong> CODE server<\/span> Nextcloud App if you NextCloud is on a shared hosting because this will appear as a rogue app that slows Nextcloud to a crawl, exhausting entry processes (aka concurrent Apache requests), and still it&#8217;ll timeout opening a document. Probably malfunctioning due to some permission issues on shared hosting. <\/li><\/ul>\n\n\n\n<p>Ports that need to be opened (more accurately port-forwarded to the CODE server) for Collabora: <\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>443 (HTTPS)<\/li><\/ul>\n\n\n\n<p>Turns out port 80 (HTTP that starts with Univention administration interface) is not necessary. It just redirects to port 443 (HTTPS) if you forgot to type the URL starting with <code>http<strong>s<\/strong>:\/\/<\/code> (it&#8217;s <code>http:\/\/<\/code> by default when you type in the address bar of your browser). <\/p>\n\n\n\n<p>Since the URL of Collabora Online-server in NextCloud settings uses only HTTPS and a HTTP URL is going to be redirected to HTTPS anyway, don&#8217;t bother with forwarding Port 80 (HTTP) and enter <code>http<strong>s<\/strong>:\/\/<\/code> in the Collabora Online-server URL instead.<\/p>\n\n\n\n<p>You don&#8217;t need to forward 9980 (WOPI) either. Somebody mentioned it in Nextcloud forum but that&#8217;s not the cause. <\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>Well, the next part is the hairiest. Turns out even the Collabora server checks out with NextCloud, the documents won&#8217;t open (some weird error messages):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>The webpage at https:\/\/&lt;Collabora Server&gt;\/loleaflet\/23e6a73\/loleaflet.html?WOPISrc=https%3A%2F%2F&lt;Collabora Server&gt;%2Findex.php%2Fapps%2Frichdocuments%2Fwopi%2Ffiles%2F2180_octqxsu7tnwz&amp;title=&lt;Filename of document to edit&gt;&amp;lang=en&amp;closebutton=1&amp;revisionhistory=1 might be temporarily down or it may have moved permanently to a new web address.\n\nOf course, substitute &lt;Collabora Server&gt; and &lt;Filename of document to edit&gt; with your scenario.<\/code><\/pre>\n\n\n\n<p>I tried going to  <code>https:\/\/&lt;Collabora Server&gt;<\/code> and noticed this <code>NET::ERR_CERT_AUTHORITY_INVALID<\/code> error:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"395\" height=\"165\" src=\"https:\/\/wonghoi.humgar.com\/blog\/wp-content\/uploads\/2021\/03\/image-23.png\" alt=\"\" class=\"wp-image-2405\" srcset=\"https:\/\/wonghoi.humgar.com\/blog\/wp-content\/uploads\/2021\/03\/image-23.png 395w, https:\/\/wonghoi.humgar.com\/blog\/wp-content\/uploads\/2021\/03\/image-23-300x125.png 300w\" sizes=\"auto, (max-width: 395px) 100vw, 395px\" \/><\/figure>\n\n\n\n<p>Turns out given my server do not have the SSL certificate installed yet (and I got around it by &#8220;Disable certificate verification&#8221; in Collabora Online setup), my users\/clients has to manually visit the Collabora (NOT NextCloud) server and click through the security warning to accept the Collabora site that do not have a valid SSL certificate. After that the Collabora Online works properly!<\/p>\n\n\n\n<p>In other words, if you run into certificate issues with Collabora server, NextCloud won&#8217;t tell you when it calls Collabora server (with REST API) to open the document, instead it&#8217;ll just appear as a fail HTTPS call without warning or giving you a chance to correct the certificate issue.<\/p>\n<div class=\"pvc_clear\"><\/div><p id=\"pvc_stats_2381\" class=\"pvc_stats all  \" data-element-id=\"2381\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img loading=\"lazy\" decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/wonghoi.humgar.com\/blog\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p><div class=\"pvc_clear\"><\/div>","protected":false},"excerpt":{"rendered":"<p>Free Horde Webmail client was ugly so I was looking for alternatives to view my email, calendar, contacts and notes. After a bit of research, I decided to try NextCloud. NextCloud hosts calendar\/tasks (CalDav) and contacts (CardDav) as a server, &hellip; <a href=\"https:\/\/wonghoi.humgar.com\/blog\/2021\/03\/26\/nextcloud-setup-notes\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_2381\" class=\"pvc_stats all  \" data-element-id=\"2381\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img loading=\"lazy\" decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/wonghoi.humgar.com\/blog\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p>\n<div class=\"pvc_clear\"><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[42],"tags":[],"class_list":["post-2381","post","type-post","status-publish","format-standard","hentry","category-web-services"],"_links":{"self":[{"href":"https:\/\/wonghoi.humgar.com\/blog\/wp-json\/wp\/v2\/posts\/2381","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wonghoi.humgar.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wonghoi.humgar.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wonghoi.humgar.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wonghoi.humgar.com\/blog\/wp-json\/wp\/v2\/comments?post=2381"}],"version-history":[{"count":7,"href":"https:\/\/wonghoi.humgar.com\/blog\/wp-json\/wp\/v2\/posts\/2381\/revisions"}],"predecessor-version":[{"id":2431,"href":"https:\/\/wonghoi.humgar.com\/blog\/wp-json\/wp\/v2\/posts\/2381\/revisions\/2431"}],"wp:attachment":[{"href":"https:\/\/wonghoi.humgar.com\/blog\/wp-json\/wp\/v2\/media?parent=2381"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wonghoi.humgar.com\/blog\/wp-json\/wp\/v2\/categories?post=2381"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wonghoi.humgar.com\/blog\/wp-json\/wp\/v2\/tags?post=2381"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}