Apache webserver already running


(Max) #1

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


Running other websites on the same machine as Discourse
(Rafael dos Santos Silva) #2
  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

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


(Rafael dos Santos Silva) #4

And remember this:

Discourse maintains a lot of open connections!


(Felix Freiberger) #5

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:


(Max) #6

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.