Following are the steps to install Visionhelpdesk’s Livechat on Linux server:
Install nodejs [version 12.x]
Install npm [vesion 6.x]
Install pm2 [version 3.5.x]
curl -sL https://rpm.nodesource.com/setup_12.x | bash - yum -y install nodejs yum install gcc-c++ make npm install pm2@latest -g
Copy server.js, router.js and package.json on root or /
Go to the path where package.json is copied
Execute the command
npm install
If you have cPanel hosting along with a lightspeed webserver, you will need to add rewrite rules under the path as given below:
#cd /etc/apache2/conf.d/userdata #vi chat.conf Add the below code into the chat.config file: <IfModule litespeed> RewriteRule /support/chat/(.*) http://127.0.0.1:3000/$1 [P] #<Location /support/chat > #ProxyPass http://127.0.0.1:3000 #ProxyPassReverse http://127.0.0.1:3000 #</Location> </IfModule>
#pm2 start server.js
Note: If port 3000 is already in use then need to create .env file at the same location where server.js is stored and put the port as below in that file:
PORT=3001 virtualDirPath=''
Also, make the changes in reverse proxy accordingly.
10. Save the changes and restart the Lightspeed service