To run server.js, the socket.io file
- Install nodejs globally.
- install npm globally
- go to your project folder and install npm modules
- npm install connect
- npm install socket.io
- Make sure the port your're using is open in the iptables, if not follow these steps
- sudo nano /etc/iptables.firewall.rules
Add a new port as: -A INPUT -p tcp --dport 3000 -j ACCEPT i.e. if you're running socket.io on port 3000
- Activate the firewall rules by entering the following command:
sudo iptables-restore < /etc/iptables.firewall.rules
- Now run the script with preferably forever