<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet type="text/xml" href="https://www.scaleway.com/feed.xslt.xml"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><generator uri="http://jekyllrb.com" version="3.3.1">Jekyll</generator><link href="https://www.scaleway.com/feed.xml" rel="self" type="application/atom+xml" /><link href="https://www.scaleway.com/" rel="alternate" type="text/html" hreflang="en" /><updated>2019-04-02T14:49:50+00:00</updated><id>https://www.scaleway.com//</id><title type="html">Scaleway</title><subtitle>Scaleway is a cloud platform, offering SSD cloud servers for any workload starting at €0.006 on an hourly basis. Pay as you go with a simple and flexible pricing.</subtitle><author><name>Scaleway</name><email>contact@scaleway.com</email><uri>https://www.scaleway.com</uri></author><entry><title type="html">Migrating Object Storage data with Minio Client</title><link href="https://www.scaleway.com/docs/how-to-migrate-object-storage-buckets-with-minio/" rel="alternate" type="text/html" title="Migrating Object Storage data with Minio Client" /><published>2019-03-20T00:00:00+00:00</published><updated>2019-03-20T00:00:00+00:00</updated><id>https://www.scaleway.com/docs/migrate-s3</id><content type="html" xml:base="https://www.scaleway.com/docs/how-to-migrate-object-storage-buckets-with-minio/">&lt;h2 class=&quot;anchor-wrap&quot;&gt;Minio Client Overview&lt;a style=&quot;margin-left: 10px;&quot; name=&quot;-Minio-Client-Overview&quot; href=&quot;#-Minio-Client-Overview&quot;&gt;&lt;span style=&quot;font-size: 16px&quot;&gt;&lt;i class=&quot;glyphicon glyphicon-link&quot;&gt;&lt;/i&gt;&lt;/span&gt;&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;&lt;a href=&quot;https://docs.minio.io/docs/minio-client-quickstart-guide.html&quot;&gt;Minio Client&lt;/a&gt; provides a modern alternative to UNIX commands like ls, cat, cp, mirror, diff etc. It is able to communicate with any S3 compatible cloud storage provider and can be used to migrate data from one region to another.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Requirements&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;You have an account and are logged into &lt;a href=&quot;https://console.scaleway.com&quot;&gt;console.scaleway.com&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;You have &lt;a href=&quot;https://www.scaleway.com/docs/configure-new-ssh-key/&quot;&gt;configured your SSH Key&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;You have object storage buckets in two different regions&lt;/li&gt;
  &lt;/ul&gt;
&lt;/blockquote&gt;

&lt;h3 class=&quot;anchor-wrap&quot;&gt;Installing the Minio Client&lt;a style=&quot;margin-left: 10px;&quot; name=&quot;-Installing-the-Minio-Client&quot; href=&quot;#-Installing-the-Minio-Client&quot;&gt;&lt;span style=&quot;font-size: 16px&quot;&gt;&lt;i class=&quot;glyphicon glyphicon-link&quot;&gt;&lt;/i&gt;&lt;/span&gt;&lt;/a&gt;&lt;/h3&gt;

&lt;p&gt;1 . Connect to your server as &lt;code class=&quot;highlighter-rouge&quot;&gt;root&lt;/code&gt; via &lt;a href=&quot;https://www.scaleway.com/docs/create-and-connect-to-your-server/#-Logging-into-the-Instance&quot;&gt;SSH&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;2 . Update the APT packet cache and the software already installed on the instance:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;apt update &amp;amp;&amp;amp; apt upgrade -y
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;3 . Download the Minio Client:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;wget https://dl.minio.io/client/mc/release/linux-amd64/mc -P /usr/bin/
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;4 . Make the file executable:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;chmod +x /usr/bin/mc
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;h3 class=&quot;anchor-wrap&quot;&gt;Configuring the Minio Client and Migrating Data&lt;a style=&quot;margin-left: 10px;&quot; name=&quot;-Configuring-the-Minio-Client-and-Migrating-Data&quot; href=&quot;#-Configuring-the-Minio-Client-and-Migrating-Data&quot;&gt;&lt;span style=&quot;font-size: 16px&quot;&gt;&lt;i class=&quot;glyphicon glyphicon-link&quot;&gt;&lt;/i&gt;&lt;/span&gt;&lt;/a&gt;&lt;/h3&gt;

&lt;p&gt;1 . Create a directory to store the configuration file of Minio client:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mkdir ~/.mc/
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;2 . Create a configuration file for Minio Client:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;touch ~/.mc/config.json
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;3 . Open the file &lt;code class=&quot;highlighter-rouge&quot;&gt;~/.mc/config.json&lt;/code&gt; in a text editor, and edit it as follows:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
	&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;version&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;8&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
	&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;hosts&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
		&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;fr-par&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
			&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;url&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;https://s3.fr-par.scw.cloud&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
			&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;accessKey&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&amp;lt;ACCESS_KEY&amp;gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
			&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;secretKey&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&amp;lt;SECRET_KEY&amp;gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
			&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;api&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;S3v2&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
		&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
		&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;nl-ams&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
			&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;url&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;http://s3.nl-ams.scw.cloud&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
			&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;accessKey&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&amp;lt;ACCESS_KEY&amp;gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
			&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;secretKey&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&amp;lt;SECRET_KEY&amp;gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
			&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;api&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;S3v2&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
		&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Important:&lt;/strong&gt; Replace &lt;code class=&quot;highlighter-rouge&quot;&gt;&amp;lt;ACCESS_KEY&amp;gt;&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;&amp;lt;SECRET_KEY&amp;gt;&lt;/code&gt; with the credentials of your &lt;a href=&quot;https://www.scaleway.com/docs/generate-an-api-token/&quot;&gt;API token&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;3 . Start the migration of your data:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mc cp --recursive nl-ams/oldbucket fr-par/newbucket
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;The above command migrates the content from the bucket &lt;code class=&quot;highlighter-rouge&quot;&gt;oldbucket&lt;/code&gt; in the region &lt;strong&gt;NL-AMS&lt;/strong&gt; to the bucket &lt;code class=&quot;highlighter-rouge&quot;&gt;newbucket&lt;/code&gt; in the region &lt;strong&gt;FR-PAR&lt;/strong&gt;. Edit the command towards your needs before running it.&lt;/p&gt;

&lt;p&gt;Minio Client displays a status bar during the transfer, allowing to observe the status of the migration:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/docs/mc.png&quot; alt=&quot;Minio Client&quot; class=&quot;img-responsive&quot; /&gt;&lt;/p&gt;</content><author><name>Scaleway</name><email>contact@scaleway.com</email><uri>https://www.scaleway.com</uri></author><category term="advanced topics" /><category term="compute" /><category term="server" /><category term="minio" /><category term="object" /><category term="storage" /><category term="objectstorage" /><category term="s3" /><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://www.scaleway.com/assets/images/og/scaleway.png" /></entry><entry><title type="html">Ubuntu ML</title><link href="https://www.scaleway.com/imagehub/ubuntu-ml/" rel="alternate" type="text/html" title="Ubuntu ML" /><published>2019-03-14T00:00:00+00:00</published><updated>2019-03-14T00:00:00+00:00</updated><id>https://www.scaleway.com/imagehub/ubuntu-ml</id><content type="html" xml:base="https://www.scaleway.com/imagehub/ubuntu-ml/">&lt;p&gt;Ubuntu is a Debian-based Linux operating system, with Unity as its default desktop environment. It is based on free software and named after the Southern African philosophy of ubuntu (literally, “human-ness”), which often is translated as “humanity towards others” or “the belief in a universal bond of sharing that connects all humanity”.&lt;/p&gt;

&lt;p&gt;We’ve included everything you need to make full use of your GPU, and it comes with conda pre-installed.&lt;/p&gt;</content><author><name>Scaleway</name></author><category term="marketplace" /><category term="distribution" /></entry><entry><title type="html">Configuring NGINX with Let’s Encrypt</title><link href="https://www.scaleway.com/docs/how-to-configure-nginx-with-lets-encrypt/" rel="alternate" type="text/html" title="Configuring NGINX with Let's Encrypt" /><published>2019-02-28T00:00:00+00:00</published><updated>2019-02-28T00:00:00+00:00</updated><id>https://www.scaleway.com/docs/configure-nginx-letsencrypt</id><content type="html" xml:base="https://www.scaleway.com/docs/how-to-configure-nginx-with-lets-encrypt/">&lt;h2 class=&quot;anchor-wrap&quot;&gt;Let's Encrypt Overview&lt;a style=&quot;margin-left: 10px;&quot; name=&quot;-Lets-Encrypt-Overview&quot; href=&quot;#-Lets-Encrypt-Overview&quot;&gt;&lt;span style=&quot;font-size: 16px&quot;&gt;&lt;i class=&quot;glyphicon glyphicon-link&quot;&gt;&lt;/i&gt;&lt;/span&gt;&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;&lt;a href=&quot;https://www.letsencrypt.org/&quot;&gt;Let’s Encrypt&lt;/a&gt; is a &lt;a href=&quot;https://en.wikipedia.org/wiki/Certificate_authority&quot;&gt;Certificate Authority (CA)&lt;/a&gt; that provides free TLS/SSL certificates to enable &lt;a href=&quot;https://en.wikipedia.org/wiki/HTTPS&quot;&gt;HTTPS&lt;/a&gt; on web servers. They provide a software client called Certbot to automatize most of the steps required to obtain a certificate and to configure it within the Nginx web server.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Requirements&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;You have an account and are logged into &lt;a href=&quot;https://console.scaleway.com&quot;&gt;console.scaleway.com&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;You have &lt;a href=&quot;https://www.scaleway.com/docs/configure-new-ssh-key/&quot;&gt;configured your SSH Key&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;You have a registered domain name pointed to your web server&lt;/li&gt;
    &lt;li&gt;You have a virtual cloud server running on Ubuntu Bionic Beaver (18.04)&lt;/li&gt;
  &lt;/ul&gt;
&lt;/blockquote&gt;

&lt;h3 class=&quot;anchor-wrap&quot;&gt;Installing the NGINX web server&lt;a style=&quot;margin-left: 10px;&quot; name=&quot;-Installing-the-NGINX-web-server&quot; href=&quot;#-Installing-the-NGINX-web-server&quot;&gt;&lt;span style=&quot;font-size: 16px&quot;&gt;&lt;i class=&quot;glyphicon glyphicon-link&quot;&gt;&lt;/i&gt;&lt;/span&gt;&lt;/a&gt;&lt;/h3&gt;

&lt;p&gt;1 . Connect to your server as &lt;code class=&quot;highlighter-rouge&quot;&gt;root&lt;/code&gt; via &lt;a href=&quot;https://www.scaleway.com/docs/create-and-connect-to-your-server/#-Logging-into-the-Instance&quot;&gt;SSH&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;2 . Update the APT packet cache and the software already installed on the instance:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;apt update &amp;amp;&amp;amp; apt upgrade -y
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;3 . Install the &lt;a href=&quot;https://nginx.org/en/&quot;&gt;Nginx&lt;/a&gt; web server via APT:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;apt install nginx -y
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;h3 class=&quot;anchor-wrap&quot;&gt;Configuring a Server Block&lt;a style=&quot;margin-left: 10px;&quot; name=&quot;-Configuring-a-Server-Block&quot; href=&quot;#-Configuring-a-Server-Block&quot;&gt;&lt;span style=&quot;font-size: 16px&quot;&gt;&lt;i class=&quot;glyphicon glyphicon-link&quot;&gt;&lt;/i&gt;&lt;/span&gt;&lt;/a&gt;&lt;/h3&gt;

