How VPS - How to use/setup VPS
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
How VPS - How to use/setup VPS
No Result
View All Result
Home Operating System CentOS

Install Discourse on CentOS 7

How VPS by How VPS
October 1, 2019
in CentOS
0
0
SHARES
40
VIEWS
Share on FacebookShare on Twitter

Contents

  1. Requirements
  2. Set up swap file
  3. Install Docker
  4. Install Discourse
  5. Configure Discourse
  6. Bootstrap and start Discourse
  7. Open Discourse in your browser
  8. Troubleshooting
  9. Want to contribute?


Discourse is a new open-source forum solution which is simple, clean, and straightforward. It is implemented with Ruby on Rails, a Postgres database, and a Redis server cache. This tutorial describes how to install Discourse on a Vultr VPS with CentOS 7.

Requirements

  • Vultr VPS with 1GB RAM minimum.
  • CentOS 7 x64 installed on the VPS.

Set up swap file

You must set up swap for a 1GB RAM VPS. If your VPS has more than 1GB RAM, you can skip this step. We will create a 2GB swapfile for 1GB RAM VPS.

  1. Create the swapfile.

    dd if=/dev/zero of=/swapfile bs=1M count=2048
    mkswap /swapfile
    chmod 600 /swapfile
    
  2. Edit fstab to add the swapfile into file systems table.

    Open fstab with vi:

    vi /etc/fstab
    

    Add the following line into the file:

    /swapfile       swap    swap    defaults      0       0
    
  3. Set the swap usage policy. Only use the swapfile when the system memory is low.

    sysctl -w vm.swappiness=10
    echo vm.swappiness = 10 | tee -a /etc/sysctl.conf
    sysctl vm.vfs_cache_pressure=60
    echo vm.vfs_cache_pressure = 60 | tee -a /etc/sysctl.conf
    
  4. Enable the swapfile.

    mount -a
    swapon -a
    
  5. Check the swapfile state.

    swapon -s
    

    If the swapfile has been enabled, you will see the following information.

    Filename                    Type    Size    Used    Priority
    /swapfile                  file     2097148 0       -1
    

Install Docker

Run the command below to install Docker on CentOS 7.

yum install docker

If you have disabled SELinux, you’d better disable it in docker also.

vi /etc/sysconfig/docker

Comment out line 4.

#OPTIONS='--selinux-enabled'

Start the docker service.

systemctl start docker
systemctl enable docker

Please note that if you restart firewalld, you will need restart docker also. Because firewalld will remove the docker chain from iptables when it’s restarted.

Install Discourse

Create a folder named discourse under /var and clone the Discourse repository.

mkdir /var/discourse
git clone https://github.com/discourse/discourse_docker.git /var/discourse

Go to the discourse folder.

cd /var/discourse

Copy the Discourse configuration template file into the containers folder.

cp samples/standalone.yml containers/app.yml

Configure Discourse

  1. Open the app.yml with vi.

     vi containers/app.yml
    
  2. If you are using a 1GB VPS, set the db shared buffer as 128MB in app.yml.

    db_shared_buffers: "128MB"
    
  3. Change UNICORN_WORKERS to 2 for a 1GB RAM instance.

    ## With 2GB we recommend 3-4 workers, with 1GB only 2
    UNICORN_WORKERS: 2
    
  4. Set your email address for the admin account. You will need this email to register the admin account on your Discourse forum.

    DISCOURSE_DEVELOPER_EMAILS: '[email protected]'
    
  5. Set the domain name for Discourse. For example, we set it as discourse.example.com, that means it would be accessible at the URL http://discourse.example.com/.

    ## TODO: The domain name this Discourse instance will respond to
    DISCOURSE_HOSTNAME: 'discourse.example.com'
    
  6. Configure your mail server for Discourse.

    If your mail server is on the same server with Discourse, configure it as follows.

    DISCOURSE_SMTP_ADDRESS: smtp.example.com                               # (mandatory)
    DISCOURSE_SMTP_PORT: 587                                                              # (optional)
    DISCOURSE_SMTP_USER_NAME: YOUR_EMAIL_ACCOUNT                # (optional)
    DISCOURSE_SMTP_PASSWORD: YOURPASSWORD                             # (optional)
    DISCOURSE_SMTP_ENABLE_START_TLS: flase                                    # (optional, default true)
    DISCOURSE_SMTP_OPENSSL_VERIFY_MODE: none
    

    If you use a remote SMTP server, please edit the app.yml as follows.

    DISCOURSE_SMTP_ADDRESS: smtp.example.com                               # (mandatory)
    DISCOURSE_SMTP_PORT: 587                                                              # (optional)
    DISCOURSE_SMTP_USER_NAME: [email protected]                          # (optional)
    DISCOURSE_SMTP_PASSWORD: YOURPASSWORD                             # (optional)
    DISCOURSE_SMTP_ENABLE_START_TLS: true                                     # (optional, default true)
    
  7. Save and exit app.yml.

Bootstrap and start Discourse

Run the command below to bootstrap Discourse.

./launcher bootstrap app

After the bootstrapping process has completed, start Discourse.

./launcher start app

Open Discourse in your browser

