Looking for new opportunities
I am always looking for a new opportunities to expand my knowledge and help others while doing so, there for if you are looking for someone to join your team or you have something you want some help with feel free to reach out via email.
One of the things that I hate about nodejs is that I will have to run it as root if I want to use the port 80, but
yesterday while I was reviewing a book called
Mastering Web Application Development with [Express](https://www.packtpub.com/web-development/mastering-web-application-development-express)
and one of the solutions which he talked about so that you dont need to use the root user is to redirect the ports
iptable , so this is what you have to do :
sudo iptables -A INPUT -i eth0 -p tcp --dport 80 -j ACCEPT sudo iptables -A INPUT -i eth0 -p tcp --dport 8080 -j ACCEPT sudo iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080
remember to change eth0 to the one you are connecting to, in my vagrant it was eth1
And since iptable does not save anything as permanent, you have to do small work (read more about it here)
Install the service sudo apt-get install -y iptables-persistent Start the service sudo service iptables-persistent start Save the rules sudo iptables-save | sudo tee /etc/iptables/rules.v4 Restart the service sudo service iptables-persistent restart
And we are done, no need to use the root account any more ;)
PS: This article will work with ubuntu 16.04 , because service does not work with ubuntu 16.04 as I know, but not 100% sure.