&lt;p&gt;The default installation of Nginx on Ubuntu Bionic Beaver comes with one pre-defined server block that listens on port 80. While it is possible to host a single site by putting the content into the directory &lt;strong&gt;/var/www/html&lt;/strong&gt;, it would not be possible to host multiple sites one the same instance. To avoid this problem, server blocks can be configured. These specify a directory for the content that will be served when requesting a specific site. The content of &lt;strong&gt;/var/www/html&lt;/strong&gt; will be served as the default directory, if a request does not match any other site configured.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Important:&lt;/strong&gt; In this tutorial the domain name &lt;strong&gt;example.com&lt;/strong&gt; will be used. You should replace it with your own domain name while setting up your instance.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;1 . Create the directory for your domain name. Using the &lt;code class=&quot;highlighter-rouge&quot;&gt;-p&lt;/code&gt; flag will create any required parent directory in case they do not exist:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mkdir -p /var/www/example.com/html
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;2 . Create a place holder page that will be displayed when accessing your domain:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;nano /var/www/example.com/html/index.html
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;3 . Put some content like the following into the file which will be displayed to a user when requesting your site. Save and quit nano once you have edited the file:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
        &lt;span class=&quot;nt&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;Welcome to example.com&lt;span class=&quot;nt&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
        &lt;span class=&quot;nt&quot;&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;Hello World!&lt;span class=&quot;nt&quot;&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
        &lt;span class=&quot;nt&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;You have accessed the example.com website.&lt;span class=&quot;nt&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;4 . To serve the site, a server block is required. Create the block in the directory &lt;strong&gt;/etc/nginx/sites-available/&lt;/strong&gt;:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;nano /etc/nginx/sites-available/example.com
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;And put the following content into it:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;server {
        listen 80;
        listen [::]:80;

        root /var/www/example.com/html;
        index index.html index.htm;

        server_name example.com www.example.com;

        location / {
                try_files $uri $uri/ =404;
        }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Important:&lt;/strong&gt; Edit the lines &lt;code class=&quot;highlighter-rouge&quot;&gt;root&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;server_name&lt;/code&gt; according to your domain name.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;5 . Enable the file by linking it to the &lt;strong&gt;sites-enabled&lt;/strong&gt; directory, to enable the server block during Nginx startup:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;ln -s /etc/nginx/sites-available/example.com /etc/nginx/sites-enabled/
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;6 . Verify if there are no errors in the configuration file before restarting Nginx:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;nginx -t
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;7 . Restart the Nginx web server:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;systemctl restart nginx
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;8 . When typing &lt;em&gt;http://example.com&lt;/em&gt; in your browser, you should see your newly created place holder page:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/docs/letsencrypt/example_site.png&quot; alt=&quot;example.com website&quot; class=&quot;img-responsive&quot; /&gt;&lt;/p&gt;

&lt;h3 class=&quot;anchor-wrap&quot;&gt;Installing Cerbot and Obtaining a Certificate&lt;a style=&quot;margin-left: 10px;&quot; name=&quot;-Installing-Cerbot-and-Obtaining-a-Certificate&quot; href=&quot;#-Installing-Cerbot-and-Obtaining-a-Certificate&quot;&gt;&lt;span style=&quot;font-size: 16px&quot;&gt;&lt;i class=&quot;glyphicon glyphicon-link&quot;&gt;&lt;/i&gt;&lt;/span&gt;&lt;/a&gt;&lt;/h3&gt;

&lt;p&gt;1 . Certbot is in active development and it is possible, that the packages included in Ubuntu are already Outdated. Therefore add the Certbot repository to apt to download the latest release of the software:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;add-apt-repository ppa:certbot/certbot
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Press &lt;strong&gt;Enter&lt;/strong&gt; when asked to confirm the action.&lt;/p&gt;

&lt;p&gt;2 . Install Certbot for Nginx:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;apt install python-certbot-nginx -y
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;3 . Launch the certificate generation:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;certbot --nginx -d example.com -d www.example.com
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Important:&lt;/strong&gt; The parameter &lt;code class=&quot;highlighter-rouge&quot;&gt;-d&lt;/code&gt; specifies the domains for which you want to request a certificate. Make sure to replace it with your own domain name. Also keep in mind that if you want to have a certificate for &lt;em&gt;example.com&lt;/em&gt; and for &lt;em&gt;www.example.com&lt;/em&gt; you have to specify both.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;When running Certbot for the first time, you will be asked to enter your email address. Confirm it by pressing &lt;strong&gt;Enter&lt;/strong&gt; on your keyboard.&lt;/p&gt;

&lt;p&gt;4 . Once confirmed Certbot will run a challenge and request the certificate. When asked to redirect all traffic to HTTPS, press &lt;strong&gt;2&lt;/strong&gt;, then &lt;strong&gt;Enter&lt;/strong&gt; on your keyboard:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: No redirect - Make no further changes to the webserver configuration.
2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for
new sites, or if you're confident your site works on HTTPS. You can undo this
change by editing your web server's configuration.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate number [1-2] then [enter] (press 'c' to cancel):
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Certbot will now reconfigure Nginx and once you see the following message your certificate is successfully installed:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/example.com/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/example.com/privkey.pem
   Your cert will expire on 2019-04-15. To obtain a new or tweaked
   version of this certificate in the future, simply run certbot again
   with the &quot;certonly&quot; option. To non-interactively renew *all* of
   your certificates, run &quot;certbot renew&quot;
 - Your account credentials have been saved in your Certbot
   configuration directory at /etc/letsencrypt. You should make a
   secure backup of this folder now. This configuration directory will
   also contain certificates and private keys obtained by Certbot so
   making regular backups of this folder is ideal.
 - If you like Certbot, please consider supporting our work by:

   Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
   Donating to EFF:                    https://eff.org/donate-le
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;You can now open your web browser and type &lt;em&gt;http&lt;strong&gt;s&lt;/strong&gt;://example.com&lt;/em&gt; to verify that your connection is secure:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/docs/letsencrypt/example_https.png&quot; alt=&quot;example.com website https&quot; class=&quot;img-responsive&quot; /&gt;&lt;/p&gt;</content><author><name>Scaleway</name><email>contact@scaleway.com</email><uri>https://www.scaleway.com</uri></author><category term="advanced topics" /><category term="compute" /><category term="server" /><category term="teamspeak" /><category term="voice" /><category term="audio" /><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://www.scaleway.com/assets/images/og/scaleway.png" /></entry><entry><title type="html">Installing Mattermost Messaging on Ubuntu 18.04</title><link href="https://www.scaleway.com/docs/installing-mattermost-messaging-ubuntu-bionic/" rel="alternate" type="text/html" title="Installing Mattermost Messaging on Ubuntu 18.04" /><published>2019-01-22T00:00:00+00:00</published><updated>2019-01-22T00:00:00+00:00</updated><id>https://www.scaleway.com/docs/install-mattermost</id><content type="html" xml:base="https://www.scaleway.com/docs/installing-mattermost-messaging-ubuntu-bionic/">&lt;h2 class=&quot;anchor-wrap&quot;&gt;Mattermost Overview&lt;a style=&quot;margin-left: 10px;&quot; name=&quot;-Mattermost-Overview&quot; href=&quot;#-Mattermost-Overview&quot;&gt;&lt;span style=&quot;font-size: 16px&quot;&gt;&lt;i class=&quot;glyphicon glyphicon-link&quot;&gt;&lt;/i&gt;&lt;/span&gt;&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;&lt;a href=&quot;https://www.mattermost.com/&quot;&gt;Mattermost&lt;/a&gt; is an open-source messaging tool for inter-team communication, released under the MIT license and available both in a free team and paid enterprise edition. This tutorial will show you how to install a Mattermost instance with a NGINX frontend proxy and a MariaDB database.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Requirements&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;You have an account and are logged into &lt;a href=&quot;https://console.scaleway.com&quot;&gt;console.scaleway.com&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;You have &lt;a href=&quot;https://www.scaleway.com/docs/configure-new-ssh-key/&quot;&gt;configured your SSH Key&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;You have a cloud compute instance running on Ubuntu Bionic Beaver&lt;/li&gt;
  &lt;/ul&gt;
&lt;/blockquote&gt;

&lt;h3 class=&quot;anchor-wrap&quot;&gt;Installing Mattermost&lt;a style=&quot;margin-left: 10px;&quot; name=&quot;-Installing-Mattermost&quot; href=&quot;#-Installing-Mattermost&quot;&gt;&lt;span style=&quot;font-size: 16px&quot;&gt;&lt;i class=&quot;glyphicon glyphicon-link&quot;&gt;&lt;/i&gt;&lt;/span&gt;&lt;/a&gt;&lt;/h3&gt;

&lt;p&gt;1 . Connect to your compute instance via &lt;a href=&quot;https://www.scaleway.com/docs/create-and-connect-to-your-server/#-Logging-into-the-Instance&quot;&gt;SSH&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;2 . Update the APT packet cache and the software already installed on the instance:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;apt update &amp;amp;&amp;amp; apt upgrade -y
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;3 . Install the &lt;a href=&quot;https://www.scaleway.com/docs/how-to-install-mariadb-on-ubuntu/&quot;&gt;MariaDB database server&lt;/a&gt;:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;apt install mariadb-server
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;4 . Initialize the database server:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mysql_secure_installation
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;5 . Log into mysql as root:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mysql
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;6 . Create a database for Mattermost:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;create user 'mattermost'@'localhost' identified by 'a-secure-password';
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Important:&lt;/strong&gt; Replace &lt;code class=&quot;highlighter-rouge&quot;&gt;a-secure-password&lt;/code&gt; with a &lt;a href=&quot;https://strongpasswordgenerator.com/&quot;&gt;strong password&lt;/a&gt;, as it will be used to login to MariaDB&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;7 . Create a database for Mattermost whilst being logged into the MariaDB shell:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;create database mattermost;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;8 . Grant access privileges to the user &lt;em&gt;mattermost&lt;/em&gt;:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;grant all privileges on mattermost.* to 'mattermost'@'localhost';
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;9 . Exit the MariaDB shell:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;exit
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;10 . Download the &lt;a href=&quot;https://mattermost.com/download/&quot;&gt;latest version&lt;/a&gt; of the Mattermost server to your instance. At the time writing this tutorial it is version 5.7:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;wget https://releases.mattermost.com/5.7.0/mattermost-5.7.0-linux-amd64.tar.gz
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;11 . Extract the Mattermost server files:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;tar -xvzf mattermost*.gz
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;12 . Move the extracted files to the &lt;strong&gt;/opt&lt;/strong&gt; directory:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mv mattermost /opt
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;13 . Create the storage directory for Mattermost:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mkdir /opt/mattermost/data
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Important:&lt;/strong&gt; This directory will contain all data sent to your Mattermost instance (Messages, Images, Files etc.). Make sure that it has enough space available for the anticipated number of contents sent to your instance.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;14 . Set up a system user and group to be in charge of running the service and set the ownership and permissions as following:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Create a system user and group called &lt;em&gt;mattermost&lt;/em&gt;:
    &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;useradd --system --user-group mattermost
&lt;/code&gt;&lt;/pre&gt;
    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;Set the ownership of the Mattermost files to the previously created user and group:
    &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;chown -R mattermost:mattermost /opt/mattermost
&lt;/code&gt;&lt;/pre&gt;
    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;Give write permissions to the &lt;em&gt;mattermost&lt;/em&gt; group:
    &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;chmod -R g+w /opt/mattermost
&lt;/code&gt;&lt;/pre&gt;
    &lt;/div&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;15 . Open the file &lt;strong&gt;/opt/mattermost/config/config.json&lt;/strong&gt; with your favourite text editor and edit the database settings as following:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Set the &lt;code class=&quot;highlighter-rouge&quot;&gt;&quot;DriverName&quot;&lt;/code&gt; to &lt;code class=&quot;highlighter-rouge&quot;&gt;mysql&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;Configure &lt;code class=&quot;highlighter-rouge&quot;&gt;&quot;DataSource&quot;&lt;/code&gt; as following, replacing &lt;a-secret-password&gt; with the password you have set for your database:&lt;/a-secret-password&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&quot;mattermost:&amp;lt;a-secret-password&amp;gt;@tcp(localhost:3306)/mattermost?charset=utf8mb4,utf8&amp;amp;readTimeout=30s&amp;amp;writeTimeout=30s&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;16 . Start the Mattermost server manually to check everything is working:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo -u mattermost ./bin/mattermost
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;During startup the database structure of Mattermost will be configured and you will see some log messages as well as a notice: &lt;code class=&quot;highlighter-rouge&quot;&gt;Server is listening on :8065&lt;/code&gt;. This means your Mattermost server is now ready to be used. Stop the process by pushing &lt;strong&gt;Control+C&lt;/strong&gt; on your keyboard.&lt;/p&gt;

&lt;p&gt;17 . Open your favourite text editor and create the file &lt;strong&gt;/lib/systemd/system/mattermost.service&lt;/strong&gt; with the following content to create a systemd script to run the application as a service on your instance:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;[Unit]
Description=Mattermost
After=network.target
After=mysql.service
Requires=mysql.service

[Service]
Type=notify
ExecStart=/opt/mattermost/bin/mattermost
TimeoutStartSec=3600
Restart=always
RestartSec=10
WorkingDirectory=/opt/mattermost
User=mattermost
Group=mattermost
LimitNOFILE=49152

[Install]
WantedBy=mysql.service
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;18 . Reload the systemd configuration:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;systemctl daemon-reload
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;19 . Start the service:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;systemctl start mattermost.service
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;20 . Enable the service to start Mattermost during the startup of the instance:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;systemctl enable mattermost.service
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;You can now connect to your Mattermost server at &lt;code class=&quot;highlighter-rouge&quot;&gt;http://your_servers_ip:8065&lt;/code&gt; and create your first user and do some initial configuration and setup.&lt;/p&gt;

&lt;h3 class=&quot;anchor-wrap&quot;&gt;Installing a Nginx Proxy with Let's Encrypt&lt;a style=&quot;margin-left: 10px;&quot; name=&quot;-Installing-a-Nginx-Proxy-with-Lets-Encrypt&quot; href=&quot;#-Installing-a-Nginx-Proxy-with-Lets-Encrypt&quot;&gt;&lt;span style=&quot;font-size: 16px&quot;&gt;&lt;i class=&quot;glyphicon glyphicon-link&quot;&gt;&lt;/i&gt;&lt;/span&gt;&lt;/a&gt;&lt;/h3&gt;

&lt;p&gt;For security reasons it is recommended to put the application behind a proxy. Nginx is being used as frontend for the application. To provide an encrypted connection, &lt;a href=&quot;https://certbot.eff.org/&quot;&gt;certbot&lt;/a&gt; is used to generate a free &lt;a href=&quot;https://letsencrypt.org/&quot;&gt;Let’s Encrypt&lt;/a&gt; SSL certificate to encrypt the connection to the instance.&lt;/p&gt;

&lt;p&gt;1 . Install Nginx and Certbot:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;apt install nginx python-certbot-nginx -y
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;2 . Create a new server block for Mattermost (replace &lt;code class=&quot;highlighter-rouge&quot;&gt;mattermost.example.com&lt;/code&gt; with the FQDN of your instance):&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;touch /etc/nginx/sites-available/mattermost.example.com
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;and put the following content into the file:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;upstream backend {
   server 127.0.0.1:8065;
   keepalive 32;
}

proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=mattermost_cache:10m max_size=3g inactive=120m use_temp_path=off;

server {
   listen 80;
   server_name    mattermost.example.com;

   location ~ /api/v[0-9]+/(users/)?websocket$ {
       proxy_set_header Upgrade $http_upgrade;
       proxy_set_header Connection &quot;upgrade&quot;;
       client_max_body_size 50M;
       proxy_set_header Host $http_host;
       proxy_set_header X-Real-IP $remote_addr;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
       proxy_set_header X-Forwarded-Proto $scheme;
       proxy_set_header X-Frame-Options SAMEORIGIN;
       proxy_buffers 256 16k;
       proxy_buffer_size 16k;
       client_body_timeout 60;
       send_timeout 300;
       lingering_timeout 5;
       proxy_connect_timeout 90;
       proxy_send_timeout 300;
       proxy_read_timeout 90s;
       proxy_pass http://backend;
   }

   location / {
       client_max_body_size 50M;
       proxy_set_header Connection &quot;&quot;;
       proxy_set_header Host $http_host;
       proxy_set_header X-Real-IP $remote_addr;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
       proxy_set_header X-Forwarded-Proto $scheme;
       proxy_set_header X-Frame-Options SAMEORIGIN;
       proxy_buffers 256 16k;
       proxy_buffer_size 16k;
       proxy_read_timeout 600s;
       proxy_cache mattermost_cache;
       proxy_cache_revalidate on;
       proxy_cache_min_uses 2;
       proxy_cache_use_stale timeout;
       proxy_cache_lock on;
       proxy_http_version 1.1;
       proxy_pass http://backend;
   }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;3 . Remove the default server block of Nginx:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;rm /etc/nginx/sites-enabled/default
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;4 . Enable the Mattermost server block by linking it to the sites-enabled directory:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;ln -s /etc/nginx/sites-available/mattermost.example.com /etc/nginx/sites-enabled/mattermost.example.com
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;5 . Restart Nginx:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo service nginx restart
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;6 . Run Certbot:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;certbot
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Important:&lt;/strong&gt; The application will ask you several questions. You have to confirm the steps as described. For more information refer to our documentation about certbot.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;7 . Connect to your instance by going to &lt;code class=&quot;highlighter-rouge&quot;&gt;https://your_servers_ip&lt;/code&gt;. The Mattermost login screen will appear. Connect yourself with the user you have created during the initial setup of the application.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/docs/mattermost/mattermost-login.png&quot; alt=&quot;Mattermost Login&quot; class=&quot;img-responsive&quot; /&gt;&lt;/p&gt;

&lt;p&gt;8 . Once logged in click on the menu button, then on &lt;strong&gt;System Console&lt;/strong&gt; to enter the configuration interface of Mattermost.&lt;/p&gt;

&lt;p&gt;9 . Inside the general settings section, click on &lt;strong&gt;Configuration&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;10 . Configure the &lt;strong&gt;Listen Address&lt;/strong&gt; as &lt;strong&gt;127.0.0.1:8065&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/docs/mattermost/mattermost-listen-address.png&quot; alt=&quot;Mattermost Configuration&quot; class=&quot;img-responsive&quot; /&gt;&lt;/p&gt;

&lt;p&gt;This prevents direct connections to Mattermost from other machines.&lt;/p&gt;

&lt;p&gt;11 . Restart the Mattermost service:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;systemctl restart mattermost.service
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;12 . Reload the Mattermost application in your browser. The basic configuration has been done now, you can start chatting:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/docs/mattermost/mattermost-interface.png&quot; alt=&quot;Mattermost Chat&quot; class=&quot;img-responsive&quot; /&gt;&lt;/p&gt;

&lt;p&gt;You may configure advanced settings, like email notifications and other customizations of your Mattermost application. For more information, refer to the &lt;a href=&quot;https://docs.mattermost.com/&quot;&gt;official documentation&lt;/a&gt;.&lt;/p&gt;</content><author><name>Scaleway</name><email>contact@scaleway.com</email><uri>https://www.scaleway.com</uri></author><category term="advanced topics" /><category term="compute" /><category term="communication" /><category term="messaging" /><category term="mattermost" /><category term="slack" /><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://www.scaleway.com/assets/images/og/scaleway.png" /></entry><entry><title type="html">How to Create your first GPU Instance</title><link href="https://www.scaleway.com/docs/create-gpu-instance/" rel="alternate" type="text/html" title="How to Create your first GPU Instance" /><published>2019-01-21T00:00:00+00:00</published><updated>2019-01-21T00:00:00+00:00</updated><id>https://www.scaleway.com/docs/GPU</id><content type="html" xml:base="https://www.scaleway.com/docs/create-gpu-instance/">&lt;h1 class=&quot;anchor-wrap&quot;&gt;GPU Overview&lt;a style=&quot;margin-left: 10px;&quot; name=&quot;-GPU-Overview&quot; href=&quot;#-GPU-Overview&quot;&gt;&lt;span style=&quot;font-size: 16px&quot;&gt;&lt;i class=&quot;glyphicon glyphicon-link&quot;&gt;&lt;/i&gt;&lt;/span&gt;&lt;/a&gt;&lt;/h1&gt;

&lt;p&gt;GPU servers are designed for artificial intelligence, machine learning and complex modeling. They are equipped with high-end GPUs and huge quantity of cores, memory and storage. In short, GPUs are optimized for taking huge batches of data and performing the same operation over and over very quickly.&lt;/p&gt;

&lt;p&gt;There are six steps to provision a new GPU server:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Choose an image&lt;/li&gt;
  &lt;li&gt;Choose a region&lt;/li&gt;
  &lt;li&gt;Choose a GPU Instance&lt;/li&gt;
  &lt;li&gt;Configure storage&lt;/li&gt;
  &lt;li&gt;Configure advanced options&lt;/li&gt;
  &lt;li&gt;Name and tag the instance&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Important&lt;/strong&gt;: Your SSH public keys are fetched during the boot process.&lt;/p&gt;

&lt;p&gt;If you upload them to the management console after your server is booted, they will &lt;em&gt;not&lt;/em&gt; be added to your &lt;code class=&quot;highlighter-rouge&quot;&gt;authorized_keys&lt;/code&gt; file.&lt;/p&gt;

&lt;p&gt;If you do not want the keys to be downloaded during the next boot, execute the following command on your server:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;root@c1-X-Y-Z-T:~# echo manual &amp;gt; /etc/init/ssh-keys.override
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Requirements&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;You have an account and are logged into &lt;a href=&quot;//console.scaleway.com&quot;&gt;console.scaleway.com&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;You have &lt;a href=&quot;https://www.scaleway.com/docs/configure-new-ssh-key/&quot;&gt;configured your SSH Key&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;
&lt;/blockquote&gt;

&lt;h2 class=&quot;anchor-wrap&quot;&gt;Creating a GPU Server&lt;a style=&quot;margin-left: 10px;&quot; name=&quot;-Creating-a-GPU-Server&quot; href=&quot;#-Creating-a-GPU-Server&quot;&gt;&lt;span style=&quot;font-size: 16px&quot;&gt;&lt;i class=&quot;glyphicon glyphicon-link&quot;&gt;&lt;/i&gt;&lt;/span&gt;&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;In the Compute section of the side menu, click &lt;strong&gt;Compute&lt;/strong&gt;. If you do not have an instance already created, the product presentation is displayed.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/docs/gpu/compute_create_server.png&quot; alt=&quot;Compute Home&quot; class=&quot;img-responsive&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Click &lt;strong&gt;Create a server&lt;/strong&gt;. The creation page displays.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; GPU instances are currently available on request. Please open a &lt;a href=&quot;https://console.scaleway.com/support/create&quot;&gt;support ticket&lt;/a&gt; to request a GPU instance quota for your account.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3 class=&quot;anchor-wrap&quot;&gt;Choosing an Image&lt;a style=&quot;margin-left: 10px;&quot; name=&quot;-Choosing-an-Image&quot; href=&quot;#-Choosing-an-Image&quot;&gt;&lt;span style=&quot;font-size: 16px&quot;&gt;&lt;i class=&quot;glyphicon glyphicon-link&quot;&gt;&lt;/i&gt;&lt;/span&gt;&lt;/a&gt;&lt;/h3&gt;

&lt;p&gt;Start by choosing an image for the cloud instance.&lt;/p&gt;

&lt;p&gt;You can choose an image from five sources:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/docs/gpu/ubuntu_ml.png&quot; alt=&quot;GPU OS&quot; class=&quot;img-responsive&quot; /&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;OS Images&lt;/strong&gt;: Choose your favourite basic Linux distribution, ready to be configured by you.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;GPU OS&lt;/strong&gt;: Choose an Ubuntu Bionic (18.04) optimized for &lt;strong&gt;Machine Learning&lt;/strong&gt;. It comes preinstalled with everything you need to fully use your GPU and Anaconda, the most complete python distribution.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;InstantApps&lt;/strong&gt;: We provide an up-to-date list different pre-installed applications.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;My images&lt;/strong&gt;: You can populate your own list of server templates. &lt;a href=&quot;https://www.scaleway.com/docs/create-an-image-from-my-server/&quot;&gt;See also Create your own image&lt;/a&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Snapshots&lt;/strong&gt;: You can recover a server from a previously saved state. &lt;a href=&quot;https://www.scaleway.com/docs/backup-your-data-with-snapshots&quot;&gt;See also Backup your data with snapshots&lt;/a&gt;&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h3 class=&quot;anchor-wrap&quot;&gt;Choosing a Region&lt;a style=&quot;margin-left: 10px;&quot; name=&quot;-Choosing-a-Region&quot; href=&quot;#-Choosing-a-Region&quot;&gt;&lt;span style=&quot;font-size: 16px&quot;&gt;&lt;i class=&quot;glyphicon glyphicon-link&quot;&gt;&lt;/i&gt;&lt;/span&gt;&lt;/a&gt;&lt;/h3&gt;

&lt;p&gt;You can choose a region in which your instance will be deployed geographically.&lt;/p&gt;

&lt;p&gt;Currently we provide the following locations for GPU instances:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;PAR1&lt;/strong&gt;: Paris, France&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 class=&quot;anchor-wrap&quot;&gt;Choosing the GPU Instance&lt;a style=&quot;margin-left: 10px;&quot; name=&quot;-Choosing-the-GPU-Instance&quot; href=&quot;#-Choosing-the-GPU-Instance&quot;&gt;&lt;span style=&quot;font-size: 16px&quot;&gt;&lt;i class=&quot;glyphicon glyphicon-link&quot;&gt;&lt;/i&gt;&lt;/span&gt;&lt;/a&gt;&lt;/h3&gt;

&lt;p&gt;Click on the GPU tab to deploy a GPU instance:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/docs/gpu/compute_render_s.png&quot; alt=&quot;GPU Instances tab&quot; class=&quot;img-responsive&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Currently &lt;strong&gt;RENDER-S&lt;/strong&gt; instances are available, featuring a Nvidia Tesla P100 16GB, 10 vCores and 400GB SSD storage space.&lt;/p&gt;

&lt;h3 class=&quot;anchor-wrap&quot;&gt;Configuring Volumes&lt;a style=&quot;margin-left: 10px;&quot; name=&quot;-Configuring-Volumes&quot; href=&quot;#-Configuring-Volumes&quot;&gt;&lt;span style=&quot;font-size: 16px&quot;&gt;&lt;i class=&quot;glyphicon glyphicon-link&quot;&gt;&lt;/i&gt;&lt;/span&gt;&lt;/a&gt;&lt;/h3&gt;

&lt;p&gt;Each RENDER-S instance comes with a fixed volume size of 400GB.&lt;/p&gt;

&lt;h3 class=&quot;anchor-wrap&quot;&gt;Configuring Advanced Options&lt;a style=&quot;margin-left: 10px;&quot; name=&quot;-Configuring-Advanced-Options&quot; href=&quot;#-Configuring-Advanced-Options&quot;&gt;&lt;span style=&quot;font-size: 16px&quot;&gt;&lt;i class=&quot;glyphicon glyphicon-link&quot;&gt;&lt;/i&gt;&lt;/span&gt;&lt;/a&gt;&lt;/h3&gt;

&lt;p&gt;You can configure advanced options of your server, including:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;&lt;a href=&quot;https://blog.online.net/2016/03/31/introducing-native-ipv6-connectivity-on-scaleway/&quot;&gt;IPv6 connectivity&lt;/a&gt;&lt;/strong&gt;&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;&lt;a href=&quot;https://www.scaleway.com/docs/how-to-use-cloud-init-to-configure-your-server-at-first-boot/&quot;&gt;Cloud Init&lt;/a&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 class=&quot;anchor-wrap&quot;&gt;Naming and tagging the instance&lt;a style=&quot;margin-left: 10px;&quot; name=&quot;-Naming-and-tagging-the-instance&quot; href=&quot;#-Naming-and-tagging-the-instance&quot;&gt;&lt;span style=&quot;font-size: 16px&quot;&gt;&lt;i class=&quot;glyphicon glyphicon-link&quot;&gt;&lt;/i&gt;&lt;/span&gt;&lt;/a&gt;&lt;/h3&gt;

&lt;p&gt;Edit the following information about the instance:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;The instances name&lt;/li&gt;
  &lt;li&gt;The tag you want to assign to it (optional). Tags let you organize your servers, you can assign any tag to each server.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 class=&quot;anchor-wrap&quot;&gt;Starting the Instance&lt;a style=&quot;margin-left: 10px;&quot; name=&quot;-Starting-the-Instance&quot; href=&quot;#-Starting-the-Instance&quot;&gt;&lt;span style=&quot;font-size: 16px&quot;&gt;&lt;i class=&quot;glyphicon glyphicon-link&quot;&gt;&lt;/i&gt;&lt;/span&gt;&lt;/a&gt;&lt;/h3&gt;

&lt;p&gt;Click the “Create a new Server” button. This action launches the create server action. The instance will be ready soon after.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/docs/gpu/compute_boot_server.png&quot; alt=&quot;Instance booting&quot; class=&quot;img-responsive&quot; /&gt;&lt;/p&gt;

&lt;h3 class=&quot;anchor-wrap&quot;&gt;Logging to your GPU Instance&lt;a style=&quot;margin-left: 10px;&quot; name=&quot;-Logging-to-your-GPU-Instance&quot; href=&quot;#-Logging-to-your-GPU-Instance&quot;&gt;&lt;span style=&quot;font-size: 16px&quot;&gt;&lt;i class=&quot;glyphicon glyphicon-link&quot;&gt;&lt;/i&gt;&lt;/span&gt;&lt;/a&gt;&lt;/h3&gt;

&lt;p&gt;On a Mac, Windows or Linux computer, you can follow the tutorial on &lt;a href=&quot;https://www.scaleway.com/docs/create-and-connect-to-your-server/#-Logging-into-the-Instance&quot;&gt;Logging into the Instance&lt;/a&gt;.&lt;/p&gt;

&lt;h2 class=&quot;anchor-wrap&quot;&gt;Going Further&lt;a style=&quot;margin-left: 10px;&quot; name=&quot;-Going-Further&quot; href=&quot;#-Going-Further&quot;&gt;&lt;span style=&quot;font-size: 16px&quot;&gt;&lt;i class=&quot;glyphicon glyphicon-link&quot;&gt;&lt;/i&gt;&lt;/span&gt;&lt;/a&gt;&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.scaleway.com/faq/servers/&quot;&gt;FAQ&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content><author><name>Scaleway</name><email>contact@scaleway.com</email><uri>https://www.scaleway.com</uri></author><category term="getting started" /><category term="compute" /><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://www.scaleway.com/assets/images/docs/og.png" /></entry><entry><title type="html">Installing OpenVPN on Ubuntu Bionic Beaver</title><link href="https://www.scaleway.com/docs/installing-openvpn-vpn-ubuntu/" rel="alternate" type="text/html" title="Installing OpenVPN on Ubuntu Bionic Beaver" /><published>2019-01-16T00:00:00+00:00</published><updated>2019-01-16T00:00:00+00:00</updated><id>https://www.scaleway.com/docs/install-openvpn</id><content type="html" xml:base="https://www.scaleway.com/docs/installing-openvpn-vpn-ubuntu/">&lt;h2 class=&quot;anchor-wrap&quot;&gt;OpenVPN Overview&lt;a style=&quot;margin-left: 10px;&quot; name=&quot;-OpenVPN-Overview&quot; href=&quot;#-OpenVPN-Overview&quot;&gt;&lt;span style=&quot;font-size: 16px&quot;&gt;&lt;i class=&quot;glyphicon glyphicon-link&quot;&gt;&lt;/i&gt;&lt;/span&gt;&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;&lt;a href=&quot;https://openvpn.net/community/&quot;&gt;OpenVPN&lt;/a&gt; is an open-source software to run a &lt;a href=&quot;https://en.wikipedia.org/wiki/Virtual_private_network&quot;&gt;virtual private network (VPN)&lt;/a&gt; to create secure point-to-point or site-to-site connections in routed or bridged configurations. The software uses a proprietary security protocol that uses SSL/TLS for key exchange.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Requirements&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;You have an account and are logged into &lt;a href=&quot;https://console.scaleway.com&quot;&gt;console.scaleway.com&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;You have &lt;a href=&quot;https://www.scaleway.com/docs/configure-new-ssh-key/&quot;&gt;configured your SSH Key&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;You have a &lt;a href=&quot;https://www.scaleway.com/virtual-cloud-servers/&quot;&gt;virtual cloud server&lt;/a&gt; running on Ubuntu Bionic Beaver&lt;/li&gt;
  &lt;/ul&gt;
&lt;/blockquote&gt;

&lt;h3 class=&quot;anchor-wrap&quot;&gt;Installing Easy-RSA&lt;a style=&quot;margin-left: 10px;&quot; name=&quot;-Installing-EasyRSA&quot; href=&quot;#-Installing-EasyRSA&quot;&gt;&lt;span style=&quot;font-size: 16px&quot;&gt;&lt;i class=&quot;glyphicon glyphicon-link&quot;&gt;&lt;/i&gt;&lt;/span&gt;&lt;/a&gt;&lt;/h3&gt;

&lt;p&gt;The first step in building an OpenVPN configuration is to establish a PKI (Public Key Infrastructure). It is composed of the following elements:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;a public and private key for the server and each client&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;the certification authority (CA) and the key used to identify servers as well as client certificate&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Important:&lt;/strong&gt; Important: For security reasons, it is recommended to run the CA on a different computer from the OpenVPN server.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;OpenVPN supports two-way certificate-based authentication, this means that the client must authenticate the server certificate and the server must authenticate the client certificate before mutual trust is established.&lt;/p&gt;

&lt;p&gt;Both the server and the client will authenticate each other. First, the certificate needs to be signed by the certification authority (CA) then, the information in the header (common name of the certificate or the certificate type) of the authenticated certificate can be tested.&lt;/p&gt;

&lt;p&gt;1 . Connect to your server via &lt;a href=&quot;https://www.scaleway.com/docs/create-and-connect-to-your-server/#-Logging-into-the-Instance&quot;&gt;SSH&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;2 . Update the APT packet cache and the software already installed.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;apt update &amp;amp;&amp;amp; apt upgrade -y
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;3 . Install easy-RSA:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;apt install easy-rsa -y
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;4 . Copy the easy-RSA directory into &lt;strong&gt;/etc/openvpn&lt;/strong&gt;:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mkdir -p /etc/openvpn/easy-rsa/
cp -r /usr/share/easy-rsa/* /etc/openvpn/easy-rsa/
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;5 . Modify &lt;strong&gt;/etc/openvpn/easy-rsa/vars&lt;/strong&gt; by adjusting the following values so they match your configuration:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# These are the default values for fields
# which will be placed in the certificate.
# Don't leave any of these fields blank.
export KEY_COUNTRY=&quot;US&quot;
export KEY_PROVINCE=&quot;CA&quot;
export KEY_CITY=&quot;SanFrancisco&quot;
export KEY_ORG=&quot;Fort-Funston&quot;
export KEY_EMAIL=&quot;me@myhost.mydomain&quot;
export KEY_OU=&quot;MyOrganizationalUnit&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;6 . Run the following commands to generate the Certificate Authority and a key:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;cd /etc/openvpn/easy-rsa/
cp openssl-1.0.0.cnf openssl.cnf
source vars
./clean-all
./build-ca
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;7 . Generate a certificate and a private key for the server:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;./build-key-server openvpn-server
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;As in the previous step, most of the default settings can be kept. Two requests require positive answers: &lt;strong&gt;“Sign the certificate? [y/n]”&lt;/strong&gt; and &lt;strong&gt;“1 out of 1 certificate requests certified, commit? [y/n]”&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;8 . Generate a &lt;a href=&quot;https://en.wikipedia.org/wiki/Diffie%E2%80%93Hellman_key_exchange&quot;&gt;Diffie Hellman key&lt;/a&gt; for the OpenVPN server:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;./build-dh
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;9 . All certificates and keys have been generated in the &lt;strong&gt;keys/&lt;/strong&gt; subdirectory. It is recommended to copy them into the directory &lt;strong&gt;/etc/openvpn/&lt;/strong&gt;.&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;cd keys/
cp ca.crt  dh2048.pem  openvpn-server.crt  openvpn-server.key /etc/openvpn/
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;10 . The VPN client also needs a certificate to authenticate against the server. It is recommended to create a certificate for each client by running the following commands:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;cd /etc/openvpn/easy-rsa/
source vars
./build-key openvpn-client01
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;When prompt, confirm the follwoing questions: &lt;strong&gt;“Sign the certificate? [y/n]”&lt;/strong&gt; and &lt;strong&gt;“1 out of 1 certificate requests certified, commit? [y/n]”&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Copy the following files to the client:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;/etc/openvpn/ca.crt&lt;/li&gt;
  &lt;li&gt;/etc/openvpn/easy-rsa/keys/openvpn-client01.crt&lt;/li&gt;
  &lt;li&gt;/etc/openvpn/easy-rsa/keys/openvpn-client01.key&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Important:&lt;/strong&gt; Since client certificates and keys are only required on the client machine, it is recommended to delete them from the server for security reasons.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3 class=&quot;anchor-wrap&quot;&gt;Installing and Configuring OpenVPN&lt;a style=&quot;margin-left: 10px;&quot; name=&quot;-Installing-and-Configuring-OpenVPN&quot; href=&quot;#-Installing-and-Configuring-OpenVPN&quot;&gt;&lt;span style=&quot;font-size: 16px&quot;&gt;&lt;i class=&quot;glyphicon glyphicon-link&quot;&gt;&lt;/i&gt;&lt;/span&gt;&lt;/a&gt;&lt;/h3&gt;

&lt;p&gt;As you have generated both, the servers and the client certificate, start configuring the OpenVPN server.&lt;/p&gt;

&lt;p&gt;1 . Start by installing the OpenVPN server:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;apt install openvpn -y
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;2 . Create a configuration file &lt;strong&gt;/etc/openvpn/openvpn-server.conf&lt;/strong&gt; for the server:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;#################################################
# Sample OpenVPN 2.0 config file for            #
# multi-client server.                          #
#                                               #
# This file is for the server side              #
# of a many-clients &amp;lt;-&amp;gt; one-server              #
# OpenVPN configuration.                        #
#                                               #
# OpenVPN also supports                         #
# single-machine &amp;lt;-&amp;gt; single-machine             #
# configurations (See the Examples page         #
# on the web site for more info).               #
#                                               #
# This config should work on Windows            #
# or Linux/BSD systems.  Remember on            #
# Windows to quote pathnames and use            #
# double backslashes, e.g.:                     #
# &quot;C:\\Program Files\\OpenVPN\\config\\foo.key&quot; #
#                                               #
# Comments are preceded with '#' or ';'         #
#################################################

# Which local IP address should OpenVPN
# listen on? (optional)
;local a.b.c.d

# Which TCP/UDP port should OpenVPN listen on?
# If you want to run multiple OpenVPN instances
# on the same machine, use a different port
# number for each one.  You will need to
# open up this port on your firewall.
port 1194

# TCP or UDP server?
;proto tcp
proto udp

# &quot;dev tun&quot; will create a routed IP tunnel,
# &quot;dev tap&quot; will create an ethernet tunnel.
# Use &quot;dev tap0&quot; if you are ethernet bridging
# and have precreated a tap0 virtual interface
# and bridged it with your ethernet interface.
# If you want to control access policies
# over the VPN, you must create firewall
# rules for the the TUN/TAP interface.
# On non-Windows systems, you can give
# an explicit unit number, such as tun0.
# On Windows, use &quot;dev-node&quot; for this.
# On most systems, the VPN will not function
# unless you partially or fully disable
# the firewall for the TUN/TAP interface.
;dev tap
dev tun

# Windows needs the TAP-Win32 adapter name
# from the Network Connections panel if you
# have more than one.  On XP SP2 or higher,
# you may need to selectively disable the
# Windows firewall for the TAP adapter.
# Non-Windows systems usually don't need this.
;dev-node MyTap

# SSL/TLS root certificate (ca), certificate
# (cert), and private key (key).  Each client
# and the server must have their own cert and
# key file.  The server and all clients will
# use the same ca file.
#
# See the &quot;easy-rsa&quot; directory for a series
# of scripts for generating RSA certificates
# and private keys.  Remember to use
# a unique Common Name for the server
# and each of the client certificates.
#
# Any X509 key management system can be used.
# OpenVPN can also use a PKCS #12 formatted key file
# (see &quot;pkcs12&quot; directive in man page).
ca ca.crt
cert openvpn-server.crt
key openvpn-server.key  # This file should be kept secret

# Diffie hellman parameters.
# Generate your own with:
#   openssl dhparam -out dh2048.pem 2048
dh dh2048.pem

# Network topology
# Should be subnet (addressing via IP)
# unless Windows clients v2.0.9 and lower have to
# be supported (then net30, i.e. a /30 per client)
# Defaults to net30 (not recommended)
;topology subnet

# Configure server mode and supply a VPN subnet
# for OpenVPN to draw client addresses from.
# The server will take 10.8.0.1 for itself,
# the rest will be made available to clients.
# Each client will be able to reach the server
# on 10.8.0.1. Comment this line out if you are
# ethernet bridging. See the man page for more info.
server 10.8.0.0 255.255.255.0

# Maintain a record of client &amp;lt;-&amp;gt; virtual IP address
# associations in this file.  If OpenVPN goes down or
# is restarted, reconnecting clients can be assigned
# the same virtual IP address from the pool that was
# previously assigned.
ifconfig-pool-persist ipp.txt

# Configure server mode for ethernet bridging.
# You must first use your OS's bridging capability
# to bridge the TAP interface with the ethernet
# NIC interface.  Then you must manually set the
# IP/netmask on the bridge interface, here we
# assume 10.8.0.4/255.255.255.0.  Finally we
# must set aside an IP range in this subnet
# (start=10.8.0.50 end=10.8.0.100) to allocate
# to connecting clients.  Leave this line commented
# out unless you are ethernet bridging.
;server-bridge 10.8.0.4 255.255.255.0 10.8.0.50 10.8.0.100

# Configure server mode for ethernet bridging
# using a DHCP-proxy, where clients talk
# to the OpenVPN server-side DHCP server
# to receive their IP address allocation
# and DNS server addresses.  You must first use
# your OS's bridging capability to bridge the TAP
# interface with the ethernet NIC interface.
# Note: this mode only works on clients (such as
# Windows), where the client-side TAP adapter is
# bound to a DHCP client.
;server-bridge

# Push routes to the client to allow it
# to reach other private subnets behind
# the server.  Remember that these
# private subnets will also need
# to know to route the OpenVPN client
# address pool (10.8.0.0/255.255.255.0)
# back to the OpenVPN server.
;push &quot;route 192.168.10.0 255.255.255.0&quot;
;push &quot;route 192.168.20.0 255.255.255.0&quot;

# To assign specific IP addresses to specific
# clients or if a connecting client has a private
# subnet behind it that should also have VPN access,
# use the subdirectory &quot;ccd&quot; for client-specific
# configuration files (see man page for more info).

# EXAMPLE: Suppose the client
# having the certificate common name &quot;Thelonious&quot;
# also has a small subnet behind his connecting
# machine, such as 192.168.40.128/255.255.255.248.
# First, uncomment out these lines:
;client-config-dir ccd
;route 192.168.40.128 255.255.255.248
# Then create a file ccd/Thelonious with this line:
#   iroute 192.168.40.128 255.255.255.248
# This will allow Thelonious' private subnet to
# access the VPN.  This example will only work
# if you are routing, not bridging, i.e. you are
# using &quot;dev tun&quot; and &quot;server&quot; directives.

# EXAMPLE: Suppose you want to give
# Thelonious a fixed VPN IP address of 10.9.0.1.
# First uncomment out these lines:
;client-config-dir ccd
;route 10.9.0.0 255.255.255.252
# Then add this line to ccd/Thelonious:
#   ifconfig-push 10.9.0.1 10.9.0.2

# Suppose that you want to enable different
# firewall access policies for different groups
# of clients.  There are two methods:
# (1) Run multiple OpenVPN daemons, one for each
#     group, and firewall the TUN/TAP interface
#     for each group/daemon appropriately.
# (2) (Advanced) Create a script to dynamically
#     modify the firewall in response to access
#     from different clients.  See man
#     page for more info on learn-address script.
;learn-address ./script

# If enabled, this directive will configure
# all clients to redirect their default
# network gateway through the VPN, causing
# all IP traffic such as web browsing and
# and DNS lookups to go through the VPN
# (The OpenVPN server machine may need to NAT
# or bridge the TUN/TAP interface to the internet
# in order for this to work properly).
;push &quot;redirect-gateway def1 bypass-dhcp&quot;

# Certain Windows-specific network settings
# can be pushed to clients, such as DNS
# or WINS server addresses.  CAVEAT:
# http://openvpn.net/faq.html#dhcpcaveats
# The addresses below refer to the public
# DNS servers provided by opendns.com.
;push &quot;dhcp-option DNS 208.67.222.222&quot;
;push &quot;dhcp-option DNS 208.67.220.220&quot;

# Uncomment this directive to allow different
# clients to be able to &quot;see&quot; each other.
# By default, clients will only see the server.
# To force clients to only see the server, you
# will also need to appropriately firewall the
# server's TUN/TAP interface.
;client-to-client

# Uncomment this directive if multiple clients
# might connect with the same certificate/key
# files or common names.  This is recommended
# only for testing purposes.  For production use,
# each client should have its own certificate/key
# pair.
#
# IF YOU HAVE NOT GENERATED INDIVIDUAL
# CERTIFICATE/KEY PAIRS FOR EACH CLIENT,
# EACH HAVING ITS OWN UNIQUE &quot;COMMON NAME&quot;,
# UNCOMMENT THIS LINE OUT.
;duplicate-cn

# The keepalive directive causes ping-like
# messages to be sent back and forth over
# the link so that each side knows when
# the other side has gone down.
# Ping every 10 seconds, assume that remote
# peer is down if no ping received during
# a 120 second time period.
keepalive 10 120

# For extra security beyond that provided
# by SSL/TLS, create an &quot;HMAC firewall&quot;
# to help block DoS attacks and UDP port flooding.
#
# Generate with:
#   openvpn --genkey --secret ta.key
#
# The server and each client must have
# a copy of this key.
# The second parameter should be '0'
# on the server and '1' on the clients.
tls-auth ta.key 0 # This file is secret

# Select a cryptographic cipher.
# This config item must be copied to
# the client config file as well.
# Note that v2.4 client/server will automatically
# negotiate AES-256-GCM in TLS mode.
# See also the ncp-cipher option in the manpage
cipher AES-256-CBC

# Enable compression on the VPN link and push the
# option to the client (v2.4+ only, for earlier
# versions see below)
;compress lz4-v2
;push &quot;compress lz4-v2&quot;

# For compression compatible with older clients use comp-lzo
# If you enable it here, you must also
# enable it in the client config file.
;comp-lzo

# The maximum number of concurrently connected
# clients we want to allow.
;max-clients 100

# It's a good idea to reduce the OpenVPN
# daemon's privileges after initialization.
#
# You can uncomment this out on
# non-Windows systems.
;user nobody
;group nobody

# The persist options will try to avoid
# accessing certain resources on restart
# that may no longer be accessible because
# of the privilege downgrade.
persist-key
persist-tun

# Output a short status file showing
# current connections, truncated
# and rewritten every minute.
status openvpn-status.log

# By default, log messages will go to the syslog (or
# on Windows, if running as a service, they will go to
# the &quot;\Program Files\OpenVPN\log&quot; directory).
# Use log or log-append to override this default.
# &quot;log&quot; will truncate the log file on OpenVPN startup,
# while &quot;log-append&quot; will append to it.  Use one
# or the other (but not both).
;log         openvpn.log
;log-append  openvpn.log

# Set the appropriate level of log
# file verbosity.
#
# 0 is silent, except for fatal errors
# 4 is reasonable for general usage
# 5 and 6 can help to debug connection problems
# 9 is extremely verbose
verb 3

# Silence repeating messages.  At most 20
# sequential messages of the same message
# category will be output to the log.
;mute 20

# Notify the client that when the server restarts so it
# can automatically reconnect.
explicit-exit-notify 1
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Important:&lt;/strong&gt; Make sure that you mention the files that you have created previously:&lt;/p&gt;
  &lt;ul&gt;
    &lt;li&gt;&lt;strong&gt;ca ca.crt&lt;/strong&gt;&lt;/li&gt;
    &lt;li&gt;&lt;strong&gt;cert openvpn-server.crt&lt;/strong&gt;&lt;/li&gt;
    &lt;li&gt;&lt;strong&gt;key openvpn-server.key&lt;/strong&gt;&lt;/li&gt;
    &lt;li&gt;&lt;strong&gt;dh dh2048.pem&lt;/strong&gt;&lt;/li&gt;
  &lt;/ul&gt;
&lt;/blockquote&gt;

&lt;p&gt;3 . Edit the file &lt;strong&gt;/etc/sysctl.conf&lt;/strong&gt; and uncomment the following line:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;#net.ipv4.ip_forward=1
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;4 . Reload &lt;strong&gt;sysctl&lt;/strong&gt;:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sysctl -p /etc/sysctl.conf
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;5 . Create a &lt;strong&gt;ta.key&lt;/strong&gt;:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;openvpn --genkey --secret ta.key
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Important:&lt;/strong&gt; Download a copy of this key also on your client to establish the VPN connection.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;6 . Start the OpenVPN service. It is required to specify the configration file as an instance variable. The configuration file you created previously is called &lt;strong&gt;/etc/openvpn/openvpn-server.conf&lt;/strong&gt;, this means you have to add &lt;strong&gt;@openvpn-server&lt;/strong&gt; to end of your unit when launching it:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;systemctl start openvpn@openvpn-server
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;7 . Check that the service is running:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt; systemctl status openvpn@openvpn-server
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;If everything went well, a message similar to the following appears:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;● openvpn@openvpn-server.service - OpenVPN connection to openvpn-server
   Loaded: loaded (/lib/systemd/system/openvpn@.service; disabled; vendor preset: enabled)
   Active: active (running) since Mon 2019-01-21 14:43:35 UTC; 9s ago
     Docs: man:openvpn(8)
           https://community.openvpn.net/openvpn/wiki/Openvpn24ManPage
           https://community.openvpn.net/openvpn/wiki/HOWTO
 Main PID: 30023 (openvpn)
   Status: &quot;Initialization Sequence Completed&quot;
    Tasks: 1 (limit: 2295)
   CGroup: /system.slice/system-openvpn.slice/openvpn@openvpn-server.service
           └─30023 /usr/sbin/openvpn --daemon ovpn-openvpn-server --status /run/openvpn/openvpn-server.status 10 --cd /etc

Jan 21 14:43:35 openvpn ovpn-openvpn-server[30023]: /sbin/ip addr add dev tun0 local 10.8.0.1 peer 10.8.0.2
Jan 21 14:43:35 openvpn ovpn-openvpn-server[30023]: /sbin/ip route add 10.8.0.0/24 via 10.8.0.2
Jan 21 14:43:35 openvpn ovpn-openvpn-server[30023]: Could not determine IPv4/IPv6 protocol. Using AF_INET
Jan 21 14:43:35 openvpn ovpn-openvpn-server[30023]: Socket Buffers: R=[212992-&amp;gt;212992] S=[212992-&amp;gt;212992]
Jan 21 14:43:35 openvpn ovpn-openvpn-server[30023]: UDPv4 link local (bound): [AF_INET][undef]:1194
Jan 21 14:43:35 openvpn ovpn-openvpn-server[30023]: UDPv4 link remote: [AF_UNSPEC]
Jan 21 14:43:35 openvpn ovpn-openvpn-server[30023]: MULTI: multi_init called, r=256 v=256
Jan 21 14:43:35 openvpn ovpn-openvpn-server[30023]: IFCONFIG POOL: base=10.8.0.4 size=62, ipv6=0
Jan 21 14:43:35 openvpn ovpn-openvpn-server[30023]: IFCONFIG POOL LIST
Jan 21 14:43:35 openvpn ovpn-openvpn-server[30023]: Initialization Sequence Completed
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;8 . If everything went well, enable the service to start it automatically during the boot of your instance:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;systemctl enable openvpn@openvpn-server
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Your OpenVPN server is now ready to accept connections.&lt;/p&gt;

&lt;h3 class=&quot;anchor-wrap&quot;&gt;Configuring the Client&lt;a style=&quot;margin-left: 10px;&quot; name=&quot;-Configuring-the-Client&quot; href=&quot;#-Configuring-the-Client&quot;&gt;&lt;span style=&quot;font-size: 16px&quot;&gt;&lt;i class=&quot;glyphicon glyphicon-link&quot;&gt;&lt;/i&gt;&lt;/span&gt;&lt;/a&gt;&lt;/h3&gt;

&lt;p&gt;1 . To connect to your server you have to install the OpenVPN client. On &lt;strong&gt;Ubuntu Linux&lt;/strong&gt;, you can install it easily with apt:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;apt install openvpn
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;If your computer is running a &lt;strong&gt;Windows&lt;/strong&gt; Operating system, you can download the &lt;a href=&quot;http://build.openvpn.net/downloads/releases/latest/openvpn-install-latest-stable.exe&quot;&gt;OpenVPN client for Windows&lt;/a&gt;. On &lt;strong&gt;MacOS&lt;/strong&gt; you can use a tool like &lt;a href=&quot;https://tunnelblick.net/downloads.html&quot;&gt;Tunnelblick&lt;/a&gt; to establish the VPN connection.&lt;/p&gt;

&lt;p&gt;Make sure that you have copied the following files on your local computer before continuing:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;/etc/openvpn/ca.crt&lt;/li&gt;
  &lt;li&gt;/etc/openvpn/ta.key&lt;/li&gt;
  &lt;li&gt;/etc/openvpn/easy-rsa/keys/openvpn-client01.crt&lt;/li&gt;
  &lt;li&gt;/etc/openvpn/easy-rsa/keys/openvpn-client01.key&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can download them for example via SFTP with &lt;a href=&quot;https://filezilla-project.org/&quot;&gt;Filezilla&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;2 . Create a configuration file &lt;strong&gt;openvpn-client01.ovpn&lt;/strong&gt; for the client and put the following information in it:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;##############################################
# Sample client-side OpenVPN 2.0 config file #
# for connecting to multi-client server.     #
#                                            #
# This configuration can be used by multiple #
# clients, however each client should have   #
# its own cert and key files.                #
#                                            #
# On Windows, you might want to rename this  #
# file so it has a .ovpn extension           #
##############################################

# Specify that we are a client and that we
# will be pulling certain config file directives
# from the server.
client

# Use the same setting as you are using on
# the server.
# On most systems, the VPN will not function
# unless you partially or fully disable
# the firewall for the TUN/TAP interface.
;dev tap
dev tun

# Windows needs the TAP-Win32 adapter name
# from the Network Connections panel
# if you have more than one.  On XP SP2,
# you may need to disable the firewall
# for the TAP adapter.
;dev-node MyTap

# Are we connecting to a TCP or
# UDP server?  Use the same setting as
# on the server.
;proto tcp
proto udp

# The hostname/IP and port of the server.
# You can have multiple remote entries
# to load balance between the servers.
remote YOUR_SERVER_IP 1194
;remote my-server-2 1194

# Choose a random host from the remote
# list for load-balancing.  Otherwise
# try hosts in the order specified.
;remote-random

# Keep trying indefinitely to resolve the
# host name of the OpenVPN server.  Very useful
# on machines which are not permanently connected
# to the internet such as laptops.
resolv-retry infinite

# Most clients don't need to bind to
# a specific local port number.
nobind

# Downgrade privileges after initialization (non-Windows only)
;user nobody
;group nobody

# Try to preserve some state across restarts.
persist-key
persist-tun

# If you are connecting through an
# HTTP proxy to reach the actual OpenVPN
# server, put the proxy server/IP and
# port number here.  See the man page
# if your proxy server requires
# authentication.
;http-proxy-retry # retry on connection failures
;http-proxy [proxy server] [proxy port #]

# Wireless networks often produce a lot
# of duplicate packets.  Set this flag
# to silence duplicate packet warnings.
;mute-replay-warnings

# SSL/TLS parms.
# See the server config file for more
# description.  It's best to use
# a separate .crt/.key file pair
# for each client.  A single ca
# file can be used for all clients.
ca ca.crt
cert openvpn-client01.crt
key openvpn-client01.key

# Verify server certificate by checking that the
# certicate has the correct key usage set.
# This is an important precaution to protect against
# a potential attack discussed here:
#  http://openvpn.net/howto.html#mitm
#
# To use this feature, you will need to generate
# your server certificates with the keyUsage set to
#   digitalSignature, keyEncipherment
# and the extendedKeyUsage to
#   serverAuth
# EasyRSA can do this for you.
remote-cert-tls server

# If a tls-auth key is used on the server
# then every client must also have the key.
tls-auth ta.key 1

# Select a cryptographic cipher.
# If the cipher option is used on the server
# then you must also specify it here.
# Note that v2.4 client/server will automatically
# negotiate AES-256-GCM in TLS mode.
# See also the ncp-cipher option in the manpage
cipher AES-256-CBC

# Enable compression on the VPN link.
# Don't enable this unless it is also
# enabled in the server config file.
#comp-lzo

# Set log file verbosity.
verb 3

# Silence repeating messages
;mute 20
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Add your OpenVPN servers IP at &lt;code class=&quot;highlighter-rouge&quot;&gt;remote YOUR_SERVER_IP 1194&lt;/code&gt; and make sure all file names correspond to your files.&lt;/p&gt;

&lt;p&gt;3 . Restart the openvpn client. On Ubuntu:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;systemctl restart openvpn@openvpn-client01
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;On Windows or MacOS, double click on the &lt;strong&gt;openvpn-client01.ovpn&lt;/strong&gt; file to import the configuration settings into your client.&lt;/p&gt;

&lt;p&gt;You can now connect to the Internet via your VPN.&lt;/p&gt;

&lt;p&gt;For more configuration options, refer to the &lt;a href=&quot;https://openvpn.net/vpn-server-resources/&quot;&gt;official documentation&lt;/a&gt; of OpenVPN. To save time, you may deploy your OpenVPN also with a simple click and the Scaleway &lt;a href=&quot;https://www.scaleway.com/docs/how-to-use-the-openvpn-instant-apps/&quot;&gt;OpenVPN InstantApp&lt;/a&gt;.&lt;/p&gt;</content><author><name>Scaleway</name><email>contact@scaleway.com</email><uri>https://www.scaleway.com</uri></author><category term="advanced topics" /><category term="compute" /><category term="mediaserver" /><category term="vpn" /><category term="openvpn" /><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://www.scaleway.com/assets/images/og/scaleway.png" /></entry><entry><title type="html">Installing PowerDNS</title><link href="https://www.scaleway.com/docs/installing-powerdns-server-on-ubuntu-bionic/" rel="alternate" type="text/html" title="Installing PowerDNS" /><published>2018-12-03T00:00:00+00:00</published><updated>2018-12-03T00:00:00+00:00</updated><id>https://www.scaleway.com/docs/powerdns-ubuntu-bionic</id><content type="html" xml:base="https://www.scaleway.com/docs/installing-powerdns-server-on-ubuntu-bionic/">&lt;h2 class=&quot;anchor-wrap&quot;&gt;PowerDNS Overview&lt;a style=&quot;margin-left: 10px;&quot; name=&quot;-PowerDNS-Overview&quot; href=&quot;#-PowerDNS-Overview&quot;&gt;&lt;span style=&quot;font-size: 16px&quot;&gt;&lt;i class=&quot;glyphicon glyphicon-link&quot;&gt;&lt;/i&gt;&lt;/span&gt;&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;&lt;a href=&quot;https://www.powerdns.com/&quot;&gt;PowerDNS&lt;/a&gt; is an open source DNS server written in C++. A DNS server is a server that contains a database of public IP addresses and their associated domain names. Its purpose is to resolve, or translate, those common names to IP addresses as requested. PowerDNS runs on most Linux and all other Unix derivatives. The software comes with the PowerDNS-Admin web interface, simplifying the management of your DNS zones.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Requirements&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;You have an account and are logged into &lt;a href=&quot;https://console.scaleway.com&quot;&gt;console.scaleway.com&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;You have &lt;a href=&quot;https://www.scaleway.com/docs/configure-new-ssh-key/&quot;&gt;configured your SSH Key&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;You have at least two virtual cloud servers running on Ubuntu Bionic Beaver&lt;/li&gt;
  &lt;/ul&gt;
&lt;/blockquote&gt;

&lt;h2 class=&quot;anchor-wrap&quot;&gt;Installing PowerDNS&lt;a style=&quot;margin-left: 10px;&quot; name=&quot;-Installing-PowerDNS&quot; href=&quot;#-Installing-PowerDNS&quot;&gt;&lt;span style=&quot;font-size: 16px&quot;&gt;&lt;i class=&quot;glyphicon glyphicon-link&quot;&gt;&lt;/i&gt;&lt;/span&gt;&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;The goal of this guide is to have PowerDNS configured with a MariaDB/MySQL backend with SQL replication to sync information between slave servers.&lt;/p&gt;

&lt;h3 class=&quot;anchor-wrap&quot;&gt;Installing and Configuring MariaDB (All Servers)&lt;a style=&quot;margin-left: 10px;&quot; name=&quot;-Installing-and-Configuring-MariaDB-All-Servers&quot; href=&quot;#-Installing-and-Configuring-MariaDB-All-Servers&quot;&gt;&lt;span style=&quot;font-size: 16px&quot;&gt;&lt;i class=&quot;glyphicon glyphicon-link&quot;&gt;&lt;/i&gt;&lt;/span&gt;&lt;/a&gt;&lt;/h3&gt;

&lt;p&gt;PowerDNS needs a database to store DNS zones. MariaDB is being used to store the information, alternatively a zone file configuration is possible.&lt;/p&gt;

&lt;p&gt;1 . Start by installing &lt;a href=&quot;https://mariadb.org/&quot;&gt;MariaDB&lt;/a&gt; on your install as described &lt;a href=&quot;https://www.scaleway.com/docs/how-to-install-mariadb-on-ubuntu/&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;2 . Once the database server is installed, connect to it and create a database called &lt;code class=&quot;highlighter-rouge&quot;&gt;powerdns&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mysql -u root -p
CREATE DATABASE powerdns;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;3 . Create a user for PowerDNS and assign privileges to the &lt;code class=&quot;highlighter-rouge&quot;&gt;powerdns&lt;/code&gt; database:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;GRANT ALL ON powerdns.* TO 'powerdns'@'localhost' \
IDENTIFIED BY '&amp;lt;SECRET_PASSWORD&amp;gt;';
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;4 . Update the settings by flushing the privileges:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;FLUSH PRIVILEGES;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;5 . Switch to the &lt;code class=&quot;highlighter-rouge&quot;&gt;powerdns&lt;/code&gt; database to create the required tables:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;USE powerdns;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;6 . Create the required tables:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;CREATE TABLE domains (
  id                    INT AUTO_INCREMENT,
  name                  VARCHAR(255) NOT NULL,
  master                VARCHAR(128) DEFAULT NULL,
  last_check            INT DEFAULT NULL,
  type                  VARCHAR(6) NOT NULL,
  notified_serial       INT UNSIGNED DEFAULT NULL,
  account               VARCHAR(40) CHARACTER SET 'utf8' DEFAULT NULL,
  PRIMARY KEY (id)
) Engine=InnoDB CHARACTER SET 'latin1';

CREATE UNIQUE INDEX name_index ON domains(name);


CREATE TABLE records (
  id                    BIGINT AUTO_INCREMENT,
  domain_id             INT DEFAULT NULL,
  name                  VARCHAR(255) DEFAULT NULL,
  type                  VARCHAR(10) DEFAULT NULL,
  content               VARCHAR(64000) DEFAULT NULL,
  ttl                   INT DEFAULT NULL,
  prio                  INT DEFAULT NULL,
  change_date           INT DEFAULT NULL,
  disabled              TINYINT(1) DEFAULT 0,
  ordername             VARCHAR(255) BINARY DEFAULT NULL,
  auth                  TINYINT(1) DEFAULT 1,
  PRIMARY KEY (id)
) Engine=InnoDB CHARACTER SET 'latin1';

CREATE INDEX nametype_index ON records(name,type);
CREATE INDEX domain_id ON records(domain_id);
CREATE INDEX ordername ON records (ordername);


CREATE TABLE supermasters (
  ip                    VARCHAR(64) NOT NULL,
  nameserver            VARCHAR(255) NOT NULL,
  account               VARCHAR(40) CHARACTER SET 'utf8' NOT NULL,
  PRIMARY KEY (ip, nameserver)
) Engine=InnoDB CHARACTER SET 'latin1';


CREATE TABLE comments (
  id                    INT AUTO_INCREMENT,
  domain_id             INT NOT NULL,
  name                  VARCHAR(255) NOT NULL,
  type                  VARCHAR(10) NOT NULL,
  modified_at           INT NOT NULL,
  account               VARCHAR(40) CHARACTER SET 'utf8' DEFAULT NULL,
  comment               TEXT CHARACTER SET 'utf8' NOT NULL,
  PRIMARY KEY (id)
) Engine=InnoDB CHARACTER SET 'latin1';

CREATE INDEX comments_name_type_idx ON comments (name, type);
CREATE INDEX comments_order_idx ON comments (domain_id, modified_at);


CREATE TABLE domainmetadata (
  id                    INT AUTO_INCREMENT,
  domain_id             INT NOT NULL,
  kind                  VARCHAR(32),
  content               TEXT,
  PRIMARY KEY (id)
) Engine=InnoDB CHARACTER SET 'latin1';

CREATE INDEX domainmetadata_idx ON domainmetadata (domain_id, kind);


CREATE TABLE cryptokeys (
  id                    INT AUTO_INCREMENT,
  domain_id             INT NOT NULL,
  flags                 INT NOT NULL,
  active                BOOL,
  content               TEXT,
  PRIMARY KEY(id)
) Engine=InnoDB CHARACTER SET 'latin1';

CREATE INDEX domainidindex ON cryptokeys(domain_id);


CREATE TABLE tsigkeys (
  id                    INT AUTO_INCREMENT,
  name                  VARCHAR(255),
  algorithm             VARCHAR(50),
  secret                VARCHAR(255),
  PRIMARY KEY (id)
) Engine=InnoDB CHARACTER SET 'latin1';

CREATE UNIQUE INDEX namealgoindex ON tsigkeys(name, algorithm);
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Useful tip&lt;/strong&gt;: You can verify that the tables have been created, by running &lt;code class=&quot;highlighter-rouge&quot;&gt;show tables;&lt;/code&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;7 . Disconnect from the MariaDB server:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;QUIT;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;h3 class=&quot;anchor-wrap&quot;&gt;Disabling systemd-resolve&lt;a style=&quot;margin-left: 10px;&quot; name=&quot;-Disabling-systemdresolve&quot; href=&quot;#-Disabling-systemdresolve&quot;&gt;&lt;span style=&quot;font-size: 16px&quot;&gt;&lt;i class=&quot;glyphicon glyphicon-link&quot;&gt;&lt;/i&gt;&lt;/span&gt;&lt;/a&gt;&lt;/h3&gt;

&lt;p&gt;Ubuntu Bionic Beaver comes with &lt;code class=&quot;highlighter-rouge&quot;&gt;systemd-resolve&lt;/code&gt; preinstalled, which needs to be disabled as it binds to port &lt;strong&gt;53&lt;/strong&gt; which will conflict with the ports required for PowerDNS.&lt;/p&gt;

&lt;p&gt;1 . Disable the resolvd service by running the following commands:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;systemctl disable systemd-resolved
systemctl stop systemd-resolved
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;2 . Remove the symlinked &lt;strong&gt;resolv.conf&lt;/strong&gt; file:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;ls -lh /etc/resolv.conf
lrwxrwxrwx 1 root root 24 Dec  3 12:23 /etc/resolv.conf -&amp;gt; /lib/systemd/resolv.conf
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;3 . Create a new &lt;strong&gt;resolv.conf&lt;/strong&gt; file containing your preferred DNS resolver (for example &lt;code class=&quot;highlighter-rouge&quot;&gt;9.9.9.9&lt;/code&gt;):&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;echo &quot;nameserver 9.9.9.9&quot; &amp;gt; /etc/resolv.conf
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;h3 class=&quot;anchor-wrap&quot;&gt;Installing PowerDNS Server&lt;a style=&quot;margin-left: 10px;&quot; name=&quot;-Installing-PowerDNS-Server&quot; href=&quot;#-Installing-PowerDNS-Server&quot;&gt;&lt;span style=&quot;font-size: 16px&quot;&gt;&lt;i class=&quot;glyphicon glyphicon-link&quot;&gt;&lt;/i&gt;&lt;/span&gt;&lt;/a&gt;&lt;/h3&gt;

&lt;p&gt;1 . Add the official PowerDNS repository to apt:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;echo &quot;deb [arch=amd64] http://repo.powerdns.com/ubuntu bionic-auth-41 main&quot; &amp;gt; /etc/apt/sources.list.d/pdns.list
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;2 . Import the PowerDNS GPG key:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;curl https://repo.powerdns.com/FD380FBB-pub.asc | apt-key add -
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;3 . Update apt and install the PowerDNS package (&lt;code class=&quot;highlighter-rouge&quot;&gt;pdns-server&lt;/code&gt;) and MySQL backend (&lt;code class=&quot;highlighter-rouge&quot;&gt;pdns-backend-mysql&lt;/code&gt;):&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;apt update
apt install pdns-server pdns-backend-mysql -y
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;4 . Edit the file &lt;code class=&quot;highlighter-rouge&quot;&gt;/etc/powerdns/pdns.d/pdns.local.gmysql.conf&lt;/code&gt; with your SQL credentials, created previously so it looks like the following example:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# SQL Configuration (MariaDB)
# Launch gmysql backend
launch+=gmysql
# gmysql parameters
gmysql-host=localhost
gmysql-port=3306
gmysql-dbname=powerdns
gmysql-user=powerdns
gmysql-password=&amp;lt;SECRET_PASSWORD&amp;gt;
gmysql-dnssec=yes
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;5 . Make a backup of the current configuration file:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mv /etc/powerdns/pdns.conf /etc/powerdns/pdns.conf-orig
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;6 . Create a new &lt;code class=&quot;highlighter-rouge&quot;&gt;/etc/powerdns/pdns.conf&lt;/code&gt; file as following:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# PowerDNS configuration file
# Replace ns1.example.com with your master nameserver's hostname
default-soa-name=ns1.mydomain.com
include-dir=/etc/powerdns/pdns.d
launch=
security-poll-suffix=
setgid=pdns
setuid=pdns
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;7a . On the &lt;strong&gt;master server only&lt;/strong&gt; include the following lines:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;api=yes
# Replace &amp;lt;RANDOM_KEY&amp;gt; with a randomly generated key for API access
api-key=&amp;lt;RANDOM_KEY&amp;gt;
master=yes
slave=no
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;7b . On the &lt;strong&gt;slave server only&lt;/strong&gt; include the following lines:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;master=no
slave=yes
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;8 . Restart the &lt;code class=&quot;highlighter-rouge&quot;&gt;pdns&lt;/code&gt; service:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;systemctl restart pdns
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;9 . Verify that the PowerDNS server responds correctly:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# dig @127.0.0.1

; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.11.3-1ubuntu1.3-Ubuntu &amp;lt;&amp;lt;&amp;gt;&amp;gt; @127.0.0.1
; (1 server found)
;; global options: +cmd
;; Got answer:
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: REFUSED, id: 36221
;; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1
;; WARNING: recursion requested but not available

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1680
;; QUESTION SECTION:
;.				IN	NS

;; Query time: 1 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Mon Dec 03 12:53:57 UTC 2018
;; MSG SIZE  rcvd: 28
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;h3 class=&quot;anchor-wrap&quot;&gt;Configuring MySQL Replication&lt;a style=&quot;margin-left: 10px;&quot; name=&quot;-Configuring-MySQL-Replication&quot; href=&quot;#-Configuring-MySQL-Replication&quot;&gt;&lt;span style=&quot;font-size: 16px&quot;&gt;&lt;i class=&quot;glyphicon glyphicon-link&quot;&gt;&lt;/i&gt;&lt;/span&gt;&lt;/a&gt;&lt;/h3&gt;

&lt;p&gt;The MySQL replication setup is a very important part allows near instant DNS updates across all linked nameservers. This replication method, has some benefits over the other replication mode of PowerDNS, called &lt;em&gt;supermaster&lt;/em&gt; setup, which can be unstable sometimes and does not remove deleted zones across every server automatically.&lt;/p&gt;

&lt;h4 class=&quot;anchor-wrap&quot;&gt;Configuring the Master Server&lt;a style=&quot;margin-left: 10px;&quot; name=&quot;-Configuring-the-Master-Server&quot; href=&quot;#-Configuring-the-Master-Server&quot;&gt;&lt;span style=&quot;font-size: 16px&quot;&gt;&lt;i class=&quot;glyphicon glyphicon-link&quot;&gt;&lt;/i&gt;&lt;/span&gt;&lt;/a&gt;&lt;/h4&gt;

&lt;p&gt;The following steps have to be done on the &lt;strong&gt;master server only&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;1 . Edit the MySQL configuration file (&lt;code class=&quot;highlighter-rouge&quot;&gt;/etc/mysql/mariadb.conf.d/50-server.cnf&lt;/code&gt;) as follows:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;bind-address = 0.0.0.0

server-id = 1
log_bin = /var/log/mysql/mysql-bin.log
expire_logs_days = 10
max_binlog_size = 100M
binlog_do_db = pdns
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;2 . Restart MariaDB:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;systemctl restart mysql
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;3 . Connect to MariaDB and create a user for the slave server:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mysql -u root -p
GRANT REPLICATION SLAVE ON *.* TO 'pdns-slave'@'&amp;lt;SLAVE_SERVER_IP&amp;gt;' IDENTIFIED BY '&amp;lt;SECRET_PASSWORD&amp;gt;';
FLUSH PRIVILEGES;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;4 . Run &lt;code class=&quot;highlighter-rouge&quot;&gt;show master status;&lt;/code&gt; from the MariaDB console:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;+------------------+----------+--------------+------------------+
| File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+------------------+----------+--------------+------------------+
| mysql-bin.000001 |      634 | powerdns     |                  |
+------------------+----------+--------------+------------------+
1 row in set (0.01 sec)
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Note the File (&lt;code class=&quot;highlighter-rouge&quot;&gt;mysql-bin.000001&lt;/code&gt;) and Position (&lt;code class=&quot;highlighter-rouge&quot;&gt;634&lt;/code&gt;) numbers, as they will be required in a later step.&lt;/p&gt;

&lt;h4 class=&quot;anchor-wrap&quot;&gt;Configuring the Slave Server&lt;a style=&quot;margin-left: 10px;&quot; name=&quot;-Configuring-the-Slave-Server&quot; href=&quot;#-Configuring-the-Slave-Server&quot;&gt;&lt;span style=&quot;font-size: 16px&quot;&gt;&lt;i class=&quot;glyphicon glyphicon-link&quot;&gt;&lt;/i&gt;&lt;/span&gt;&lt;/a&gt;&lt;/h4&gt;

&lt;p&gt;The following steps have to be done on the &lt;strong&gt;slave server only&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;1 . Edit the MySQL configuration file (&lt;code class=&quot;highlighter-rouge&quot;&gt;/etc/mysql/mariadb.conf.d/50-server.cnf&lt;/code&gt;) as follows:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;server-id=2
relay-log=slave-relay-bin
relay-log-index=slave-relay-bin.index
replicate-do-db=powerdns
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Important:&lt;/strong&gt; The &lt;code class=&quot;highlighter-rouge&quot;&gt;server-id&lt;/code&gt; has variable needs to be unique for each server, if you want to configure more than one slave server increase it accordingly, for example: &lt;code class=&quot;highlighter-rouge&quot;&gt;server-id=2&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;server-id=3&lt;/code&gt;, etc.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;2 . Restart MariaDB:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;systemctl restart mysql
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;3 . Log into the MariaDB console:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mysql -u root -p
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;4 . Run the following command to link the slave to the master server:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;change master to
master_host='&amp;lt;MASTER_SERVER_IP&amp;gt;',
master_user='pdns-slave',
master_password='&amp;lt;SECRET_PASSWORD&amp;gt;', master_log_file='mysql-bin.000001', master_log_pos=634;
start slave;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Important:&lt;/strong&gt; The values mysql-bin.000001 and 634 correspond to the values you noted down in a previous step.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;5 . Check the slave status to see if everything worked:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;show slave status;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;h3 class=&quot;anchor-wrap&quot;&gt;Installing PowerDNS-Admin&lt;a style=&quot;margin-left: 10px;&quot; name=&quot;-Installing-PowerDNSAdmin&quot; href=&quot;#-Installing-PowerDNSAdmin&quot;&gt;&lt;span style=&quot;font-size: 16px&quot;&gt;&lt;i class=&quot;glyphicon glyphicon-link&quot;&gt;&lt;/i&gt;&lt;/span&gt;&lt;/a&gt;&lt;/h3&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/ngoduykhanh/PowerDNS-Admin&quot;&gt;PowerDNS-Admin&lt;/a&gt; is an advanced web interface that simplifies the management of DNS zones. PowerDNS-Admin will be installed on the &lt;strong&gt;master server&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;1 . Connect to MariaDB and create a new database and user for PowerDNS-Admin:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mysql -u root -p
CREATE DATABASE pdnsadmin CHARACTER SET utf8 COLLATE utf8_general_ci;
GRANT ALL PRIVILEGES ON pdnsadmin.* TO 'pdnsadminuser'@'%' IDENTIFIED BY '&amp;lt;SECRET_PASSWORD&amp;gt;';
FLUSH PRIVILEGES;
quit;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;2 . Install Python 3 and the packages required for building python libraries:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;apt install python3-dev libmysqlclient-dev python-mysqldb libsasl2-dev libffi-dev libldap2-dev libssl-dev libxml2-dev libxslt1-dev libxmlsec1-dev pkg-config virtualenv -y
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;3 .  Download and install the &lt;a href=&quot;https://yarnpkg.com/lang/en/&quot;&gt;yarn&lt;/a&gt; GPG key, add the repository to apt and install yarn to build asset files:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
echo &quot;deb https://dl.yarnpkg.com/debian/ stable main&quot; &amp;gt; /etc/apt/sources.list.d/yarn.list
apt update &amp;amp;&amp;amp; apt install yarn -y
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;4 . Download and extract PowerDNS-Admin, then create a &lt;a href=&quot;https://virtualenv.pypa.io/en/latest/&quot;&gt;virtualenv&lt;/a&gt;:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;wget https://github.com/ngoduykhanh/PowerDNS-Admin/archive/master.tar.gz
mkdir /opt/web
tar -C /opt/web -xvf master.tar.gz
mv /opt/web/PowerDNS-Admin-master /opt/web/powerdns-admin
cd /opt/web/powerdns-admin
virtualenv -p python3 flask
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;5 . Activate the Python 3 environment and install the required libraries:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;. ./flask/bin/activate
pip install -r requirements.txt
pip install python-dotenv
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;6 . Create a configuration file from the template shipped with the tool:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;cp config_template.py config.py
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;7 . Edit the &lt;code class=&quot;highlighter-rouge&quot;&gt;config.py&lt;/code&gt; file and enter the database credentials. Once edited the file should look like the following example:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;SQLA_DB_USER = 'pdnsadminuser'
SQLA_DB_PASSWORD = '&amp;lt;SECRET_PASSWORD&amp;gt;'
SQLA_DB_HOST = '127.0.0.1'
SQLA_DB_NAME = 'pdnsadmin'
SQLALCHEMY_TRACK_MODIFICATIONS = True
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;8 . Once the file is edited, create the database scheme by running the following commands:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;export FLASK_APP=app/__init__.py
flask db upgrade
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;9 . Run &lt;code class=&quot;highlighter-rouge&quot;&gt;db migrate&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;flask db migrate -m &quot;Init DB&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;10 . Generate the asset files with yarn and build the application:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;yarn install --pure-lockfile
flask assets build
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;11 . Test if your application is working:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;./run.py
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;An output like the following will appear. Press &lt;code class=&quot;highlighter-rouge&quot;&gt;CTRL+C&lt;/code&gt; to exit the application:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;* Serving Flask app &quot;app&quot; (lazy loading)
* Environment: production
  WARNING: Do not use the development server in a production environment.
  Use a production WSGI server instead.
* Debug mode: on
[INFO]  * Running on http://127.0.0.1:9191/ (Press CTRL+C to quit)
[INFO]  * Restarting with stat
[WARNING]  * Debugger is active!
[INFO]  * Debugger PIN: 104-611-896
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;12 . To manage PowerDNS-Admin with systemd, create a new service file called &lt;code class=&quot;highlighter-rouge&quot;&gt;/etc/systemd/system/powerdns-admin.service&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;[Unit]
Description=PowerDNS-Admin
After=network.target

[Service]
User=root
Group=root
WorkingDirectory=/opt/web/powerdns-admin
ExecStart=/opt/web/powerdns-admin/flask/bin/gunicorn --workers 2 --bind unix:/opt/web/powerdns-admin/powerdns-admin.sock app:app

[Install]
WantedBy=multi-user.target
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;13 . Reload systemd, start the powerdns-admin service and enable it to be started automatically during system boot:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;systemctl daemon-reload
systemctl start powerdns-admin
systemctl enable powerdns-admin
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;14 . Verify that the service is running with the following command: &lt;code class=&quot;highlighter-rouge&quot;&gt;systemctl status powerdns-admin&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The output should look like as follows:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;● powerdns-admin.service - PowerDNS-Admin
   Loaded: loaded (/etc/systemd/system/powerdns-admin.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2018-12-03 14:05:12 UTC; 6min ago
 Main PID: 8986 (gunicorn)
    Tasks: 3 (limit: 2295)
   CGroup: /system.slice/powerdns-admin.service
           ├─8986 /opt/web/powerdns-admin/flask/bin/python3 /opt/web/powerdns-admin/flask/bin/gunicorn --workers 2 --bind unix:/opt/web/po
           ├─9002 /opt/web/powerdns-admin/flask/bin/python3 /opt/web/powerdns-admin/flask/bin/gunicorn --workers 2 --bind unix:/opt/web/po
           └─9003 /opt/web/powerdns-admin/flask/bin/python3 /opt/web/powerdns-admin/flask/bin/gunicorn --workers 2 --bind unix:/opt/web/po
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;h3 class=&quot;anchor-wrap&quot;&gt;Installing Nginx Proxy&lt;a style=&quot;margin-left: 10px;&quot; name=&quot;-Installing-Nginx-Proxy&quot; href=&quot;#-Installing-Nginx-Proxy&quot;&gt;&lt;span style=&quot;font-size: 16px&quot;&gt;&lt;i class=&quot;glyphicon glyphicon-link&quot;&gt;&lt;/i&gt;&lt;/span&gt;&lt;/a&gt;&lt;/h3&gt;

&lt;p&gt;A &lt;a href=&quot;https://docs.nginx.com/nginx/admin-guide/web-server/reverse-proxy/&quot;&gt;Nginx proxy&lt;/a&gt; is being used to access the PowerDNS-Admin interface from a web browser.&lt;/p&gt;

&lt;p&gt;1 . Install Nginx:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;apt install nginx -y
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;2 . Create a configuration file called &lt;code class=&quot;highlighter-rouge&quot;&gt;/etc/nginx/conf.d/powerdns-admin.conf&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;server {
  listen *:80;
  server_name               &amp;lt;YOUR_DOMAIN_NAME&amp;gt;;

  index                     index.html index.htm index.php;
  root                      /opt/web/powerdns-admin;
  access_log                /var/log/nginx/powerdns-admin.local.access.log combined;
  error_log                 /var/log/nginx/powerdns-admin.local.error.log;

  client_max_body_size              10m;
  client_body_buffer_size           128k;
  proxy_redirect                    off;
  proxy_connect_timeout             90;
  proxy_send_timeout                90;
  proxy_read_timeout                90;
  proxy_buffers                     32 4k;
  proxy_buffer_size                 8k;
  proxy_set_header                  Host $host;
  proxy_set_header                  X-Real-IP $remote_addr;
  proxy_set_header                  X-Forwarded-For $proxy_add_x_forwarded_for;
  proxy_headers_hash_bucket_size    64;

  location ~ ^/static/  {
    include  /etc/nginx/mime.types;
    root /opt/web/powerdns-admin/app;

    location ~*  \.(jpg|jpeg|png|gif)$ {
      expires 365d;
    }

    location ~* ^.+.(css|js)$ {
      expires 7d;
    }
  }

  location / {
    proxy_pass            http://unix:/opt/web/powerdns-admin/powerdns-admin.sock;
    proxy_read_timeout    120;
    proxy_connect_timeout 120;
    proxy_redirect        off;
  }

}
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;3 . Verify the syntax of the configuration file and reload nginx if everything is fine:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;nginx -t
systemctl reload nginx
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;4 . PowerDNS-Admin is accessible at &lt;code class=&quot;highlighter-rouge&quot;&gt;http://&amp;lt;YOUR_DOMAIN_NAME&amp;gt;&lt;/code&gt; now:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/docs/powerdns/powerdns-admin-login.png&quot; alt=&quot;PowerDNS Admin&quot; class=&quot;img-responsive&quot; /&gt;&lt;/p&gt;

&lt;h4 class=&quot;anchor-wrap&quot;&gt;Installing a Let's Encrypt Certificate&lt;a style=&quot;margin-left: 10px;&quot; name=&quot;-Installing-a-Lets-Encrypt-Certificate&quot; href=&quot;#-Installing-a-Lets-Encrypt-Certificate&quot;&gt;&lt;span style=&quot;font-size: 16px&quot;&gt;&lt;i class=&quot;glyphicon glyphicon-link&quot;&gt;&lt;/i&gt;&lt;/span&gt;&lt;/a&gt;&lt;/h4&gt;

&lt;p&gt;&lt;a href=&quot;https://letsencrypt.org&quot;&gt;Let’s Encrypt&lt;/a&gt; &lt;code class=&quot;highlighter-rouge&quot;&gt;certbot&lt;/code&gt; will be used to automatically obtain and manage the SSL certificate for PowerDNS-Admin. It takes also care about the required modifications in Nginx configuration files:&lt;/p&gt;

&lt;p&gt;1 . Add the required repositories and install the tool via apt:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;add-apt-repository ppa:certbot/certbot
apt update
apt install software-properties-common  python-certbot-nginx -y
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;2 . Request a certificate for the server:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;certbot --nginx
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;When asked enter your email address and agree to the terms of Let’s Encrypt.&lt;/p&gt;

&lt;p&gt;3 . The connection to PowerDNS-Admin is now secured by SSL.&lt;/p&gt;

&lt;h4 class=&quot;anchor-wrap&quot;&gt;Creating a First User and Linking the API&lt;a style=&quot;margin-left: 10px;&quot; name=&quot;-Creating-a-First-User-and-Linking-the-API&quot; href=&quot;#-Creating-a-First-User-and-Linking-the-API&quot;&gt;&lt;span style=&quot;font-size: 16px&quot;&gt;&lt;i class=&quot;glyphicon glyphicon-link&quot;&gt;&lt;/i&gt;&lt;/span&gt;&lt;/a&gt;&lt;/h4&gt;

&lt;p&gt;1 . Open a web browser and enter the address of your server: &lt;code class=&quot;highlighter-rouge&quot;&gt;https://&amp;lt;YOUR_DOMAIN_NAME&amp;gt;/register&lt;/code&gt;. Fill in all required information to create your first admin user.&lt;/p&gt;

&lt;p&gt;2 . Once logged into the interface you will be asked to complete the information about the API. Fill in the following information:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;PDNS API URL&lt;/strong&gt; Your PowerDNS API URL (in this case &lt;code class=&quot;highlighter-rouge&quot;&gt;http://127.0.0.1:8081/&lt;/code&gt; as PowerDNS-Admin is running on the master server).&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;PDNS API KEY&lt;/strong&gt; Your PowerDNS API key (configured during the setup of the master server).&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;PDNS VERSION&lt;/strong&gt; Your PowerDNS version number (the latest version at the time of edition of this tutorial is: 4.1.5).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;3 . Once the infomation is provided, the dashboard will be available:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/docs/powerdns/powerdns-admin-dashboard.png&quot; alt=&quot;PowerDNS Admin&quot; class=&quot;img-responsive&quot; /&gt;&lt;/p&gt;

&lt;p&gt;After &lt;a href=&quot;https://en.wikipedia.org/wiki/Domain_Name_System#Circular_dependencies_and_glue_records&quot;&gt;declaring the new DNS servers with your registrar&lt;/a&gt;, you will be able to manage your domains from the PowerDNS Admin panel. For more information, you may refer to the &lt;a href=&quot;https://docs.powerdns.com/md/&quot;&gt;official documentation&lt;/a&gt;.&lt;/p&gt;</content><author><name>Scaleway</name><email>contact@scaleway.com</email><uri>https://www.scaleway.com</uri></author><category term="advanced topics" /><category term="compute" /><category term="mediaserver" /><category term="media" /><category term="powerdns" /><category term="dns" /><category term="server" /><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://www.scaleway.com/assets/images/og/scaleway.png" /></entry><entry><title type="html">How to deploy AwStats</title><link href="https://www.scaleway.com/docs/deploy-awstats-on-ubuntu/" rel="alternate" type="text/html" title="How to deploy AwStats" /><published>2018-12-03T00:00:00+00:00</published><updated>2018-12-03T00:00:00+00:00</updated><id>https://www.scaleway.com/docs/awstats</id><content type="html" xml:base="https://www.scaleway.com/docs/deploy-awstats-on-ubuntu/">&lt;h2 class=&quot;anchor-wrap&quot;&gt;AwStats Overview&lt;a style=&quot;margin-left: 10px;&quot; name=&quot;-AwStats-Overview&quot; href=&quot;#-AwStats-Overview&quot;&gt;&lt;span style=&quot;font-size: 16px&quot;&gt;&lt;i class=&quot;glyphicon glyphicon-link&quot;&gt;&lt;/i&gt;&lt;/span&gt;&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;AwStats is a very useful tool that can give you an overview of what is happening on your website and assist with site analysis. It is an open-source Web analytics reporting tool that generates advanced web, streaming, FTP or mail server statistics graphically.&lt;/p&gt;

&lt;p&gt;It is a complete enterprise grade server and log monitoring software that works as a CGI (&lt;a href=&quot;https://en.wikipedia.org/wiki/Common_Gateway_Interface&quot;&gt;Common Gateway Interface&lt;/a&gt;) or from command line and which shows you all possible information your log contains, in few graphical web pages, often and quickly.&lt;/p&gt;

&lt;p&gt;AwStats uses log file analysis to analyze log files from most web server including Apache, IIS and many other web server.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Requirements:&lt;/strong&gt;&lt;/p&gt;
  &lt;ul&gt;
    &lt;li&gt;You have an account and are logged into &lt;a href=&quot;https://cloud.scaleway.com&quot;&gt;cloud.scaleway.com&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;You have &lt;a href=&quot;https://www.scaleway.com/docs/configure-new-ssh-key/&quot;&gt;configured your SSH Key&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;You have sudo privileges or access to the root user.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/blockquote&gt;

&lt;h2 class=&quot;anchor-wrap&quot;&gt;Installing Apache&lt;a style=&quot;margin-left: 10px;&quot; name=&quot;-Installing-Apache&quot; href=&quot;#-Installing-Apache&quot;&gt;&lt;span style=&quot;font-size: 16px&quot;&gt;&lt;i class=&quot;glyphicon glyphicon-link&quot;&gt;&lt;/i&gt;&lt;/span&gt;&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;Before installing AwStats server packages, make sure Apache2 HTTP server is installed.&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;apt update
apt install apache2
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;h2 class=&quot;anchor-wrap&quot;&gt;Installing and Configuring AwStats Package&lt;a style=&quot;margin-left: 10px;&quot; name=&quot;-Installing-and-Configuring-AwStats-Package&quot; href=&quot;#-Installing-and-Configuring-AwStats-Package&quot;&gt;&lt;span style=&quot;font-size: 16px&quot;&gt;&lt;i class=&quot;glyphicon glyphicon-link&quot;&gt;&lt;/i&gt;&lt;/span&gt;&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;By default, AwStats package is available in the Ubuntu repository.&lt;/p&gt;

&lt;p&gt;1 . Install AwStats package&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;apt-get install awstats
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;2 . Enable the CGI module in Apache&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;a2enmod cgi
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;3 . Restart Apache&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;systemctl restart apache2
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;4 . Duplicate the AwStats default configuration file to one with your domain name&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;cp /etc/AwStats/awstats.conf /etc/awstats/domain-example.conf
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;5 . Edit the your AwStats domain name configuration file&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;nano /etc/awstats/domain-example.conf
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;6 . Update the settings shown below&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# Change to Apache log file, by default it's /var/log/apache2/access.log
LogFile=&quot;/var/log/apache2/access.log&quot;

# Change to the website domain name
SiteDomain=&quot;domain-example.com&quot;
HostAliases=&quot;www.domain-example localhost 127.0.0.1&quot;

# When this parameter is set to 1, AwStats adds a button on report page to allow to &quot;update&quot; statistics from a web browser
AllowToUpdateStatsFromBrowser=1
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;7 . Save and close the file&lt;/p&gt;

&lt;p&gt;8 . Build your initial statistics which is generated from the current logs on your server&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;/usr/lib/cgi-bin/awstats.pl -config=test.com -update
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;which returns&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;...
Create/Update database for config &quot;/etc/awstats/awstats.conf&quot; by AwStats version 7.6 (build 20161204)
From data in log file &quot;/var/log/apache2/access.log&quot;...
Phase 1 : First bypass old records, searching new record...
Searching new records from beginning of log file...
Phase 2 : Now process new records (Flush history on disk after 20000 hosts)...
Jumped lines in file: 0
Parsed lines in file: 5
 Found 0 dropped records,
 Found 0 comments,
 Found 0 blank records,
 Found 0 corrupted records,
 Found 0 old records,
 Found 5 new qualified records.
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;h2 class=&quot;anchor-wrap&quot;&gt;Configuring Apache For AwStats&lt;a style=&quot;margin-left: 10px;&quot; name=&quot;-Configuring-Apache-For-AwStats&quot; href=&quot;#-Configuring-Apache-For-AwStats&quot;&gt;&lt;span style=&quot;font-size: 16px&quot;&gt;&lt;i class=&quot;glyphicon glyphicon-link&quot;&gt;&lt;/i&gt;&lt;/span&gt;&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;Copy the content of the &lt;code class=&quot;highlighter-rouge&quot;&gt;cgi-bin&lt;/code&gt; folder to the default document root directory of your Apache installation. By default, this is in the &lt;code class=&quot;highlighter-rouge&quot;&gt;/usr/lib/cgi-bin&lt;/code&gt; folder.&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;cp -r /usr/lib/cgi-bin /var/www/html/
chown www-data:www-data /var/www/html/cgi-bin/
chmod -R 755 /var/www/html/cgi-bin/
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;h2 class=&quot;anchor-wrap&quot;&gt;Testing AwStats&lt;a style=&quot;margin-left: 10px;&quot; name=&quot;-Testing-AwStats&quot; href=&quot;#-Testing-AwStats&quot;&gt;&lt;span style=&quot;font-size: 16px&quot;&gt;&lt;i class=&quot;glyphicon glyphicon-link&quot;&gt;&lt;/i&gt;&lt;/span&gt;&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;Now you can access your AwStats by visiting the url &lt;code class=&quot;highlighter-rouge&quot;&gt;http://your-server-ip/cgi-bin/awstats.pl?config=test.com&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;which displays
&lt;img src=&quot;/assets/images/docs/awstats_homepage.png&quot; alt=&quot;AwStats_homepage.png&quot; class=&quot;img-responsive&quot; /&gt;&lt;/p&gt;

&lt;h2 class=&quot;anchor-wrap&quot;&gt;Setting-up Cron Job to Update Logs&lt;a style=&quot;margin-left: 10px;&quot; name=&quot;-Settingup-Cron-Job-to-Update-Logs&quot; href=&quot;#-Settingup-Cron-Job-to-Update-Logs&quot;&gt;&lt;span style=&quot;font-size: 16px&quot;&gt;&lt;i class=&quot;glyphicon glyphicon-link&quot;&gt;&lt;/i&gt;&lt;/span&gt;&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;It is recommended to schedule a cron job to regularly update the AwStats database using newly created log entries, so the stats get updated on a regular basis.&lt;/p&gt;

&lt;p&gt;1 . Edit the &lt;code class=&quot;highlighter-rouge&quot;&gt;/etc/crontab&lt;/code&gt; file&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;nano /etc/crontab
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;2 . Add the following line to tell AwStats to update every ten minutes&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;*/10 * * * * root /usr/lib/cgi-bin/awstats.pl -config=test.com -update
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;3 . Save and exit.&lt;/p&gt;</content><author><name>Scaleway</name><email>contact@scaleway.com</email><uri>https://www.scaleway.com</uri></author><category term="tutorial" /><category term="compute" /><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://www.scaleway.com/assets/images/docs/og.png" /></entry><entry><title type="html">Installing Jitsi Meet on Debian Stretch</title><link href="https://www.scaleway.com/docs/setting-up-jitsi-meet-videoconferencing-on-debian-stretch/" rel="alternate" type="text/html" title="Installing Jitsi Meet on Debian Stretch" /><published>2018-11-30T00:00:00+00:00</published><updated>2018-11-30T00:00:00+00:00</updated><id>https://www.scaleway.com/docs/jitsi</id><content type="html" xml:base="https://www.scaleway.com/docs/setting-up-jitsi-meet-videoconferencing-on-debian-stretch/">&lt;h2 class=&quot;anchor-wrap&quot;&gt;Jitsi Meet Overview&lt;a style=&quot;margin-left: 10px;&quot; name=&quot;-Jitsi-Meet-Overview&quot; href=&quot;#-Jitsi-Meet-Overview&quot;&gt;&lt;span style=&quot;font-size: 16px&quot;&gt;&lt;i class=&quot;glyphicon glyphicon-link&quot;&gt;&lt;/i&gt;&lt;/span&gt;&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;&lt;a href=&quot;https://jitsi.org/jitsi-meet/&quot;&gt;Jitsi Meet&lt;/a&gt; is a free and fully encrypted open source video conferencing service solution providing high quality and audio without subscription or the need to create an account.&lt;/p&gt;

&lt;p&gt;The tool provides features like:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Sharing of desktops, presentations, and more&lt;/li&gt;
  &lt;li&gt;Inviting users to a conference via a simple, custom URL&lt;/li&gt;
  &lt;li&gt;Editing documents together using Etherpad&lt;/li&gt;
  &lt;li&gt;Trading messages and emojis while video conferencing, with integrated chat.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Requirements&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;You have an account and are logged into &lt;a href=&quot;https://console.scaleway.com&quot;&gt;console.scaleway.com&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;You have &lt;a href=&quot;https://www.scaleway.com/docs/configure-new-ssh-key/&quot;&gt;configured your SSH Key&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;You have a Scaleway Compute Instance running Debian Stretch (9.0)&lt;/li&gt;
    &lt;li&gt;For best performances of Jitsi Meet, an instance with at least 4GB RAM is recommended&lt;/li&gt;
    &lt;li&gt;You have a domain or subdomain pointed to your Compute Instance&lt;/li&gt;
  &lt;/ul&gt;
&lt;/blockquote&gt;

&lt;h3 class=&quot;anchor-wrap&quot;&gt;Installing Jitsi Meet&lt;a style=&quot;margin-left: 10px;&quot; name=&quot;-Installing-Jitsi-Meet&quot; href=&quot;#-Installing-Jitsi-Meet&quot;&gt;&lt;span style=&quot;font-size: 16px&quot;&gt;&lt;i class=&quot;glyphicon glyphicon-link&quot;&gt;&lt;/i&gt;&lt;/span&gt;&lt;/a&gt;&lt;/h3&gt;

&lt;p&gt;1 . Configure a the hostname of the server corresponding to your domain / subdomain name:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;hostnamectl set-hostname jitsi
sed -i 's/^127.0.1.1.*$/127.0.1.1 jitsi.mydomain.tld jitsi/g' /etc/hosts
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;2 . Start by updating the software already installed on the system:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;apt update &amp;amp;&amp;amp; apt upgrade -y
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;3 . Install Java 8 on the server:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;apt install -y openjdk-8-jre-headless
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;4 . Setup the &lt;code class=&quot;highlighter-rouge&quot;&gt;JAVA_HOME&lt;/code&gt; environment variable:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;echo &quot;JAVA_HOME=$(readlink -f /usr/bin/java | sed &quot;s:bin/java::&quot;)&quot; | tee -a /etc/profile
source /etc/profile
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;5 . Install a &lt;a href=&quot;https://nginx.org&quot;&gt;Nginx&lt;/a&gt; web server before installing Jitsi Meet. The Jitsi installation tool will take care about the configuration of Nginx, if it is present on the system. Run the following commands to install and enable Nginx:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;apt install -y nginx
systemctl start nginx.service
systemctl enable nginx.service
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Important:&lt;/strong&gt; If Nginx or Apache is not present on the system, Jitsi Meet will automatically install &lt;a href=&quot;https://www.eclipse.org/jetty/&quot;&gt;Jetty&lt;/a&gt; during the installation.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;6 . Download the APT key and setup the repositories of Jitsi, to install the software via &lt;code class=&quot;highlighter-rouge&quot;&gt;apt&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;wget -qO - https://download.jitsi.org/jitsi-key.gpg.key | apt-key add -
sh -c &quot;echo 'deb https://download.jitsi.org stable/' &amp;gt; /etc/apt/sources.list.d/jitsi-stable.list&quot;
apt update -y
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;7 . Launch the installation of Jitsi Meet:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;apt install -y jitsi-meet
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;When asked, enter:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;The FQDN of your instance. For example &lt;code class=&quot;highlighter-rouge&quot;&gt;jitsi.mydomain.tld&lt;/code&gt; and press Enter.&lt;/li&gt;
  &lt;li&gt;When asked about the SSL certificate choose the &lt;code class=&quot;highlighter-rouge&quot;&gt;Generate a new self-signed certificate (You will later get a chance to obtain a Let's Encrypt certificate)&lt;/code&gt; option and press Enter.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;8 . Run the following script to generate a &lt;a href=&quot;https://letsencrypt.org&quot;&gt;Let’s Encrypt&lt;/a&gt; SSL certificate for your instance:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;/usr/share/jitsi-meet/scripts/install-letsencrypt-cert.sh
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;When asked, enter:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Your e-mail address to receive notifications regarding your certificate and press enter to request the certificate.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;9 . The Jitsi Meet instance is configured now and ready for a first conference call. Open a Web-browser and type the FQDN of your instance, for example: &lt;code class=&quot;highlighter-rouge&quot;&gt;https://jitsi.mydomain.tld&lt;/code&gt;. The following screen will appear:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/docs/jitsi/jitsi_home_2.png&quot; alt=&quot;Jitsi Meet Login&quot; class=&quot;img-responsive&quot; /&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Enter a name for your conference and press &lt;code class=&quot;highlighter-rouge&quot;&gt;Go&lt;/code&gt; to enter the conference room. It is now possible to share the link, to set a password, configure the audio and video quality and more for the conference.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;10 . Happy conferencing :)&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/docs/jitsi/jitsi-meet-conf-call-2.jpg&quot; alt=&quot;Jitsi Meet Conference.&quot; class=&quot;img-responsive&quot; /&gt;&lt;/p&gt;</content><author><name>Scaleway</name><email>contact@scaleway.com</email><uri>https://www.scaleway.com</uri></author><category term="advanced topics" /><category term="compute" /><category term="mediaserver" /><category term="media" /><category term="video" /><category term="sharing" /><category term="conference" /><category term="call" /><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://www.scaleway.com/assets/images/og/scaleway.png" /></entry><entry><title type="html">Setting up a Nginx reverse proxy with Object Storage</title><link href="https://www.scaleway.com/docs/setting-up-object-proxy-object-storage/" rel="alternate" type="text/html" title="Setting up a Nginx reverse proxy with Object Storage" /><published>2018-11-26T00:00:00+00:00</published><updated>2018-11-26T00:00:00+00:00</updated><id>https://www.scaleway.com/docs/setup-reverse-proxy-s3</id><content type="html" xml:base="https://www.scaleway.com/docs/setting-up-object-proxy-object-storage/">&lt;h2 class=&quot;anchor-wrap&quot;&gt;Object Storage Proxy Overview&lt;a style=&quot;margin-left: 10px;&quot; name=&quot;-Object-Storage-Proxy-Overview&quot; href=&quot;#-Object-Storage-Proxy-Overview&quot;&gt;&lt;span style=&quot;font-size: 16px&quot;&gt;&lt;i class=&quot;glyphicon glyphicon-link&quot;&gt;&lt;/i&gt;&lt;/span&gt;&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;The &lt;a href=&quot;https://www.scaleway.com/docs/object-storage-feature/&quot;&gt;Scaleway Object Storge&lt;/a&gt; service lets you store infinite data in buckets. You can either access the data directly via your bucket. This consumes data transfer and will be deducted from your monthly package or be billed in case you exceed your included data transfer.&lt;/p&gt;

&lt;p&gt;It is possible to access your bucket via a compute instance as a proxy. Transfer of data between your bucket and the compute platform is free of charge and you can use the bandwidth included with your instance to distribute the files in your bucket.&lt;/p&gt;

&lt;p&gt;We use a &lt;a href=&quot;https://github.com/coopernurse/nginx-s3-proxy&quot;&gt;pre-build and containerized Nginx server&lt;/a&gt; running on Docker to access the bucket.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Requirements&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;You have an account and are logged into &lt;a href=&quot;https://console.scaleway.com&quot;&gt;console.scaleway.com&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;You have &lt;a href=&quot;https://www.scaleway.com/docs/configure-new-ssh-key/&quot;&gt;configured your SSH Key&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;You have a Scaleway Compute instance&lt;/li&gt;
    &lt;li&gt;You have a Scaleway Object Storage bucket&lt;/li&gt;
  &lt;/ul&gt;
&lt;/blockquote&gt;

&lt;h3 class=&quot;anchor-wrap&quot;&gt;Installing Docker&lt;a style=&quot;margin-left: 10px;&quot; name=&quot;-Installing-Docker&quot; href=&quot;#-Installing-Docker&quot;&gt;&lt;span style=&quot;font-size: 16px&quot;&gt;&lt;i class=&quot;glyphicon glyphicon-link&quot;&gt;&lt;/i&gt;&lt;/span&gt;&lt;/a&gt;&lt;/h3&gt;

&lt;p&gt;We use a pre-build &lt;a href=&quot;https://www.docker.com/&quot;&gt;Docker&lt;/a&gt; container with Nginx to run the application. Therefore it is required that &lt;a href=&quot;https://www.scaleway.com/docs/how-to-install-docker-community-edition-ubuntu-bionic-beaver/&quot;&gt;Docker Community Edition is installed&lt;/a&gt; on the instance.&lt;/p&gt;

&lt;h3 class=&quot;anchor-wrap&quot;&gt;Configuring The Proxy&lt;a style=&quot;margin-left: 10px;&quot; name=&quot;-Configuring-The-Proxy&quot; href=&quot;#-Configuring-The-Proxy&quot;&gt;&lt;span style=&quot;font-size: 16px&quot;&gt;&lt;i class=&quot;glyphicon glyphicon-link&quot;&gt;&lt;/i&gt;&lt;/span&gt;&lt;/a&gt;&lt;/h3&gt;

&lt;p&gt;1 . The image requires a config file in the container at: &lt;code class=&quot;highlighter-rouge&quot;&gt;/nginx.conf&lt;/code&gt;. Use the -v option to mount one from your host.&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;docker run -p 8000:8000 -v /path/to/nginx.conf:/nginx.conf coopernurse/nginx-s3-proxy
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;The Nginx configration file should look like the following example:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;worker_processes 2;
pid /run/nginx.pid;
daemon off;

events {
	worker_connections 768;
}

http {
	sendfile on;
	tcp_nopush on;
	tcp_nodelay on;
	keepalive_timeout 65;
	types_hash_max_size 2048;
	server_names_hash_bucket_size 64;

	include /usr/local/nginx/conf/mime.types;
	default_type application/octet-stream;

	access_log /usr/local/nginx/logs/access.log;
	error_log  /usr/local/nginx/logs/error.log;

	gzip on;
	gzip_disable &quot;msie6&quot;;
	gzip_http_version 1.1;
	gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;

    proxy_cache_lock on;
    proxy_cache_lock_timeout 60s;
    proxy_cache_path /data/cache levels=1:2 keys_zone=s3cache:10m max_size=30g;

    server {
        listen     8000;

        location / {
            proxy_pass https://scw-bucket.s3.nl-ams.scw.cloud;

            aws_access_key scw-access-key;
            aws_secret_key scw-secret-key;
            s3_bucket scw-bucket;

            proxy_set_header Authorization $s3_auth_token;
            proxy_set_header x-amz-date $aws_date;

            proxy_cache        s3cache;
            proxy_cache_valid  200 302  24h;
        }
    }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Replace the following parameters in the file:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;scw-bucket&lt;/code&gt;: The name of your Scaleway Object Storage bucket&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;scw-access-key&lt;/code&gt;: Your &lt;a href=&quot;https://www.scaleway.com/faq/object-storage/#-Which-credentials-do-I-have-to-use-for-the-Object-Storage&quot;&gt;Access key&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;scw-secret-key&lt;/code&gt;: Your Secret key&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;2 . You can now access your bucket via a web browser by typing : &lt;code class=&quot;highlighter-rouge&quot;&gt;http://your_server_ip:8000&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;3 . &lt;strong&gt;(Optional)&lt;/strong&gt; If you want to cache data locally, bind a path to &lt;code class=&quot;highlighter-rouge&quot;&gt;/data/cache&lt;/code&gt;:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;docker run -p 8000:8000 -v /path/to/nginx.conf:/nginx.conf -v /my/cache/path:/data/cache coopernurse/nginx-s3-proxy
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;</content><author><name>Scaleway</name><email>contact@scaleway.com</email><uri>https://www.scaleway.com</uri></author><category term="advanced topics" /><category term="compute" /><category term="mediaserver" /><category term="object" /><category term="storage" /><category term="reverse" /><category term="proxy" /><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://www.scaleway.com/assets/images/og/scaleway.png" /></entry></feed>
