How to deploy a WordPress site and Django site on

2019-03-28 02:54发布

问题:

I'm a complete newbie when it comes to sysadmin/deployment. Here's what I'm hoping to accomplish:

  1. Have domain.com be a normal WordPress site.
  2. Have either domain.com/app or app.domain.com be a Django webapp.
  3. Hosting on Linode.
  4. Quick and easy updates of the Django webapp code.

From what I can tell, gunicorn is an elegant way to serve the Django webapp, while WordPress fits most naturally with Apache. Meanwhile, nginx is recommended as a proxy in front of gunicorn and also seems to be used to improve performance of WordPress sites.

So what I'm thinking is: use nginx as a proxy server that routes all incoming web requests to either gunicorn (for the Django wepapp) or Apache (for the WordPress site). The Linode host would be running nginx, gunicorn, and Apache simultaneously.

Meanwhile, for updates of the Django webapp, I can simply update to the latest version of the code via github.

Does all that make sense? Am I even understanding things conceptually correctly? Or barking up the wrong tree entirely? (For instance can/should I just use a single Apache server to route requests to either WordPress or the Django app based on URL?) What gotchas and issues should I keep in mind as I research how to get this running nice and smoothly?

UPDATE: I've side-stepped all of this by (1) using Heroku to host my Django app, (2) using a CNAME record to map app.domain.com to the Heroku-hosted Django app, and (3) leaving (for now) the WordPress site on its existing host at domain.com. Thankfully, after gaining great new respect for what sysadmins and db admins do as I investigated all this, now I can get back to coding!

回答1:

@Ghopper21

+1 for your question first.

Now, This is really interesting to know how it's possible in real time execution. I checked with some of my geek friends and I found tremendous response, here are some of suggestion with reference I got after brainstorming with them.

First of all check this link for deploying & running WP altogether with Django on Nginx +uWSGI...

These two threads of support forums from Webfaction.com gives you more idea about how they are recommending it to their client...

Deploying Django and Wordpress in same domain

wordpress + django on same account - advisable or not?

Hey, I got one support ref. of Stack Overflow itself, which is explaining how to achieve it on APACHE server...

How do I run Django and PHP together on one Apache server?

And last but not least, the one where a geek like us integrated WP with Django... Integrate WordPress and Django