While working on project, I had to bind my Tomcat to port 80 (instead of deploying an Apache and configuring its mod_jk). But, as you should know, Unix systems contains default security rules. Ports below 1024 are only allowed to the root user. Humm... it was time to work with iptables!
The following commands would show you how to add a rule to redirect request on port 80 to port 8080 and how to remove this rule.
Adding a rule :
sudo iptables -t nat -I OUTPUT --src 0/0 --dst [YOUR_IP_HERE] -p tcp --dport 80 -j REDIRECT --to-ports 8080
Saving it :
Listing rules :
sudo iptables -t nat --line-numbers -n -L
This will show rules ordered by REDIRECT, PREROUTING, POSTROUTING and
OUTPUT. Each line start wil a number.
Deleting a rule :
sudo iptables -t nat -D [REDIRECT, PREROUTING, POSTROUTING or OUTPUT] number
Ex : sudo iptables -t nat -D OUTPUT 1
Here is the best article I read on how to secure REST API and even make a full stateless architecture by using JWT token to store all user d...
I've just received my first arduino platform. It's a DCcduino board (a clone of Arduino Uno). As I had some difficulties to hav...
I'm an old user and addict of JRebel. I started to use it on open source projects and in professional contexts. From the beginning, I...
This is the challenge I had to perform. I have to open services to business partners and I want to secure them. I use a Java based applicati...