Hello everyone ! :) I’m really puzzled by a little problem with my personnal website project : I can’t manage to install any Discourse instance on my droplet, with already WordPress and Apache installed.
I know there are already many threads for this. But they don’t exactly fit to my case : Install Discourse in a Docker container, with Apache used to serve WordPress.
For example, this thread is for installing WordPress on a droplet with Discourse. But I need the reverse : https://www.digitalocean.com/community/questions/need-help-with-installing-discourse-and-wordpress
And this one is for installing Discourse on a droplet / server with WordPress served by Nginx. But my WordPress is served by Apache : https://blog.khophi.co/install-run-discourse-behind-nginx-right-way-first-time/
So it doesn’t fit to my situation.
The manipulations are probably 95% similar between Apache and Nginx, but I don’t want to do any mistake.
I could use a separate droplet for Discourse, but I need to use Discourse’s API to share its database with a custom social network app, created by the main programmer of my project. And it also uses a JSON add-on installed on the WordPress instance.
So it will be way simplier if I can install all that stuff on the same droplet. Without any conflicts.
Apache is listening to port 80.
My droplet uses Ubuntu 18.04.
Discourse will be installed on a subdomain : forum.example.com. DNS records are already done.
Any tips or suggestions are welcome ! :)
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Sign up for Infrastructure as a Newsletter.
Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Hello,
This is a really good question.
I’ve tried to replicate your setup and create a step by step guide on how to set Discourse on a Droplet with Apache and an existing Wordpress installation. To be honest it took me a while to figure the whole process out.
Here are the steps that you would need to take:
Prerequisites
To be on the safe side make sure to backup your Droplet, so that in case anything goes wrong, you could revert back to a working version
SSH to your Droplet
Apache installed, you can follow the steps on how to do that here:
https://www.digitalocean.com/community/tutorials/how-to-install-the-apache-web-server-on-ubuntu-18-04
Step 1 - Install Docker
To install Docker please follow the steps here:
https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-18-04
Step 2 - Download Discourse
First, create a directory where you would store your Discourse files:
After that clone the official Discourse Docker Image into
/var/discourse
.Step 3 - Configure Discourse to listen on port 8080
We will use the
standalone.yml
template it includes all of the necessary services like PostgreSQL, Redis and etc.You copy the sample file with the following command:
After that edit the file with your favorite editor. Open the
/var/discourse/containers/app.yml
and update and the ports on lines 23 and 24:Also if you do not yet have an SSL certificate make sure to comment line 16 out:
Just add the # symbol in front of the
- "templates/web.ssl.template.yml
line otherwise Discourse would not start.Step 4 - Setup Discourse
Then, start Discourse (as this is the first time that you are starting the service it would bootstrap the application with the new changes that you have in your
app.yml
file):First
cd
to the/var/discourse
directory:Then run the following setup command:
Note: Make sure to provide valid Mail server settings as otherwise, the setup might fail.
Step 5 - Setup Apache
In your
/etc/apache2/sites-available/
create a new file calledforum.example.com.conf
and add the following Vhost content:And after that, you would be able to access Discourse directly via your domain name.
Hope that this helps! Regards, Bobby