Skip to content

Latest commit

 

History

History
48 lines (26 loc) · 1.19 KB

README.md

File metadata and controls

48 lines (26 loc) · 1.19 KB

KiboCDN

This repository is hosting the code for the CDN of CloudKibo. This CDN is used to serve static files to all of the CloudKibo products such as KiboChat, KiboEngage and KiboCommerce.

Initial Code

https://adrianmejia.com/blog/2016/08/24/building-a-node-js-static-file-server-files-over-http-using-es6/

Operations Guide

Setup Nodejs and NPM

You should have Nodejs and NPM installed on your system.

Install Forever

To install forever run the following command:

npm install forever -g

Install Git

sudo apt-get update
sudo apt-get install git

Clone

Now, clone the project:

git clone https://github.com/Cloudkibo/KiboCDN/

Redirect the ports to our application ports

Run following two commands

iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 9000
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 443 -j REDIRECT --to-port 8443

Now on terminal, set the environment variables in /etc/environment.

nano /etc/environment

We need to set the following variables: (Just copy paste and then change the values)

NODE_ENV=production

Now, run the following command to install dependencies:

npm install