@ Top-level domain redirects to www

  1. Use sudo to temporarily elevate privileges and edit app.yml
cd /var/discourse
sudo nano /containers/app.yml
  1. Edit the Discourse configuration file app.yml

You only need to configure the main domain and alias relationships in the Discourse configuration file app.yml:

DISCOURSE_HOSTNAME: 'www.discourse.cc'      # Your main domain (the final access address)
DISCOURSE_HOSTNAME_ALIASES: 'discourse.cc'  # Other aliases, which will automatically redirect to the main domain

Please note: DISCOURSE_HOSTNAME should be followed by the “main domain” you want users to ultimately access, while DISCOURSE_HOSTNAME_ALIASES should contain the “aliases” you want to redirect to the main domain.
After editing, save the file (Ctrl+O, Enter, Ctrl+X to exit).

  1. Finally, rebuild with root privileges:
sudo ./launcher rebuild app
לייק 1

This is usually unnecessary on a standard install because you log in as root

3 לייקים

I didn’t quite understand what you meant. Could you please explain it again?

Standard install just requires that you be root to run the scripts. It’s really best practice to disallow root logins. Digital ocean enables them by default since it’s just easier. Disallowing password login for root is almost as good as requiring login as another user.

If you’re going to use the machine for any purpose other than administration (unusual for a server) then you definitely want another user.

לייק 1

Root login is disabled. How can this be implemented if needed?

And that’s probably good practice in the long run as @pfaffman pointed out.

My point is on the standard install, the standard login approach is via root, so sudo is unnecessary.

The major point here is that instructions for “non standard” (if more secure) installs might be confusing to some:

  • “why do I suddenly need sudo?”.

But sure, logging in with least privileges is good practice.