1

I have a Meteor app that I want to add Wordpress blogging platform to.

There doesn't need to be any integration, just:

http://example.com/blog/

Anything behind blog/ belongs to WP.

How would I go about doing this? Thanks in advance.

1
3

This question is probably beyond the scope of WPSE. But my solution would be to install PHP-FPM and run Node and PHP-FPM on different ports behind Nginx.

Sample Nginx Config (will require tweaking)

location / {
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
    proxy_set_header X-NginX-Proxy true;

    proxy_pass http://localhost:3000; // Assuming Node is running on port 3000
    proxy_redirect off;
}

location /blog {
    rewrite /blog/?(.*) /$1 break;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
    proxy_set_header X-NginX-Proxy true;

    proxy_pass http://localhost:9000; // Assuming PHP-FPM is running on port 9000
    proxy_redirect off;
}
2
  • What should WP_HOME and WP_SITEURL be set to? It can be quite confusing to figure that out. Jun 17 '15 at 9:49
  • They should probably both be the same, unless you want serve up your blog at /blog, but want to keep the WordPress core files elsewhere (e.g /blog/wp ) Jun 17 '15 at 23:57
1

If you're trying to figure out how to get WordPress and MeteorJS to play nice, you should check out ButterCMS. ButterCMS integrates into your existing Meteor app so you don't have to setup and maintain a separate system or setup a reverse proxy to get your blog in a subdirectory.

I wrote a blog post on how to build a CMS-powered blog with Meteor and ButterCMS. Whether you want to add a blog to an existing app or are starting from scratch, you’ll get a production-ready blog with a CMS similar to WordPress. In your Meteor app you can use whatever view layer you like (React, Blaze, etc).

ButterCMS is a paid service but it's free for personal websites/blogs.

0

This is going to be quite difficult since Meteor JS is running on Node.js and MongoDB. WordPress requires PHP, MySQL, and a webserver (Apache, NGINX, squid, etc.). This setup will require you to run 2 webservers on your single server (I doubt this will work on shared hosting! You'll need a VPS). It also will be easier to use blog.example.com than a different directory.

You'll need 2 different IP's. One for Meteor (111.111.111.111), and one for Apache (222.222.222.222).

In your domain's DNS settings, point blog.example.com to (222.222.222.222). I'm going to assume 111.111.111.111 is already setup for example.com.

Install LAMP Stack (Simple tutorial: https://www.digitalocean.com/community/articles/how-to-install-linux-apache-mysql-php-lamp-stack-on-debian)

Set Node to: server.listen(80, '111.111.111.111');

Set Apache to: Listen 222.222.222.222:80

Install WP, and you should be good to go!

Source: https://gist.github.com/stagas/754303

1
  • It's actually simpler than this. You don't need two IPs. Also, I recommend using nginx instead of Apache (much faster and simpler). Jun 13 '15 at 3:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.