ChatPlus Installation Instructions (Ubuntu with Apache)

Alex Trofimov edited this page Oct 25, 2016 · 6 revisions

These are instructions for Ubuntu, we'll post tutorials for other systems later.

Run the following commands under privileged user:

NOTE: Servers running Plesk on Ubuntu should first add the NodeJS repo (https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions), and then install NodeJS from there. NPM is included with the package. Installing NPM from the default Ubuntu repos can sometimes cause package conflicts with Plesk packages. You should never proceed with the removal of Plesk packages.

# system config
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list
sudo apt-get update
sudo apt-get install npm mongodb-org curl graphicsmagick

# Install a tool to let us change the node version.
sudo npm install -g n

# Meteor needs exactly this version of node to work.
sudo n 4.5 # use 0.10.40 for older versions < 0.40.0

Next commands can be run as regular user.

Download the following package:

http://ci.boonex.com/chat/latest.php

Unpack it and run the following commands:

cd bundle/programs/server
npm install

cd ../..

export ROOT_URL=http://your-domain.com:3000/
export MONGO_URL=mongodb://localhost:27017/rocketchat
export PORT=3000
export ADMIN_EMAIL=admin@example.com
export ADMIN_PASS=admin_password

node main.js

ROOT_URL must be in the root of the domain, custom port - 3000 is required to not interfere with your current webserver.

To run as daemon, modify the last string to the following:

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

There are prepared scripts with above commands, so you can rename & modify them with your particular values: example-init.sh, example-start.sh and example-stop.sh.

You can already open http://your-domain.com:3000/ URL in the browser and see it working.

But the problem is that custom port isn't looking nice and it lacks of https (without https audio and video isn't working in Chrome).

To fix above issues it's better to leverage these tasks to Apache webserver.

You need separate sub-domain for the chat since it's working in the root of the domain only.

Also you need to have the following Apache module enabled: proxy, proxy_http, proxy_connect

I would suggest the following VirtualHost configuration, but actual config maybe different:

<VirtualHost *:80>
        ServerAdmin admin@example.com
        ServerName subdomain.your-domain.com
        ServerAlias www.subdomain.your-domain.com
        <Location />
                Order allow,deny
                Allow from all
                ProxyPass http://localhost:3000/
                ProxyPassReverse http://localhost:3000/
        </Location>
</VirtualHost>

After adding this virtual host you can try to restart apache and see how it goes, make sure that you've added subdomain.

This subdomain still have no HTTPS, you can buy certificate and install it for the subdomain, or use free certificate according to these instructions which can be added automatically. For example after running letsencrypt-auto script the following virtual host is added:

<VirtualHost *:443>
        ServerAdmin admin@example.com
        ServerName subdomain.your-domain.com
        ServerAlias www.subdomain.your-domain.com
        <Location />
                Order allow,deny
                Allow from all
                ProxyPass http://localhost:3000/
                ProxyPassReverse http://localhost:3000/
        </Location>
        SSLCertificateFile /etc/letsencrypt/live/subdomain.your-domain.com/cert.pem
        SSLCertificateKeyFile /etc/letsencrypt/live/subdomain.your-domain.com/privkey.pem
        Include /etc/letsencrypt/options-ssl-apache.conf
        SSLCertificateChainFile /etc/letsencrypt/live/subdomain.your-domain.com/chain.pem
</VirtualHost>

Also redirect to old virtual host is added automatically too:

RewriteEngine on
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,QSA,R=permanent]

To configure the chat to make it work with Dolphin, follow instructions in Dolphin Chat+ module administration area.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.