Rocket Chat multiple instances

How would I be able to run a second instance of Rocket Chat (Chat+) for a second site on same server? Would I need to create a second run.sh file with variables for second site, or do I need to completely setup another Rocket Chat server?

caredesign.net
Quote · 12 Feb 2016

Very easy. Just change these values:

 

export ROOT_URL=http://your-domain.com:3000/
export MONGO_URL=mongodb://localhost:27017/rocketchat
export PORT=3000

 

Before initializing the new instance for the first time.

 

Edit: To be clear, this requires a second copy under its own directory (like /opt/chat2).

BoonEx Certified Host: Zarconia.net - Fully Supported Shared and Dedicated for Dolphin
Quote · 12 Feb 2016

thanks bud - will try it when i get home.

caredesign.net
Quote · 12 Feb 2016

oh, another question. I am going to be working on a project that will be 3 or 4 separate sites. Would I do a second and third "Account" (in Chat+) for the other Dolphin sites? Would I need to make any changes to any code for the Chat+?

caredesign.net
Quote · 12 Feb 2016

 

oh, another question. I am going to be working on a project that will be 3 or 4 separate sites. Would I do a second and third "Account" (in Chat+) for the other Dolphin sites? Would I need to make any changes to any code for the Chat+?

For 3/4 sites, you'd create 3/4 instances of Chat+.

BoonEx Certified Host: Zarconia.net - Fully Supported Shared and Dedicated for Dolphin
Quote · 12 Feb 2016

sorry - let me clarify - for this particular project - all members of all 3 0r 4 sites will be on the same chat.

caredesign.net
Quote · 12 Feb 2016

 

sorry - let me clarify - for this particular project - all members of all 3 0r 4 sites will be on the same chat.

This might work, but I can see issues if users sign up with the same details on separate sites. One way to work around this would be to have all accounts made on one site, and then use Dolphin Connect to login and create accounts on all the other sites. Then users would login with the main account credentials for Chat+.

BoonEx Certified Host: Zarconia.net - Fully Supported Shared and Dedicated for Dolphin
Quote · 12 Feb 2016

sorry for the delay - had to drive home from work. OK, maybe I should give a bit more info. First off I am looking at 3 separate sites to start. All 3 sites are mental health related, but each site deals with different aspects regarding mental health. I want to have 1 "community" site where users from all 3 sites can chat in one place. At first thought - if you sign up on site A - you would not sign up on site B or C, and vice versa.

caredesign.net
Quote · 12 Feb 2016

 

sorry for the delay - had to drive home from work. OK, maybe I should give a bit more info. First off I am looking at 3 separate sites to start. All 3 sites are mental health related, but each site deals with different aspects regarding mental health. I want to have 1 "community" site where users from all 3 sites can chat in one place. At first thought - if you sign up on site A - you would not sign up on site B or C, and vice versa.

If the accounts are made on Site A and then used on Site B and Site C, then it shouldn't be a problem to have all three use the same Chat+ instance - since it's connected via Site A, where all the accounts are.

BoonEx Certified Host: Zarconia.net - Fully Supported Shared and Dedicated for Dolphin
Quote · 13 Feb 2016

OK, not sure if I am explaining myself well. But I do not want all users having memberships on multiple sites. I jsut want them to be able to log into 1 single chat even though they have accounts on different Dolphin sites.

 

After spending some time on this - I have gotten it to work. So, for anyone else wondering how to get multiple dolphin sites on one chat, this is what I Have:

 

Site 1 is set up as normal.

 

For site 2 and on, In the OAuth2 module -

Title = whatever you want

URL = url to chat

 

In the Chat+ Admin - Accounts section, Click Add Custom OAuth (all the way at the bottom on the right)

 

For your new OAuth

Enable = Yes

Url = url of site (site 2 and such)

Token path = /m/oauth2/token/

Identity Path = /m/oauth2/api/me/

Authorize path = /m/oauth2/auth/

Id = Client Key from Site 2 OAuth module

Secret = Client Secret from Site 2 OAuth module

The remaining fields you can label as you like.

 

After saving, go to Chat+ ADmin Settings - General section and click Restart Server (this does not actually restart the server, but will stop it.) Open up an SSH connection and navigate to where you placed the run.sh file for the Chat+ server and run ./run.sh - this will start the server and is dependent on the fact that you should have followed all of the original instructions to get Site 1 working properly.

 

To test - I have 2 sites: cvp71.com and caredesign.org. These sites are both on the same server, but in 2 different directories.

