running two stack with one domain.

Posted November 24, 2015 2.9k views
WordPressDjangoPython Frameworks

I have one domain name.

  • i like to have my blog running using wordpress. that means php + mysql + apache ( mydomain\blog)
    • i like to show a demo app that is build with django. that mean python + postgresql + apache/ngnix ( mydoamin\demo)

I hope this is possible. if yes, can you please point to me right tutorial.
what is recommended droplet size ?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

That is more than possible. But putting all that on one droplet can get messy. I recommend you break it up into web and DB. But you can put it on one droplet, that is totally up to you. For a web server to pass a request to a different backend based on the URI, you can utilize Nginx’s location blocks. These let you define rules based on the URI. You can take a look at this tutorial for more information.

As for droplet size and such, that all depends. How efficient is whatever you’re running (If you are running two different DB backends, you already need quite a bit of ram unless you really tune that), how many requests/traffic do you expect it to hold up to, and how redundant do you want it to be? There are a lot of determining factors so that question cannot go answered without more information of your setup and such.

by Justin Ellingwood
Nginx is one of the most popular web servers in the world. In this guide, we will discuss how Nginx selects the server and location block that will handle a given client's request. We will go over the algorithm in place, as well as the directives and options you can use to modify the selection process.
  • Thanks for the answer, I like the idea of DB running on separate droplet.

    After reading your answer, i understand that running two database in backend need more RAM.

    1. How about installing wordpress with postgreSql.. then i dont have two DB running in backend.
    2. instead of apache, using nginx web server for both.
      a) wordpress Blog –> php + postgresql + nginx b) demo app –> python + postgresql + nginx

    Traffic-> my app and my blog have very niche topic.. so don’t expect a lot of traffic.

    any comments?

  • @san22 I am not sure WordPress supports PostgeSQL out of the box. Currently, I use MariaDB for my WordPress blog.

    Depending on resource usage (IE how many plugins you have on WordPress, rate of queries hitting the DB, intensity of Django, you should be good with 1GB-2GB for the both of them on a single droplet (Not including DBs). For the DBs, it all depends if you go PostgreSQL + MariaDB or what.