How to install wordpress & discourse on the same server?


(Roberto_Pezzali) #1

Hello everybody. I’ve a lamp server with a wordpress blog. I want to install also Discourse as discussion engine with the WP plugin.

IHow can I install Discourse on my server? The server has Ubuntu on board, I’ve experience with php but I’m totally new to Rails. Is there any guide to follow to obtain a result like this Can we talk? / Boing Boing with Discourse and wordpress totally integrated?

Thank you


(Michael Brown) #2

If you want to keep things simple, I’d recommend putting the two sites on different hostnames and modifying your nginx configuration to forward requests for ‘blog.yoursite.com’ to Apache for processing.

Take our nginx.sample.conf and modify it to use wordpress. i.e. along these lines:

server {
  …
  server_name blog.yoursite.com;
  location / {
      proxy_pass http://localhost:81; # Apache is listening on port 81
  }
  …
}

If you have trouble getting it working or need other examples, I’d suggest checking ServerFault.


(Wint) #3

It’s worth it to look at the nginx documentation as well, it’s a little overwhelming at first but I managed to get my forums running and my main page just by looking through what they’ve provided.

http://wiki.nginx.org/Configuration


(Roberto_Pezzali) #4

Thank you so much I will try!


(Roberto_Pezzali) #5

@supermathie

I try to follow your hint… but I have a problem.

In the discourse configuration of nginx I add this lines:

server_name kiteworld.it;

location / {
      proxy_pass http://localhost:81; # Apache is listening on port 81
  }

The redirect is working, but I cannot have images or CSS:

In my developer console I found that the browser is looking for css and images here:

http://localhost:81/wp-content/themes/twentythirteen/style.css?ver=2013-07-18

How can I fix this?


(Michael Brown) #6

You need to have your app act as if was kiteworld.it, not localhost:81.


(Roberto_Pezzali) #7

@supermathie

Solved: the problem is Wordpress, you have to manually change a db field if you change the port from the default 81!

Now I have wordpress + discourse working together!


(Erlend Sogge Heggen) #8

Could you please write up a simple guide about your experiences with making WordPress & Discourse coexist? I bet there’s a lot of people, like me, who’d be very interested in learning more about this particular use case.


(Roberto_Pezzali) #9

It’s very very simple.

Follow the guide to install Wordpress on LAMP (apache + mysql + php)
Move apache on port 81 (there are a lot of guides)
Follow the guide to install Discourse on Ubuntu.

Edit the file discourse.conf that you create when you install Discourse following the guide

Add this lines:

server {  
  server_name blog.yoursite.com;
  location / {
      proxy_pass http://localhost:81; # Apache is listening on port 81
  }
 }

If you do this in this order everything is ok. The problems come when you install wordpress after moving apache to the port 81: in this case you have to manually edit the tablet wp_config of the wordpress database using phpmyadmin removing any reference to the port 81!!


What is the recommended practice for WordPress and Discourse on the same server?
Running other websites on the same machine as Discourse
(Jonathan Wexler) #10

Would anyone recommend, instead, to keep Discourse and Wordpress separate, each installed on separate Droplets, for instance, in the case of using DigitalOcean?

Might it be easier to maintain, Wordpress and Discourse on these seperate servers, for performance, updates etc?

And would it affect the integration between Wordpress and Discourse? E.G. if they are on seperate servers firstly, can they be integrated, and, secondly, what might be the implications, possible problems, etc?


(Jean Baptiste W) #11

Me to I’m looking for drupal and mangento and discourse on same server.
A tutorial please ?


(ben_a_adams) #12

ensure to add

proxy_http_version 1.1;

to the config else you’ll loose source gzipping


(Steven Greco) #13

which directory does the discourse.conf file get put in? I can’t seem to find that in the guide.

edit:
I got discourse coming up correctly for my url www.example.com and apache default page for www.example.com:81. but wordpress will not come up. i get a discourse page not found error. i think i am missing something. Before i installed discourse wordpress came up on www.example.com/wordpress.


(Erlend Sogge Heggen) #14

This topic can (also also) be closed in favour of the canonical answer here:


(Régis Hanol) #15