Discourse – Bringing civilized discussion to the Internet
Configuring Nginx
The Discourse bundle comes with two Nginx configuration files you can use straight out of the box. All you have to do is copy them over to the /etc/nginx/conf.d/
directory (Listing 4).
Listing 4
Copying the Nginx Configuration Files
If you have a default.conf
file in your Nginx conf.d
directory and you're not planning on running any other sites through Nginx, you can give it a different file name to avoid the possibility of it interfering with your setup:
# mv /etc/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf.disabled
At the very least, you'll have to change the server_name
line in /etc/nginx/conf.d/discourse.conf
,
server_name <enter.your.web.hostname.here>;
and change <enter.your.web.hostname.here>
to whatever you decide to name your Discourse server. However, you might also want to change the port number on which Nginx listens or the default public directory if you have installed Discourse somewhere different on your system.
On my test system, I also had to comment out the etag
line with a hash sign (#
) as follows:
# etag off;
Once saved and after exiting from the configuration file, I had to create the /var/nginx
directory by hand before I could safely reload Nginx:
# mkdir /var/nginx # /etc/init.d/nginx reload
Getting back to the discourse user, install Bluepill, a process monitoring tool (Listing 5). In theory, you can now run Discourse using
Listing 5
Installing Bluepill
$ RUBY_GC_MALLOC_LIMIT=90000000 RAILS_ROOT=/var/www/discourseRAILS_ENV=productionNUM_WEBS=2 bluepill \ --no-privileged-c ~/.bluepill load /var/www/discourse/config/discourse.pill
In our lab, however, I encountered an error message that indicated that there was an uninitialized constant in the Discourse number_helper.rb
file. If you also encounter this bug, open the file, which you will find in /home/discourse/.rvm/gems/ruby-2.0.0-p576/gems/activesupport-4.2.0.beta1/lib/active_support/
with your text editor and add the following as the first line of the file:
require 'active_support'
Now running the lines mentioned above starts Discourse without a hitch. To make sure Discourse runs every time the server boots, run crontab -e
as the discourse user and include the line in Listing 6 as a cron job.
Listing 6
Start Discourse from cron
Up and Running
Now that your Discourse instance is up and running (Figure 2), users can start registering their accounts. Notice, however, that on your first visit, the site tells you to set up accounts for the admin users you assigned in the discourse.conf
file in Listing 2. Therefore, you might want to register those users before going public with your site.
As soon as you register a user with administrator privileges, they'll see a different page from regular users (Figure 3). The first thing they are asked to do is create some content – at least five topics (posts that start a thread) and 30 public posts – so users can start acquiring "trust levels."
I'll look at the matter of trust a bit later on, but first I'll try to clarify the jargon and talk about how to start posting. First off, a topic in Discourse is the first post in a thread. The rest of the posts are just posts.
Instead of having different forums that contain discussion threads, Discourse is more or less flat and uses categories to split the topics by theme. Suppose you wanted to use Discourse for your LUG; you could have categories for Announcements, Suggestions, Support, Off Topic, and so on. Initially, only an administrator can create a category (Figure 4) by clicking on the menu icon next to their avatar in the upper right-hand corner of the screen and choosing Categories. Once in the Categories screen, clicking the grey + Create Category button on the left lets you start a thread.
Subcategories are created in the same way you create a regular category, except you then assign it to a parent category. For example, the Meetings category could have Announcements as its parent, and it would become a subcategory. The Create Category dialog lets you decide the color of the category's label, the category's permissions (as in, who can create a new topic, see posts, and reply within the category), and personalize a category with an icon and a background image.
Before you start creating content, you will want to do some housework via the administrator's control panel. You can access this by clicking on the menu icon and choosing Admin (Figure 5).
The first pane, the Dashboard, informs you of software updates and stats, and on the right, it gives you a rundown of problems detected on your site. On a new site, the issues will mostly refer to unconfigured features, such as favicons, unconfigured email addresses for administration purposes, and so on.
Across the top, a series of tabs allow you to configure every aspect of your Discourse site. If you click on Settings, you'll see no fewer than 18 tabs down the left side of the screen (Figure 6).
To say that the Discourse configuration tool is comprehensive is an understatement.
Under Settings, you can solve most of the problems shown in the Dashboard and even set up Discourse to act as a mailing list server, for those old-timers who prefer settling issues by email (see the Email tab for this). You can also establish how users can register, deciding whether registration is by invitation only (perhaps a good idea for new sites still in the testing phase), must be approved by the moderator, and so on. You can also define how users gain "trust."
Trust Issues
To begin, you have to understand how Discourse regulates the content that gets posted to a site and how it tries to keep the level of, well, discourse high. First off, if you try to create a topic or post with very little content, you get a warning (Figure 7). Also, if you just repeat the same words over and over, you are reprimanded (Figure 8).
Another filter comes from the users themselves, who can silently "like" (click the heart at the bottom of any post) or "flag" (click the flag icon) a post. If someone participates on the site enough and gets enough likes, they rise through the ranks and reach new levels of trust (see Settings | Trust Levels), which allows them more access to features on the site.
To begin, users start at level 0 with very limited privileges, but at level 1 (Basic) they can start including images in posts and flag other users' posts if they deem them inappropriate; at level 2 (Member), they can invite new users to the site to participate in the discussion of a topic or invite new users with a group private message.
A level 3 (Regular) user can recategorize and rename posts, participate in the exclusive "frequent flyers" lounge, and so on. However, if someone is flagged often enough, they can be demoted and even banned from the site.
The last lines of defense are, of course, the moderators and admins, who can delete posts and ban users, bypassing the meritocratic system described above.
« Previous 1 2 3 Next »
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
Canonical Bumps LTS Support to 12 years
If you're worried that your Ubuntu LTS release won't be supported long enough to last, Canonical has a surprise for you in the form of 12 years of security coverage.
-
Fedora 40 Beta Released Soon
With the official release of Fedora 40 coming in April, it's almost time to download the beta and see what's new.
-
New Pentesting Distribution to Compete with Kali Linux
SnoopGod is now available for your testing needs
-
Juno Computers Launches Another Linux Laptop
If you're looking for a powerhouse laptop that runs Ubuntu, the Juno Computers Neptune 17 v6 should be on your radar.
-
ZorinOS 17.1 Released, Includes Improved Windows App Support
If you need or desire to run Windows applications on Linux, there's one distribution intent on making that easier for you and its new release further improves that feature.
-
Linux Market Share Surpasses 4% for the First Time
Look out Windows and macOS, Linux is on the rise and has even topped ChromeOS to become the fourth most widely used OS around the globe.
-
KDE’s Plasma 6 Officially Available
KDE’s Plasma 6.0 "Megarelease" has happened, and it's brimming with new features, polish, and performance.
-
Latest Version of Tails Unleashed
Tails 6.0 is based on Debian 12 and includes GNOME 43.
-
KDE Announces New Slimbook V with Plenty of Power and KDE’s Plasma 6
If you're a fan of KDE Plasma, you'll be thrilled to hear they've announced a new Slimbook with an AMD CPU and the latest version of KDE Plasma desktop.
-
Monthly Sponsorship Includes Early Access to elementary OS 8
If you want to get a glimpse of what's in the pipeline for elementary OS 8, just set up a monthly sponsorship to help fund its continued existence.