Apache webserver already running

I have successfully install discourse with docker on a clean install of debian.

I want to get it on to my production webserver. It already hosts a few websites, and it is a pretty beafy server, so I am reluctant to spin up a new machine just for discourse.

I am sure there is an easy solution for this. I have ran into a few posts that deal with nginx. My server is running apach2. Can someone advise me the best way to install discourse on to a webserver already running web sites

many thanks in advance

1 Like
  1. Install Discourse
  2. Change the external port from 80 to another (like 8080)
  3. Make apache reverse proxy to Discourse on port 8080.
3 Likes

It’s easy, create a normal conf file in sites-available, but add this at the end of the server block

        ProxyPreserveHost On
        ProxyRequests Off
        ProxyPass / http://0.0.0.0:7654/
        ProxyPassReverse / http://0.0.0.0:7654/

Then in app.yml change the exposed port

80:80

to

7654:80

a2ensite

and bootstrap, start

3 Likes

And remember this:

https://meta.discourse.org/t/run-discourse-with-or-alongside-existing-apache-sites/19514/20?u=falco

Discourse maintains a lot of open connections!

3 Likes

If you have trouble with this, you can also set up nginx as your frontend server listening on port 80, forwarding requests to either Apache or Discourse. nginx has no problem with maintaining these open connections.

Here’s a tutorial on how to set up the nginx <-> Discourse part:

3 Likes

Hi All

Thanks for all the replies. I will have a look into all of the info given.

I have never used nginx yet, so I may give the other methods a go first.

I currently signed up to Linux Academy, and they have an nginx course on there, so may give that a bash, and see what happens.