[Solved] Running two or more instances of NodeBB



  • I'm wanting to run -- on occasion -- two simultaneous instances of NodeBB.

    Here's why:

    This is my git workflow, and if anyone has any suggestions on how to do it better I'd appreciate hearing about it:

    1. I have a local clone of NodeBB
    2. I create feature branches to do modifications and push back to my master.
    3. I push my local master to my server's testing instance: /var/www/site.test
    4. Once I am confident things won't break I push to production: /var/www/site.prod

    However, by doing this I have to sometimes run both site.test and site.prod at the same time. Site.prod would be running all the time because that's the production site while site.test would run temporarily while I test things out.

    I have two mongo databases set up: siteTest & siteProd. One for testing and one for production.

    Let's say I have production running on port 80 and test running on 4567. When I have both running I can't stay logged in to either of them. Once I log in to my instance on port 80 it kicks me off my instance on port 4567 and vice versa.

    I'm not actually sure if this is a bug or not, but I thought I'd throw it up in here just in case.

    Any help on troubleshooting this, or suggestions of a better way to go about doing things would be much appreciated.

    What I want to do is be able to test directly on my production server on a testing instance before actually pushing changes to the production site. So, if for instance, a NodeBB update gets pushed that has breaking changes, I can know about it in testing before pushing the updates to production.

    Thanks!


  • GNU/Linux Admin

    You can't maintain a login on both your dev and production because cookies themselves don't take port numbers into account, so the cookies for both sites are "http://yoursite.com".

    Try using a subdomain for your testing environment, that shoul clear it up.



  • Ok, great. Thanks for the quick response. I'll post my results after...



  • I'll have to wait for my dns records to update to test it out unless you know of a quicker way @julian ?

    I added a test.site.com mx and just pass it through nginx to port 4567. Is this along the lines of what you're suggesting?


  • GNU/Linux Admin

    It'd be an A record, since MX is for mail, but yeah, that's more or less it.



  • Ya...just kidding...wasn't thinking and just cloned my mx record for the mail server.



  • Ok, I can confirm this works. Thanks @julian.



Suggested Topics

  • 2
  • 6
  • 1
  • 5
  • 2
| |