Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The IM app requires NodeJS and Redis. In this article we will go over how to setup NodeJS and Redis on the Linux Flavor, Ubuntu. We recommend that you separate your NodeJS, Redis and HTTP server from each other. Your HTTP server is the main web server that has your phpFox source code.

Hosting Services

There are cloud based services where you can host your NodeJS code and Redis database without having to setup anything on a server.

Setup on Your Own Servers

If you decide to setup NodeJS and Redis on your own web environments, lets first setup NodeJS.

Node JS

Connect to your NodeJS server via SSH and run the command

Code Block
# sudo apt-get install nodejs
# sudo ln -s /usr/bin/nodejs /usr/bin/node
# sudo apt-get install npm

At this point your NodeJS is setup. FTP/SSH to the server and upload the folder /PF.Site/Apps/PHPfox_IM/server/ to a secure directory on your server that does not have HTTP access to it. You can find this folder in the phpFox ZIP package you get when you downloaded our product.

Via SSH navigate to the folder you just uploaded. You use the CD command to do this. Example:

Code Block
# cd /some/folder

Once you reached your NodeJS script you need to install all the libraries required to run the script.

Code Block
# npm install redis
# npm install request
# npm install socket.io

Next, rename the sample config file.

Code Block
# mv config.js.new config.js

Now that NodeJS is setup you can start the process

Code Block
# node index.js

Redis

Next, we need to install Redis.

Code Block
# sudo apt-get install redis-server

Enabling from AdminCP

With both NodeJS and Redis installed you can now visit your AdminCP and head over to the IM App: AdminCP > Apps > IM

For the setting Provide your Node JS server  enter: http://your-nodejs-server.com:3000

Make sure to change your-nodejs-server.com with the IP or Domain that leads to your NodeJS server.

Congratulations you have successfully setup the IM App.

Info
To use the IM, see this tutorial.

 

 

 

 

This tutorial requires advanced knowledge. We recommend you get professionals to do this if you are not at an advanced level.

Requires: phpFox version >= 4.5.2

In this tutorial, we are going to guide you on how to set up Chat server for Instant Messaging app.

The Instant Messaging app supports 2 options for Chat Server: NodeJS (with Redis) and Google Firebase. You can choose to use one of these options.

Google Firebase is the recommended option for scalability and high availability. However, you will need to pay for this Googe service.

Basing on the chosen chat server, please refer to the respective article for detailed instructions to setup Chat server:

Page Tree
rootServer Setup for IM Module

If you are using our native mobile apps, please also see How to support push notifications for new messages on phpFox Mobile apps