Discourse Civilized Discussion Kit on Xenial at prgmr.com

Background

As intended by its creators Discourse Civilized Discussion Kit is becoming the WordPress of forums. It’s a super sophisticated mobile-first, single-page-application discussion forum software written with Rails for the backend API and EmberJs for frontend.

I’ve recently started using Prgmr.com, an independent Xen hosting provider in Silicon Valley. Their prices are better than Digital Ocean and the performance seems exceptional. No, this is not paid content or an affiliate link. I don’t do that.

Preparation

The official Discourse docs are excellent, and are canonical, there are also good Digital Ocean docs, although they might not be so current, for instance you dont need 2GB RAM, 1GB is fine.

We will use the 30 minute cloud official install docs

We have a $5 / 1.5 GB RAM Xen VPS from Prgmr.com with Docker pre-installed, if not run these to install AUFS from Discourse comment

wget -qO- https://get.docker.com/ | sh
sudo apt-get install linux-image-extra-$(uname -r)
sudo modprobe aufs

Let’s login via ssh

ssh -i ~/.ssh/id_rsa [email protected]
Welcome to Ubuntu 16.04.1 LTS (GNU/Linux 4.4.0-62-generic x86_64)

* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
Last login: Fri Feb 3 20:33:10 2017 from 2603:3024:1404:3800:a96a:ec76:559d:327a
[email protected]:~#

Discourse is one of the first public free software apps to use Docker, and they do it really well, as a kind of image delivery system

we install Docker thus

wget -qO- https://get.docker.com/ | sh

I get an error and uncomment these lines /etc/login.defs from Github comment


# System accounts
SYS_GID_MIN               100
SYS_GID_MAX               999

and then install docker-engine

sudo apt install docker-engine

[email protected]:~# docker -v
Docker version 1.13.0, build 49bf474

 

Install Discourse

ripped straight from the docs


sudo -s
mkdir /var/discourse
git clone https://github.com/discourse/discourse_docker.git /var/discourse
cd /var/discourse

EDITORS NOTE: unfinished and needing changes

Command line screencasts with asciinema

Screencasting a bash session with Asciinema, a GPL Python terminal session recorder at github asciinema and website asciinema.org.

This can be useful for watching command line progress along with a blog post. Its also possible to copy and paste text from the asciinema, unlike a video.

On Mac Sierra

brew install asciinema

To create a new recording

asciinema rec [filename]

In my case I am installing a session where I install Middleman

asciinema rec middleman

to play the screencast locally

asciinema play middleman

To publish asciinema to the web and the public site you need to create an account using a password-less email registration and login system.

Visit the site asciinema.org, enter email, authorize email and account, then on command line.

asciinema auth

and then in browser confirm authorization and finally upload middleman installation

asciinema upload middleman

You can see the warts-and-all Middleman installation on another blog post http://blog.devekko.com/middleman-static-site-generator

Aegir 3.8 on Ubuntu 16.04 Xenial on LXD LXC (eventually)

I have decided to write some books and work on apps from those. One book will be on website building and the other will be on self-hosting.

Therefore I am going to record the set-up, customization, programming and themes of various systems for hosting.

One I know relatively well is Aegir, basically Drupal hosting Drupal with Drush. I am going to work through Aegir 3.8 on Ubuntu Xenial with PHP 7 which is twice as fast.

As a second step I use the Remote Import feature to import sites from an OVH server.

The plan is to build a Drupal 7 and a Drupal 8 site each using my emerging framework.

Community Organizing

For a maybe 12 months I volunteered as community organizer for the Aegir Project and co-founded and co-organized an event at the United Nations hosted within nyccamp and opencamps.org.

This event is called Aegir Summit and we had Richard Stallman of Free Software Foundation give the Aegir group a strategy session and he also gave the entire summit a presentation on Free Software. The 2015 Aegir Summit archive site has details on sessions etc and the 2016 Aegir Summit featured NASA hosting with Aegir by Mobomo.

The Aegir Summit mini site has some additional info as does the marketing site Aegir Hosting System and the community site. I also gave a talk at Stanford Drupal Camp (slides) and at SCALE as report-back sessions from the New York event, basically telling my story and advocating commercial free software.

Virtual Machine

Am working on LXD / LXC I use a partly pre-configured Xenial LXC container

launch a fresh LXC container

enter enter the container and change hostname, hosts and network

lxc exec aegir-devekko-io bash

update and upgrade the container

apt-update && apt-upgrade

edit the /etc/hostname

aegir-devekko-io

/etc/hosts files, I turn off ipv6 as I cant use DNS with ipv6 on my LAN and it creates issues


127.0.0.1 aegir.devekko.io aegir-devekko-io localhost
REDACTED aegir.devekko.io aegir-devekko-io localhost
10.1.10.115 aegir.devekko.io aegir-devekko-io localhost

/etc/network/interfaces.d/eth0.cfg

The primary network interface


auto eth0:0 eth0:1 
iface eth0:0 inet static 
address REDACTED/28 
gateway REDACTED

iface eth0:1 inet static 
address 10.1.10.115/24

dns-nameservers REDACTED 8.8.8.8 
dns-search devekko.io

 

Pre-requisites for Aegir 3.8

From the Aegir docs we first update and upgrade

apt update && apt upgrade

we then check DNS and hostname

uname -a
Linux aegir-devekko-io 4.4.0-57-generic #78-Ubuntu SMP Fri Dec 9 23:50:32 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
hostname -i
127.0.0.1 REDACTED 10.1.10.115

install utilities

apt install git wget rsync

According to Aegir maintainer colan in response to my ISSUE on Drupal.org he does this for the Postfix MTA, I’ve been caught on this numerous times on Ubuntu and Aegir

apt install postfix bsd-mailx mutt

in Postfix config I choose Internet site and aegir.devekko.io as email domain

alter /etc/postfix/main.cf

inet_interfaces = 127.0.0.1

Install Aegir 3.9

add project repositories

echo "deb http://debian.aegirproject.org stable main" | sudo tee -a /etc/apt/sources.list.d/aegir-stable.list</pre>

and archive key to keyring

wget -q http://debian.aegirproject.org/key.asc -O- | sudo apt-key add -
sudo apt-get update
sudo apt update

Install Aegir 3.9 Debian Packages

sudo apt-get install aegir3

manually enter a Mysql password (some of the Ansible installers handle this)

choose an Aegir UI domain, Aegir is installed

start the file wall

sudo ufw allow http
Rules updated
Rules updated (v6)
[email protected]:~# sudo ufw enable
Firewall is active and enabled on system startup

Sites | aegir.devekko.io - Chromium_002

Note, I did actually have issues and had to autoremove and purge postfix and tried to manually install Php etc

Installation did finally work after considerable troubleshooting. I would say that there is defintely something happening during install on Xenial that is not being handled properly.

Aegir is installed, and now its time to add a Drupal 7 and a Drupal 8 site for my project.

More in later blog posts