caredesign.net
Quote · 13 Feb 2016

 OK, so I tried this using port 3100 as well as 3000 and rocketchat2 in a completely folder /opt2 - not working for me. I did open firewall ports

Very easy. Just change these values:

 

export ROOT_URL=http://your-domain.com:3000/
export MONGO_URL=mongodb://localhost:27017/rocketchat
export PORT=3000

 

Before initializing the new instance for the first time.

 

Edit: To be clear, this requires a second copy under its own directory (like /opt/chat2).

 

caredesign.net
Quote · 14 Feb 2016

 

 OK, so I tried this using port 3100 as well as 3000 and rocketchat2 in a completely folder /opt2 - not working for me. I did open firewall ports

Did you also change the database name in the MONGO_URL line? 'rocketchat' needs to be renamed to something else.

BoonEx Certified Host: Zarconia.net - Fully Supported Shared and Dedicated for Dolphin
Quote · 14 Feb 2016

yes - called it rocketchat2

caredesign.net
Quote · 14 Feb 2016

#!/bin/sh
export ROOT_URL=http://98.174.201.87:3100/
export MONGO_URL=mongodb://localhost:27018/rocketchat2
export PORT=3100
export ADMIN_EMAIL=calvin.fowler74@gmail.com
export ADMIN_PASS=vache012

node main.js 2>&1 > chat_plus.log &

 

 

with this error:

Error: failed to connect to [localhost:27018]
    at Object.Future.wait (/opt2/bundle/programs/server/node_modules/fibers/future.js:398:15)
    at new MongoConnection (packages/mongo/mongo_driver.js:213:1)
    at new MongoInternals.RemoteCollectionDriver (packages/mongo/remote_collection_driver.js:4:1)
    at Object.<anonymous> (packages/mongo/remote_collection_driver.js:38:1)
    at Object.defaultRemoteCollectionDriver (packages/underscore/underscore.js:750:1)
    at new Mongo.Collection (packages/mongo/collection.js:102:1)
    at AccountsServer.AccountsCommon (accounts_common.js:23:18)
    at new AccountsServer (accounts_server.js:16:5)
    at Package (globals_server.js:5:12)
    at /opt2/bundle/programs/server/packages/accounts-base.js:1814:4
    - - - - -
    at [object Object].<anonymous> (/opt2/bundle/programs/server/npm/npm-mongo/node_modules/mongodb/lib/mongodb/connection/server.js:556:74)
    at [object Object].emit (events.js:106:17)
    at [object Object].<anonymous> (/opt2/bundle/programs/server/npm/npm-mongo/node_modules/mongodb/lib/mongodb/connection/connection_pool.js:156:15)
    at [object Object].emit (events.js:98:17)
    at Socket.<anonymous> (/opt2/bundle/programs/server/npm/npm-mongo/node_modules/mongodb/lib/mongodb/connection/connection.js:534:10)
    at Socket.emit (events.js:95:17)
    at net.js:441:14
    at process._tickCallback (node.js:448:13)

caredesign.net
Quote · 14 Feb 2016

ok, i have no clue what I did, but it is working now.

caredesign.net
Quote · 14 Feb 2016

After wiping and reinstalling CentOs 7 and RocketChat again, I have found out what my problem was. For some reason, I have to manually start the mongodb server - and start a new mongodb instance (specifying port) for each chat server I want to run. Currently have 3 running at once on the same server.

caredesign.net
Quote · 14 Feb 2016

 

After wiping and reinstalling CentOs 7 and RocketChat again, I have found out what my problem was. For some reason, I have to manually start the mongodb server - and start a new mongodb instance (specifying port) for each chat server I want to run. Currently have 3 running at once on the same server.

I've setup a few multiple instances of both Chat+ and RocketChat on servers, and I've never needed to run more than one instance of MongoDB. You should only need to specify a new database name (as well as the RocketChat port and URL). As for starting mongod, this is indeed needed after a new install, but you can use systemctl to enable it to run on boot.

BoonEx Certified Host: Zarconia.net - Fully Supported Shared and Dedicated for Dolphin
Quote · 14 Feb 2016

systemctl is not working for me for some reason when attempting to get mongodb to run at startup

caredesign.net
Quote · 14 Feb 2016

did another fresh install and same results - i get an error that cant connect to port for second instance - but it seems this is because mongodb is not running on specified port - thus i have to run a new mongodb instance specifying the new port.

caredesign.net
Quote · 14 Feb 2016
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.