<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Nextcloud &#8211; Sandy Scott&#039;s Web Spot</title>
	<atom:link href="https://www.sandyscott.net/tag/nextcloud/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.sandyscott.net</link>
	<description>My little corner of the web</description>
	<lastBuildDate>Tue, 26 Jan 2021 10:47:15 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.6.2</generator>
	<item>
		<title>Server Setup 0: Contents</title>
		<link>https://www.sandyscott.net/2020/06/server-setup-0-contents/</link>
					<comments>https://www.sandyscott.net/2020/06/server-setup-0-contents/#respond</comments>
		
		<dc:creator><![CDATA[Sandy]]></dc:creator>
		<pubDate>Thu, 04 Jun 2020 08:29:10 +0000</pubDate>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[Collabora]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Nextcloud]]></category>
		<category><![CDATA[WordPress]]></category>
		<guid isPermaLink="false">https://www.sandyscott.net/?p=666</guid>

					<description><![CDATA[Hello and welcome to my series of posts on setting up a server to run Debian Linux, hosting a WordPress and a Nextcloud installation The idea is to take you through all the steps needed to get up and running, some basic familiarity with computers and Linux is assumed, but...<p> <a class="continue-reading-link" href="https://www.sandyscott.net/2020/06/server-setup-0-contents/"><span>Continue reading</span><i class="crycon-right-dir"></i></a> </p>]]></description>
										<content:encoded><![CDATA[
<p>Hello and welcome to my series of posts on setting up a server to run Debian Linux, hosting a WordPress and a Nextcloud installation</p>



<p>The idea is to take you through all the steps needed to get up and running, some basic familiarity with computers and Linux is assumed, but not a lot.</p>



<ul class="wp-block-list"><li><a href="https://www.sandyscott.net/2020/05/18/server-setup-1-os-installation/" data-type="350">Server Setup 1: OS installation</a><br>This goes through a few pre-requisites, and then launches into the installation.</li><li><a href="https://www.sandyscott.net/2020/05/18/server-setup-2-initial-tweaks/" data-type="419">Server Setup 2: Initial tweaks</a><br>These first few steps will make your life easier when administering this server.</li><li><a href="https://www.sandyscott.net/2020/05/19/server-setup-3-install-webserver/" data-type="475">Server Setup 3: Install Webserver</a><br>We&#8217;ll install and test the webserver software &#8211; Apache.</li><li><a href="https://www.sandyscott.net/2020/05/20/server-setup-4-going-public/" data-type="508">Server Setup 4: Going Public</a><br>Configure the server, DNS and your router to allow public access to a placeholder website.</li><li><a href="https://www.sandyscott.net/2020/05/21/server-setup-5-https/" data-type="519">Server Setup 5: HTTPS</a><br>Enable secure connections to your new website with Lets Encrypt and certbot.</li><li><a href="https://www.sandyscott.net/2020/05/21/server-setup-4-wordpress-pre-requisites/" data-type="484">Server Setup 6: WordPress Pre-requisites</a><br>Get ourselves ready to install WordPress &#8211; we need PHP and a database.</li><li><a href="https://www.sandyscott.net/2020/05/21/server-setup-7-install-wordpress/" data-type="539">Server Setup 7: Install WordPress</a><br>Get WordPress installed so you have a functional website!</li><li><a href="https://www.sandyscott.net/2020/05/21/server-setup-8-wordpress-tweaks/" data-type="562">Server Setup 8: WordPress tweaks</a><br>A few tweaks to optimise WordPress.</li><li><a href="https://www.sandyscott.net/2020/05/21/server-setup-9-nextcloud-prep/" data-type="564">Server Setup 9: Nextcloud Prep</a><br>Preparatory work before the Nextcloud installation.</li><li><a href="https://www.sandyscott.net/2020/05/21/server-setup-10-nextcloud-installation/" data-type="575">Server Setup 10: Nextcloud Installation</a><br>Get the database and files system configured, then install Nextcloud</li><li><a href="https://www.sandyscott.net/2020/05/22/server-setup-11-config-improvements/" data-type="582">Server Setup 11: Config Improvements</a><br>Some little tweaks to improve the security of our server</li><li><a href="https://www.sandyscott.net/2020/05/24/server-setup-12-collabora/" data-type="612">Server Setup 12: Collabora</a><br>Install and configure Collabora Online Development Edition</li><li><a href="https://www.sandyscott.net/2020/05/25/server-setup-13-security-improvements/" data-type="621">Server Setup 13: Security Improvements</a><br>Move the WordPress configuration out of the web root</li><li><a href="https://www.sandyscott.net/2020/06/01/server-setup-14-backups/" data-type="516">Server Setup 14: Backups</a><br>This shows how to collect together all the data you need to completely back up your server.</li><li><a href="https://www.sandyscott.net/2020/06/01/server-setup-15-optional-extras/" data-type="602">Server Setup 15: Optional Extras</a><br>Further optional tweaks to make your installation better.</li></ul>



<p></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sandyscott.net/2020/06/server-setup-0-contents/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Server Setup 15: Optional Extras</title>
		<link>https://www.sandyscott.net/2020/06/server-setup-15-optional-extras/</link>
					<comments>https://www.sandyscott.net/2020/06/server-setup-15-optional-extras/#respond</comments>
		
		<dc:creator><![CDATA[Sandy]]></dc:creator>
		<pubDate>Mon, 01 Jun 2020 17:56:43 +0000</pubDate>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Nextcloud]]></category>
		<category><![CDATA[tmux]]></category>
		<category><![CDATA[WordPress]]></category>
		<guid isPermaLink="false">https://www.sandyscott.net/?p=602</guid>

					<description><![CDATA[Now you&#8217;re up and running with what should be a stable and secure installation of WordPress and Nextcloud with Collabora. There are plenty more tweaks you can work on yourself: Server Administration Advanced HTTPS &#8211; you can check your config with https://www.ssllabs.com/ssltest/. You have choices about how you want to...<p> <a class="continue-reading-link" href="https://www.sandyscott.net/2020/06/server-setup-15-optional-extras/"><span>Continue reading</span><i class="crycon-right-dir"></i></a> </p>]]></description>
										<content:encoded><![CDATA[
<p><em>If this is your first time looking at a post from this series, have a look at this summary: <a href="https://www.sandyscott.net/2020/06/04/server-setup-0-contents/" data-type="666">Server Setup 0: Contents</a></em></p>



<p>Now you&#8217;re up and running with what should be a stable and secure installation of WordPress and Nextcloud with Collabora.</p>



<p>There are plenty more tweaks you can work on yourself:</p>



<h2 class="wp-block-heading">Server Administration</h2>



<ul class="wp-block-list"><li>Advanced HTTPS &#8211; you can check your config with <a href="https://www.ssllabs.com/ssltest/">https://www.ssllabs.com/ssltest/</a>. You have choices about how you want to set up your system &#8211; more secure or more compatible with older clients. <a href="https://ssl-config.mozilla.org/#server=apache">This tool from Mozilla</a>  provides recommendations for the the Apache configuration you need.</li><li>Email configuration &#8211; This allows either system to send emails. Best way to do it us an existing email service, and let your server connect to that. s-nail and exim can both do this.</li><li>You can keep you system automatically up to date with the <code>unattened-upgrades</code> package &#8211; this keeps your system up to date. If email is configure it&#8217;ll send you an summary of what it&#8217;s updated.</li></ul>



<h2 class="wp-block-heading">WordPress:</h2>



<p>WordPress relies on htaccess for a few things, mainly nicely writing urls for permalinks. However, .htaccess files have a problem &#8211; they&#8217;re checked every time someone visits your site. You can reconfigure apache to load the data from the .htaccess file once, instead of on every request.</p>



<p>Be careful, there may be multiple .htaccess files, and some plugins install their own, so use these commands to find them all:</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">cd /var/www/wordpress
find | grep htaccess</pre></div>



<h2 class="wp-block-heading">Nextcloud</h2>



<p>A few ideas:</p>



<ul class="wp-block-list"><li>Work your way through the list in administration section &#8211; the links to the documentation will help a lot.</li><li>Background jobs: Try setting up a systemd timer or traditional crontab. Have a look in <strong>Basic Settings</strong> in the <strong>Settings</strong> menu for an Administrator. </li><li>Scan you installation for security issues <a href="https://scan.nextcloud.com/">https://scan.nextcloud.com/</a></li><li>Include .htaccess instead of loading it every time, like for WordPress.</li></ul>



<h2 class="wp-block-heading">User friendliness</h2>



<p>These are a few niceties you might try to help with general use:</p>



<ul class="wp-block-list"><li>Set up passwordless login: <a href="https://linuxize.com/post/how-to-setup-passwordless-ssh-login/">https://linuxize.com/post/how-to-setup-passwordless-ssh-login/</a></li><li>Use <a href="https://github.com/tmux/tmux/wiki">tmux </a>to keep you shell sessions alive.</li></ul>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sandyscott.net/2020/06/server-setup-15-optional-extras/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Server Setup 12: Collabora</title>
		<link>https://www.sandyscott.net/2020/05/server-setup-12-collabora/</link>
					<comments>https://www.sandyscott.net/2020/05/server-setup-12-collabora/#respond</comments>
		
		<dc:creator><![CDATA[Sandy]]></dc:creator>
		<pubDate>Sun, 24 May 2020 18:37:57 +0000</pubDate>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[Collabora]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Nextcloud]]></category>
		<guid isPermaLink="false">https://www.sandyscott.net/?p=612</guid>

					<description><![CDATA[The final of the 3 big pieces &#8211; this provides document editing capability in Nextcloud. Install Collabora There are a couple of ways to install Collabora, and the recommended way is to use a Docker image. That isn&#8217;t ideal for us because the Docker version will use more resources which...<p> <a class="continue-reading-link" href="https://www.sandyscott.net/2020/05/server-setup-12-collabora/"><span>Continue reading</span><i class="crycon-right-dir"></i></a> </p>]]></description>
										<content:encoded><![CDATA[
<p><em>If this is your first time looking at a post from this series, have a look at this summary: <a href="https://www.sandyscott.net/2020/06/04/server-setup-0-contents/" data-type="666">Server Setup 0: Contents</a></em></p>



<p>The final of the 3 big pieces &#8211; this provides document editing capability in Nextcloud.</p>



<h2 class="wp-block-heading">Install Collabora</h2>



<p>There are a couple of ways to install Collabora, and the recommended way is to use a Docker image. That isn&#8217;t ideal for us because the Docker version will use more resources which we can&#8217;t afford if you&#8217;re running this on something old. Instead, Collabora provide respositories, so these commands will:</p>



<ol class="wp-block-list"><li>Install a little tool me we need</li><li>Get the security keys so the repository is safe to use</li><li>Add the repository to our <code>/etc/apt/sources.list</code>.</li><li>Install Collabora</li></ol>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">sudo apt install gnupg
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0C54D189F4BA284D
sudo echo 'deb https://www.collaboraoffice.com/repos/CollaboraOnline/CODE-debian10 ./' | sudo tee -a /etc/apt/sources.list
sudo apt update &amp;&amp; sudo apt install loolwsd code-brand</pre></div>



<h2 class="wp-block-heading">Configure Collabora</h2>



<p>Modify <code>/etc/loolwsd/loolwsd.xml</code></p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">sudoedit /etc/loolwsd/loolwsd.xml</pre></div>



<p>We&#8217;ll disable SSL in collabora itself, because Apache will handle that. Find <code>&lt;ssl desc="SSL settings"&gt;</code>. Look at the line below. Change the second-to last word to <code>false</code>. It should now be this:</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;xml&quot;,&quot;mime&quot;:&quot;application/xml&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;XML&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;xml&quot;}">&lt;enable type=&quot;bool&quot; desc=&quot;Controls whether SSL encryption between browser and loolwsd is enabled (do not disable for production deployment). If default is false, must first be compiled with SSL support to enable.&quot; default=&quot;true&quot;&gt;false&lt;/enable&gt;</pre></div>



<p>In the line below that, the second-to last word should be <code>true</code>.</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;xml&quot;,&quot;mime&quot;:&quot;application/xml&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;XML&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;xml&quot;}">&lt;termination desc=&quot;Connection via proxy where loolwsd acts as working via https, but actually uses http.&quot; type=&quot;bool&quot; default=&quot;true&quot;&gt;true&lt;/termination&gt;</pre></div>



<p>Now find <code>&lt;wopi desc="Allow/de.....</code> Add a line below it, swapping in your <strong>Nextcloud</strong> domain name, with the dots <code>"."</code> escaped with backslashes <code>"\."</code>.</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">&lt;host desc=&quot;Regex pattern of hostname to allow or deny.&quot; allow=&quot;true&quot;&gt;nextcloud\.example\.org&lt;/host&gt;</pre></div>



<p>Save and close the file, then restart Collabora</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&lt;code&gt;sudo systemctl restart loolwsd&lt;/code&gt;Shell&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">sudo systemctl restart loolwsd</pre></div>



<h2 class="wp-block-heading">Test</h2>



<p>There isn&#8217;t a whole lot of testing we can do on Collabora as an intermediate step, but this will at least confirm the server is running. This command asks Collabora for a file saying what it&#8217;s capable of:</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">cd ~
wget http://localhost:9980/hosting/capabilities</pre></div>



<p>If it seems to run OK, you should now have a file called <code>capabilites </code>in your home (~) directory. Lets look at what&#8217;s inside:</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;cShell&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">cat ~/capabilities</pre></div>



<pre class="wp-block-code"><code>{"convert-to":{"available":true},"hasMobileSupport":true,"hasTemplateSaveAs":false,"hasTemplateSource":true,"productName":"Collabora Online Development Edition"}</code></pre>



<p>Looking good!</p>



<h2 class="wp-block-heading">Configure Apache</h2>



<p>In this situation, all Apache has to do is act as a proxy between Collabora and the internet &#8211; we can&#8217;t connect it directly because otherwise the other sites (WordPress and Nextcloud) wouldn&#8217;t work.</p>



<p>Enable these 3 modules:</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">sudo a2enmod proxy proxy_http proxy_wstunnel</pre></div>



<p>Edit the main Collabora SSL Apache configuration file:</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">sudoedit /etc/apache2/sites-available/collabora-le-ssl.conf</pre></div>



<p>Change it to this:</p>



<pre class="wp-block-code"><code>&lt;VirtualHost *:443&gt;
    ServerName collabora.example.org
    ErrorLog ${APACHE_LOG_DIR}/collabora_error.log
    CustomLog ${APACHE_LOG_DIR}/collabora_access.log combined

    SSLCertificateFile /etc/letsencrypt/live/collabora.example.org/fullchain.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/collabora.example.org/privkey.pem
    Include /etc/letsencrypt/options-ssl-apache.conf
	# Encoded slashes need to be allowed
	AllowEncodedSlashes NoDecode

	# Container uses a unique non-signed certificate
	SSLProxyEngine On
	SSLProxyVerify None
	SSLProxyCheckPeerCN Off
	SSLProxyCheckPeerName Off

	# keep the host
	ProxyPreserveHost On

	# static html, js, images, etc. served from loolwsd
	# loleaflet is the client part of Collabora Online
	ProxyPass           /loleaflet http://127.0.0.1:9980/loleaflet retry=0
	ProxyPassReverse    /loleaflet http://127.0.0.1:9980/loleaflet

	# WOPI discovery URL
	ProxyPass           /hosting/discovery http://127.0.0.1:9980/hosting/discovery retry=0
	ProxyPassReverse    /hosting/discovery http://127.0.0.1:9980/hosting/discovery

	# Capabilities
	ProxyPass           /hosting/capabilities http://127.0.0.1:9980/hosting/capabilities retry=0
	ProxyPassReverse    /hosting/capabilities http://127.0.0.1:9980/hosting/capabilities

&lt;/VirtualHost&gt;</code></pre>



<p>Basically, the bits we&#8217;ve added are a two-way connector between Apache and Collabora, and it needs slightly different things for all of the different features.</p>



<p>Reload Apache.</p>



<p>Configure Nextcloud</p>



<ol class="wp-block-list"><li>Log into Nextcloud with your admin account.</li><li>Click on the circle with your initial in the top right corner, choose Apps.</li><li>Click on <strong>Office &amp; text</strong> from the menu on the left.</li><li>Find Collabora Online and click <strong>Download and enable</strong><br></li></ol>



<figure class="wp-block-image size-large"><a href="https://www.sandyscott.net/wp-content/uploads/2020/05/image-44.png"><img fetchpriority="high" decoding="async" width="358" height="297" src="https://www.sandyscott.net/wp-content/uploads/2020/05/image-44.png" alt="" class="wp-image-616" srcset="https://www.sandyscott.net/wp-content/uploads/2020/05/image-44.png 358w, https://www.sandyscott.net/wp-content/uploads/2020/05/image-44-300x249.png 300w, https://www.sandyscott.net/wp-content/uploads/2020/05/image-44-150x124.png 150w" sizes="(max-width: 358px) 100vw, 358px" /></a></figure>



<ol class="wp-block-list" start="5"><li>Click on the circle with your initial in the top right corner, choose Settings.</li><li>Click on Collabora Online near the bottom of the menu on the left.</li><li>Choose <strong>Use your own server</strong></li><li>Enter your Collabora domain name with the https:// and then hit save.</li></ol>



<figure class="wp-block-image size-medium"><a href="https://www.sandyscott.net/wp-content/uploads/2020/05/image-45.png"><img decoding="async" width="300" height="171" src="https://www.sandyscott.net/wp-content/uploads/2020/05/image-45-300x171.png" alt="" class="wp-image-617" srcset="https://www.sandyscott.net/wp-content/uploads/2020/05/image-45-300x171.png 300w, https://www.sandyscott.net/wp-content/uploads/2020/05/image-45-150x85.png 150w, https://www.sandyscott.net/wp-content/uploads/2020/05/image-45.png 750w" sizes="(max-width: 300px) 100vw, 300px" /></a></figure>



<p>Now go back to the files section and give it a try!</p>



<ul class="wp-block-list"><li>You should have the option to create a <strong>New Document</strong>, <strong>New Spreadsheet</strong> or <strong>New Presentation</strong> from the &#8220;+&#8221; icon.</li></ul>



<figure class="wp-block-image size-medium"><a href="https://www.sandyscott.net/wp-content/uploads/2020/05/image-46.png"><img decoding="async" width="209" height="300" src="https://www.sandyscott.net/wp-content/uploads/2020/05/image-46-209x300.png" alt="" class="wp-image-618" srcset="https://www.sandyscott.net/wp-content/uploads/2020/05/image-46-209x300.png 209w, https://www.sandyscott.net/wp-content/uploads/2020/05/image-46-104x150.png 104w, https://www.sandyscott.net/wp-content/uploads/2020/05/image-46.png 236w" sizes="(max-width: 209px) 100vw, 209px" /></a></figure>



<ul class="wp-block-list"><li>Or if you have any files on Open Document (.odt, .ods, .odp) or Open Office XML (.docx, .xlsx, .pptx) formats you can try opening them. They should open for editing in Collabora:</li></ul>



<figure class="wp-block-image size-large is-resized"><a href="https://www.sandyscott.net/wp-content/uploads/2020/05/image-47.png"><img loading="lazy" decoding="async" src="https://www.sandyscott.net/wp-content/uploads/2020/05/image-47.png" alt="" class="wp-image-619" width="299" height="195" srcset="https://www.sandyscott.net/wp-content/uploads/2020/05/image-47.png 598w, https://www.sandyscott.net/wp-content/uploads/2020/05/image-47-300x196.png 300w, https://www.sandyscott.net/wp-content/uploads/2020/05/image-47-150x98.png 150w" sizes="(max-width: 299px) 100vw, 299px" /></a></figure>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sandyscott.net/2020/05/server-setup-12-collabora/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Server Setup 11: Config Improvements</title>
		<link>https://www.sandyscott.net/2020/05/server-setup-11-config-improvements/</link>
					<comments>https://www.sandyscott.net/2020/05/server-setup-11-config-improvements/#respond</comments>
		
		<dc:creator><![CDATA[Sandy]]></dc:creator>
		<pubDate>Fri, 22 May 2020 17:08:31 +0000</pubDate>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Nextcloud]]></category>
		<guid isPermaLink="false">https://www.sandyscott.net/?p=582</guid>

					<description><![CDATA[Before enabling public access to Nextcloud, lets take a moment to improve things a little. Apache Config First up, let&#8217;s force the use of the HTTPS and make sure we haven&#8217;t left any security holes by stripping back the HTTP config file to it&#8217;s bare bones. The default Apache configuration...<p> <a class="continue-reading-link" href="https://www.sandyscott.net/2020/05/server-setup-11-config-improvements/"><span>Continue reading</span><i class="crycon-right-dir"></i></a> </p>]]></description>
										<content:encoded><![CDATA[
<p><em>If this is your first time looking at a post from this series, have a look at this summary: <a href="https://www.sandyscott.net/2020/06/04/server-setup-0-contents/" data-type="666">Server Setup 0: Contents</a></em></p>



<p>Before enabling public access to Nextcloud, lets take a moment to improve things a little.</p>



<h2 class="wp-block-heading">Apache Config</h2>



<p>First up, let&#8217;s force the use of the HTTPS and make sure we haven&#8217;t left any security holes by stripping back the HTTP config file to it&#8217;s bare bones.</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;sudoedit /etc/apache2/sites-available/nextcloud.confShell&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">sudoedit /etc/apache2/sites-available/nextcloud.conf</pre></div>



<pre class="wp-block-code"><code>&lt;VirtualHost *:80>
	ServerName nextcloud.example.org
	Redirect permanent / https://nextcloud.example.org/
&lt;/VirtualHost></code></pre>



<p>The default Apache configuration gives access to a little too much &#8211; we can lock that down, and just open up the bits we want later with the site-specific configuration files.</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">sudoedit /etc/apache2/apache2.conf</pre></div>



<p>Look for this section and put a <code>#</code> at the beginning of every line so they&#8217;re ignored.</p>



<pre class="wp-block-code"><code>&lt;Directory /usr/share>
	AllowOverride None
	Require all granted
&lt;/Directory>

&lt;Directory /var/www/>
	Options Indexes FollowSymLinks
	AllowOverride None
	Require all granted
&lt;/Directory></code></pre>



<p>Now we have to give access back just where want it:</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">sudoedit /etc/apache2/sites-available/nextcloud-le-ssl.conf</pre></div>



<p>Before the <code>ErrorLog </code>line, add this:</p>



<pre class="wp-block-code"><code>&lt;Directory /var/www/nextcloud>
    Require all granted
&lt;/Directory></code></pre>



<p>Then do the same for the WordPress config:</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">sudoedit /etc/apache2/sites-available/wordpress-le-ssl.conf	</pre></div>



<p>Before the <code>ErrorLog </code>line, add this:</p>



<pre class="wp-block-code"><code>&lt;Directory /var/www/wordpress>
    Require all granted
&lt;/Directory></code></pre>



<p>Restart Apache (you should know how to do that by now &#8211; look back through the previous posts until you find it.)</p>



<h2 class="wp-block-heading">Nextcloud Administration Warnings</h2>



<p>Log into your nextcloud administrator account, click on the circle with your initial in the top right corner, choose setttings. On the page that pops up, pick Overview from the menu on the right.</p>



<p>The system will think for a moment, then show a list of warnings:</p>



<figure class="wp-block-image size-medium"><a href="https://www.sandyscott.net/wp-content/uploads/2020/05/image-43.png"><img loading="lazy" decoding="async" width="300" height="279" src="https://www.sandyscott.net/wp-content/uploads/2020/05/image-43-300x279.png" alt="" class="wp-image-599" srcset="https://www.sandyscott.net/wp-content/uploads/2020/05/image-43-300x279.png 300w, https://www.sandyscott.net/wp-content/uploads/2020/05/image-43-1024x954.png 1024w, https://www.sandyscott.net/wp-content/uploads/2020/05/image-43-768x715.png 768w, https://www.sandyscott.net/wp-content/uploads/2020/05/image-43-150x140.png 150w, https://www.sandyscott.net/wp-content/uploads/2020/05/image-43.png 1035w" sizes="(max-width: 300px) 100vw, 300px" /></a></figure>



<p>If your list is the same as mine, I&#8217;ll show you how to fix the first 2, but you can work through the others on your own if you like.</p>



<h2 class="wp-block-heading">PHP Memory Limit</h2>



<p><strong><em>&#8220;The PHP memory limit is below the recommended value of 512MB.&#8221;</em></strong></p>



<p>It isn&#8217;t essential to fix this, and if you&#8217;re running nextcloud on an old, lower powered machine I wouldn&#8217;t recommend it, because that&#8217;s the limit per script, and a script fires up every time someone access your site, so with a few users doing heavy things, you&#8217;ll have a problem.</p>



<p>If you do want to do it, edit the PHP configuration file:</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">sudoedit /etc/php/7.3/apache2/php.ini</pre></div>



<p>Find this line and change the number to what you want:</p>



<pre class="wp-block-code"><code>memory_limit = 512M</code></pre>



<p>Then restart Apache</p>



<h2 class="wp-block-heading">Enable HSTS</h2>



<p><strong><em>&#8220;The &#8220;Strict-Transport-Security&#8221; HTTP header is not set to at least &#8220;15552000&#8221; seconds. For enhanced security, it is recommended to enable HSTS as described in the <a href="https://docs.nextcloud.com/server/18/go.php?to=admin-security">security tips <img src="https://s.w.org/images/core/emoji/15.0.3/72x72/2197.png" alt="↗" class="wp-smiley" style="height: 1em; max-height: 1em;" /></a>.&#8221;</em></strong></p>



<p>You can follow that link in the tip to find out the details of how we fix this, but these are the steps:</p>



<p>Enable the Apache headers module:</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">sudo a2enmod headers</pre></div>



<p>Modify the Nextcloud apache configuration:</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">sudoedit /etc/apache2/sites-available/nextcloud-le-ssl.conf</pre></div>



<p>Add this after the ServerName line:</p>



<pre class="wp-block-code"><code>Header always set Strict-Transport-Security "max-age=15552000; includeSubDomains"</code></pre>



<p>And reload Apache</p>



<h2 class="wp-block-heading">Re-enable public access</h2>



<p>Now we&#8217;ve dealt with a few potential security issues, you can enable access to Nextcloud from outside you network.</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;sudShell&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">sudoedit /etc/apache2/sites-available/nextcloud-le-ssl.conf</pre></div>



<p>Either delete, or comment out these 3 lines. You can make a line into a comment by putting a # at the beginning of the line. That means it will be ignored.</p>



<pre class="wp-block-code"><code>&lt;Location />
    Require ip xxx.xxx.xxx.0/24
&lt;/Location></code></pre>



<p>Reload apache and you&#8217;re done!</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sandyscott.net/2020/05/server-setup-11-config-improvements/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Server Setup 10: Nextcloud Installation</title>
		<link>https://www.sandyscott.net/2020/05/server-setup-10-nextcloud-installation/</link>
					<comments>https://www.sandyscott.net/2020/05/server-setup-10-nextcloud-installation/#respond</comments>
		
		<dc:creator><![CDATA[Sandy]]></dc:creator>
		<pubDate>Thu, 21 May 2020 21:44:43 +0000</pubDate>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MariaDB]]></category>
		<category><![CDATA[Nextcloud]]></category>
		<guid isPermaLink="false">https://www.sandyscott.net/?p=575</guid>

					<description><![CDATA[Database Again, same as for WordPress, we need a database and a user. Same command to login as the root database server user: a similar set of SQL commands to set up the nextcloud database: Disable Public Access &#8211; a different way Like before, we don&#8217;t want the Nextclound site...<p> <a class="continue-reading-link" href="https://www.sandyscott.net/2020/05/server-setup-10-nextcloud-installation/"><span>Continue reading</span><i class="crycon-right-dir"></i></a> </p>]]></description>
										<content:encoded><![CDATA[
<p><em>If this is your first time looking at a post from this series, have a look at this summary: <a href="https://www.sandyscott.net/2020/06/04/server-setup-0-contents/" data-type="666">Server Setup 0: Contents</a></em></p>



<h2 class="wp-block-heading">Database</h2>



<p>Again, same as for WordPress, we need a database and a user. Same command to login as the root database server user:</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">sudo mysql -u root -p</pre></div>



<p>a similar set of SQL commands to set up the nextcloud database:</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">CREATE USER 'nc_usr'@'localhost' IDENTIFIED BY 'password';
CREATE DATABASE IF NOT EXISTS nc_db CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
GRANT ALL PRIVILEGES on nc_db.* to 'nc_usr'@'localhost';
FLUSH privileges;
EXIT;</pre></div>



<h2 class="wp-block-heading">Disable Public Access &#8211; a different way</h2>



<p>Like before, we don&#8217;t want the Nextclound site to be public until we&#8217;ve completed the installation &amp; configuration. On the other hand, we don&#8217;t want to do the same as before (cutting our server off from the internet by turning off port forwarding on the router) because we have an active WordPress installation that people might be using.</p>



<p>To do this we&#8217;ll tell Apache to only respond to requests (for the Nextcloud site) from your internal network, not from the public internet:</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;sudShell&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">sudoedit /etc/apache2/sites-available/nextcloud.conf</pre></div>



<p>Add this section, just before the <code>ErrorLog</code> line, replacing the xxx.xxx.xxx with the first 3 blocks of your IP address on your network.</p>



<pre class="wp-block-code"><code>&lt;Location />
    Require ip xxx.xxx.xxx.0/24
&lt;/Location></code></pre>



<p>Reload apache:</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;suShell&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">sudo systemctl reload apache</pre></div>



<h2 class="wp-block-heading">Download the installer script</h2>



<p>Navigate to the nextcloud folder</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">cd /var/www/nextcloud</pre></div>



<p>Download the installer script, and pass ownership of it and the entire nextcloud folder to www-data (which is apache, remember).</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">sudo wget https://download.nextcloud.com/server/installer/setup-nextcloud.php
sudo chown -R www-data:www-data /var/www/nextcloud</pre></div>



<p>We should also create a data folder outside the <code>/var/www</code> folder, which improves security:</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">sudo mkdir /var/nc_data
sudo chown -R www-data:www-data /var/nc_data</pre></div>



<h2 class="wp-block-heading">Run Installation Script</h2>



<p>On the client machine, open a browser and go to <a href="http://nextcloud.example.org/setup-nextcloud.php">nextcloud.example.org/setup-nextcloud.php</a></p>



<p>You should see the Setup Wizard, most it should be easy to understand, click your way through:</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="797" height="624" src="https://www.sandyscott.net/wp-content/uploads/2020/05/image-34.png" alt="" class="wp-image-566" srcset="https://www.sandyscott.net/wp-content/uploads/2020/05/image-34.png 797w, https://www.sandyscott.net/wp-content/uploads/2020/05/image-34-300x235.png 300w, https://www.sandyscott.net/wp-content/uploads/2020/05/image-34-768x601.png 768w, https://www.sandyscott.net/wp-content/uploads/2020/05/image-34-150x117.png 150w" sizes="(max-width: 797px) 100vw, 797px" /></figure>



<p>Put a &#8220;.&#8221; in the box like it says because the Nextcloud installer is already in the correct place</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="364" height="444" src="https://www.sandyscott.net/wp-content/uploads/2020/05/image-35.png" alt="" class="wp-image-569" srcset="https://www.sandyscott.net/wp-content/uploads/2020/05/image-35.png 364w, https://www.sandyscott.net/wp-content/uploads/2020/05/image-35-246x300.png 246w, https://www.sandyscott.net/wp-content/uploads/2020/05/image-35-123x150.png 123w" sizes="(max-width: 364px) 100vw, 364px" /></figure>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="362" height="356" src="https://www.sandyscott.net/wp-content/uploads/2020/05/image-36.png" alt="" class="wp-image-570" srcset="https://www.sandyscott.net/wp-content/uploads/2020/05/image-36.png 362w, https://www.sandyscott.net/wp-content/uploads/2020/05/image-36-300x295.png 300w, https://www.sandyscott.net/wp-content/uploads/2020/05/image-36-150x148.png 150w" sizes="(max-width: 362px) 100vw, 362px" /></figure>



<ul class="wp-block-list"><li>Enter the details for the database and database user you created above.</li><li>Make an admin account with a strong password.</li><li>Change the data folder to the one we just created:<code> /var/nc_data</code>,</li><li>I&#8217;d recommend unticking the <strong>Install recommended apps</strong> box. You can add them later if you like.</li></ul>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="315" height="1024" src="https://www.sandyscott.net/wp-content/uploads/2020/05/image-42-315x1024.png" alt="" class="wp-image-596" srcset="https://www.sandyscott.net/wp-content/uploads/2020/05/image-42-315x1024.png 315w, https://www.sandyscott.net/wp-content/uploads/2020/05/image-42-92x300.png 92w, https://www.sandyscott.net/wp-content/uploads/2020/05/image-42-46x150.png 46w, https://www.sandyscott.net/wp-content/uploads/2020/05/image-42.png 368w" sizes="(max-width: 315px) 100vw, 315px" /></figure>



<p>Once this is done you should be able to log in and start using it!</p>



<p></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sandyscott.net/2020/05/server-setup-10-nextcloud-installation/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Server Setup 9: Nextcloud Prep</title>
		<link>https://www.sandyscott.net/2020/05/server-setup-9-nextcloud-prep/</link>
					<comments>https://www.sandyscott.net/2020/05/server-setup-9-nextcloud-prep/#respond</comments>
		
		<dc:creator><![CDATA[Sandy]]></dc:creator>
		<pubDate>Thu, 21 May 2020 21:22:16 +0000</pubDate>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[certbot]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[DNS]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Nextcloud]]></category>
		<guid isPermaLink="false">https://www.sandyscott.net/?p=564</guid>

					<description><![CDATA[First, we need 1 extra PHP module: Like with WordPress, we&#8217;ll create a folder and apache configuration for Nextcloud: And we&#8217;ll use essentially the same apache configuration we used for wordpress, with a few tweaks. We&#8217;ll also create a temporary configuration for collabora while we&#8217;re here: This is just a...<p> <a class="continue-reading-link" href="https://www.sandyscott.net/2020/05/server-setup-9-nextcloud-prep/"><span>Continue reading</span><i class="crycon-right-dir"></i></a> </p>]]></description>
										<content:encoded><![CDATA[
<p><em>If this is your first time looking at a post from this series, have a look at this summary: <a href="https://www.sandyscott.net/2020/06/04/server-setup-0-contents/" data-type="666">Server Setup 0: Contents</a></em></p>



<p>First, we need 1 extra PHP module:</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;sudShell&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">sudo apt install php-gd</pre></div>



<p>Like with WordPress, we&#8217;ll create a folder and apache configuration for Nextcloud:</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">cd /var/www
sudo mkdir nextcloud
sudoedit /etc/apache2/sites-available/nextcloud.conf</pre></div>



<p>And we&#8217;ll use essentially the same apache configuration we used for wordpress, with a few tweaks.</p>



<pre class="wp-block-code"><code>&lt;VirtualHost *:80>
    ServerName nextcloud.example.org
    DocumentRoot /var/www/nextcloud
    
    &lt;Directory /var/www/nextcloud/>
        Require all granted
        AllowOverride All
        Options FollowSymLinks MultiViews

        &lt;IfModule mod_dav.c>
            Dav off
        &lt;/IfModule>
    &lt;/Directory>

    ErrorLog ${APACHE_LOG_DIR}/nextcloud_error.log
    CustomLog ${APACHE_LOG_DIR}/nextcloud_access.log combined
&lt;/VirtualHost></code></pre>



<p>We&#8217;ll also create a temporary configuration for collabora while we&#8217;re here:</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">sudoedit /etc/apache2/sites-available/collabora.conf</pre></div>



<pre class="wp-block-code"><code>&lt;VirtualHost *:80>
    ServerName collabora.example.org
    ErrorLog ${APACHE_LOG_DIR}/collabora_error.log
    CustomLog ${APACHE_LOG_DIR}/collabora_access.log combined
&lt;/VirtualHost></code></pre>



<p>This is just a barebones template that&#8217;s just enough to let us set up HTTPS later.</p>



<p>Enable the sites and reload apache:</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">sudo a2ensite nextcloud collabora
sudo systemctl reload apache2</pre></div>



<h2 class="wp-block-heading">DNS</h2>



<p>We need to create DNS Entries for Nextcloud and Collabora:</p>



<ol class="wp-block-list"><li>Log into the control panel for your domain.</li><li>Create a <strong>CNAME </strong>record<ul><li>Domain: e.g. <strong>nextcloud.example.org</strong></li><li>Data: e.g. <strong>example.org</strong> if you had a fixed IP, or the dynamic DNS server address you created e.g. <strong><strong>anotherexample.ddns.net</strong></strong></li></ul></li><li>Do the exact same for <strong>collabora.example.org</strong></li></ol>



<h2 class="wp-block-heading">HTTPS</h2>



<p>Use certbot again to enable https on both <strong>nextcloud.example.org</strong> and <strong>collabora.example.org</strong></p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">sudo certbot --apache</pre></div>



<p>When it asks you which sites you want to activate HTTPS for, you can select multiple options by putting a comma separated list. You can also choose to allow certbot to automatically reconfigure apache to <strong>Redirect</strong> (option 2 when it asks you).</p>



<p></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sandyscott.net/2020/05/server-setup-9-nextcloud-prep/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
