Run Discourse with or alongside existing Apache sites?

(Sof) #21

Why ? Whats should be a better solution ?


How do I know if my apache is non-evented or not?

(Jens Maier) #23

apache2 -t -D DUMP_MODULES | grep mpm_

This will show which MPM (multi processing module) your Apache uses.

  • mpm_event_module is evented,
  • mpm_worker_module is hybrid with one thread per connection,
  • mpm_prefork_module is traditional with one process per connection.

(Thisgeekza) #24

For what it’s worth, I dumped apache in favour of nginx. It was a pain to get everything working properly, but some google-fu sorted me out.


Apologies to bump up an old topic.

The setup as described above has worked for me flawlessly up until today. Now I get a 502 Bad Gateway error when trying to access my site. Apache error log says the following:

[Tue Jan 13 19:02:44.709212 2015] [proxy:error] [pid 969] (111)Connection refused: AH00957: HTTP: attempt to connect to (localhost) failed
[Tue Jan 13 19:02:44.709270 2015] [proxy:error] [pid 969] AH00959: ap_proxy_connect_backend disabling worker for (localhost) for 60s
[Tue Jan 13 19:02:44.709281 2015] [proxy_http:error] [pid 969] [client] AH01114: HTTP: failed to make connection to backend: localhost
[Tue Jan 13 19:02:44.709327 2015] [proxy:error] [pid 969] AH00940: HTTP: disabled connection for (localhost)

Any ideas?

UPDATE: rebuilding the app solved the issue :slight_smile:

(Badr) #26

I apologize for reviving this thread, hopefully you can advise. I am running into a problem, while using your solution.

When I restart Apache2 I get this error:

root@webserver:~# service apache2 restart

  • Restarting web server apache2 [fail]
  • The apache2 configtest failed.
    Output of config test was:
    AH00526: Syntax error on line 33 of /etc/apache2/sites-enabled/000-default.conf:
    Invalid command ‘ProxyPreserveHost’, perhaps misspelled or defined by a module not included in the server configuration
    Action ‘configtest’ failed.
    The Apache error log may have more information.

I have tried changing that line to see if it does something else but I am stuck as to why it won’t work.

(omfg) #27

(Christopher Semmler) #28

I would like to add Pound to that list, since it is very comfortable to handle and much easier to configure than e.g. Varnish.

(Matt Palmer) #29

Pound is easier to configure than Varnish because it only does half of what Varnish does. It’s closer in functionality to haproxy.

(Matt Palmer) #30

ProxyPreserveHost is provided by mod_proxy; you’ll need to enable that module in your Apache configuration (the details of how to do that vary by OS, distribution, and Apache version) in order to make that configuration directive work.

(Erasmus Grant) #31

Please make a tutorial.

(The Literorrery) #32

Any chance you could share what the DocumentRoot should be if you don’t have a fancy symlink?

(Matt Palmer) #33

Whatever the “fancy symlink” would otherwise point to.

(The Literorrery) #34

Clearly. What’s the default document root of Discourse?


So when you installed discourse did you do it in /var/discourse or /var/www/ ?

(Matt Palmer) #36

Hopefully, neither. Discourse runs from a Docker container.