On your client PC, input the domain name that you configured for Discourse in app.yml. You will see your own instance of Discourse.

Troubleshooting

  • By default, Docker will listen on port 80. If the port 80 has been used by Nginx or Apache already, you need move that service to another port; or change Docker to another port. For example, change “80:80” to “8080:80” in app.yml to make Docker listen on port 8080.
  • On the 1GB RAM VPS, it may fail to update the Discourse to the new version, and you will see a “502 Bad Gateway” when accessing Discourse. The simple solution for this issue is to run ./launcher rebuild app to rebuild your Discourse instance.

Want to contribute?

You could earn up to $300 by adding new articles

Submit your article
Suggest an update
Request an article
How VPS

How VPS

Related Posts

Failed to download metadata for repo 'appstream' on Centos 8
CentOS

How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

February 25, 2022
How to Install BoltWire CMS on CentOS 7
CentOS

How to Install BoltWire CMS on CentOS 7

February 14, 2020
Showterm.io – A Terminal/Shell Recording, Upload and Share Tool for Linux
CentOS

Setup HTTP Authentication With Nginx on CentOS 7

February 14, 2020
Next Post

Getting Started with Kubernetes on CentOS 7

Setup Your Own Private Network With OpenVPN

Configuring BGP using Quagga on Vultr (CentOS 7)

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Follow Us

  • 121 Followers
  • 87.2k Followers

Recommended

How to Install ImpressPages CMS 5.0 on a Fedora 26 LAMP VPS

3 years ago

Build Your Social Network With Diaspora on CentOS 7

3 years ago

12 TOP Command Examples in Linux

4 years ago

How to Install InvoicePlane on FreeBSD 12

3 years ago

Instagram

    Please install/update and activate JNews Instagram plugin.

Categories

  • Arch
  • Authentication
  • Backups
  • BSD
  • Centmin Mod
  • CentOS
  • Control Panels
  • CoreOS
  • CWP
  • Debian
  • Directadmin
  • Encryption
  • Fedora
  • Firewalls
  • Hocvps Script
  • Hosting providers
  • Kloxo-MR
  • Linux
  • Mitigations
  • Operating System
  • Plesk
  • Reviews
  • Securing VPS/Servers
  • Security Patches
  • SSL Certificates
  • Uncategorized
  • Upgrading
  • VPS/Servers management guides
  • Vulnerability Detection
  • Web servers software
  • Webhosting Control Panel

Topics

Apache Web Server Bluehost Review 2019 Bluehost Review 2020 Bluehost Review 2021 Centmin Mod CentminMod centos install htop fsck htop install HTTP DoS attack Install Snort on an Ubuntu install Zabbix on CentOS install Zabbix on CentOS 7 Linux Commands linux guide linux install htop linux vps setup guide MariaDB MariaDB Error Mysql mysqld error optimize MariaDB optimize Mysql snort Ubuntu
No Result
View All Result

Highlights

Top Free Web Hosting Control Panels To Manage VPS/Dedicated Servers

Webmin Reviews

Virtualmin Reviews

CentOS Web Panel Reviews

Ajenti Reviews

ISPConfig Reviews

Trending

Failed to download metadata for repo 'appstream' on Centos 8
CentOS

How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

by How VPS
February 25, 2022
0

I tried to update some extensions by use yum on centOs which I specified in Dockerfile. After...

How to Fix MySQL Error "Plugin 'InnoDB' registration as a STORAGE ENGINE failed"?

How to Fix MySQL Error “Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed”?

November 17, 2020
How to optimize Mysql or MariaDB

How to optimize Mysql or MariaDB

November 3, 2020
Top Free Web Hosting Control Panels To Manage VPS/Dedicated Servers

Top Free Web Hosting Control Panels To Manage VPS/Dedicated Servers

February 17, 2020
Webmin Reviews

Webmin Reviews

February 17, 2020
How VPS – How to use/setup VPS

We bring you the best Premium WordPress Themes that perfect for news, magazine, personal blog, etc. Visit our landing page to see all features & demos.
LEARN MORE »

Recent News

  • How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8 February 25, 2022
  • How to Fix MySQL Error “Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed”? November 17, 2020
  • How to optimize Mysql or MariaDB November 3, 2020

Categories

  • Arch
  • Authentication
  • Backups
  • BSD
  • Centmin Mod
  • CentOS
  • Control Panels
  • CoreOS
  • CWP
  • Debian
  • Directadmin
  • Encryption
  • Fedora
  • Firewalls
  • Hocvps Script
  • Hosting providers
  • Kloxo-MR
  • Linux
  • Mitigations
  • Operating System
  • Plesk
  • Reviews
  • Securing VPS/Servers
  • Security Patches
  • SSL Certificates
  • Uncategorized
  • Upgrading
  • VPS/Servers management guides
  • Vulnerability Detection
  • Web servers software
  • Webhosting Control Panel

[mc4wp_form]

© 2018 JNews - City News Magazine WordPress theme. All rights belong to their respective owners.
JNews is a top selling 2018 WordPress News, Blog, Newspaper & Magazine Theme.

No Result
View All Result
  • Home

© 2023 JNews - Premium WordPress news & magazine theme by Jegtheme.