Skip to content

Discourse Operations

Doug Hagan edited this page Apr 20, 2020 · 11 revisions

Discourse is an open source forum, available at [http://discourse.org].

Running

Stop the Discourse app:

/var/discourse/launcher stop app

Start the Discourse app:

/var/discourse/launcher start app

Monitoring

Interesting logs in:

/var/discourse/shared/standalone/log/rails/production.log

Installing

Install Docker

Create a new small AWS instance. 2GB memory is plenty, but needs 16GB of disk.

Create an elastic IP. Associate it with the instance.

Create a DNS record to the elastic IP.

sudo yum install -y docker
sudo service docker start

Add the ec2-user user to the docker group.

sudo usermod -a -G docker ec2-user

Log out and in again to get the new group.

Test the ability to run docker without root.

docker info

Install Discourse

sudo mkdir /var/discourse
sudo yum install -y git
sudo git clone https://github.com/discourse/discourse_docker.git /var/discourse

Configure Discourse

sudo -i
cd /var/discourse
cp samples/standalone.yml containers/app.yml

Configure /var/discourse/containers/app.yml as required.

./discourse-setup

SSL keys go in /var/discourse/shared/standalone/ssl.

Chaport integration

This is a chat system that integrates via Google Tag Manager.

GTM

  • Log in to tagmanager.google.com.
  • Create an Account (if it doesn't exist).
  • Create a Container (if it doesn't exist).
  • Get the container key (eg GTM-XXXXXXX).

Discourse

Chaport

  • Log in to the Chaport site as an Admin user.
  • Go to Settings | Installation Code.
  • Copy the Installation Code.

GTM

  • Return to Google Tag Manager.
  • Go to Workspace | Overview.
  • Click "Add a new tag".
  • Set tag name to "Chaport live chat".
  • Click on Tag Configuration and select Custom HTML.
  • Paste the Installation Code.
  • Click on Triggering.
  • Select "All Pages".
  • Click Save.
  • Click Publish (choose a version name like v1).

Upgrading

Prepare for upgrade

Stop the discourse app.

/var/discourse/launcher stop app

Take an image of the discourse app EC2 instance. Take a snapshot of the discourse DB RDS instance.

Initiate upgrade

sudo -i
cd /var/discourse
git pull
./launcher rebuild app

Start the discourse app.

/var/discourse/launcher start app

Clone this wiki locally