<?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>MariaDB &#8211; Sandy Scott&#039;s Web Spot</title>
	<atom:link href="https://www.sandyscott.net/tag/mariadb/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.sandyscott.net</link>
	<description>My little corner of the web</description>
	<lastBuildDate>Fri, 05 Jun 2020 11:37:29 +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 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 fetchpriority="high" 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 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 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>
	</channel>
</rss>
