Forward Incoming port 80 to 8080

Forward Incoming port 80 to 8080:-

We can set port forwarding by using iptables. Means we can set the rules in iptables.

If iptables rpm is not installed in server, so please insatll it.
[root@localhost ~]# yum install iptables

Start iptables service.
[root@localhost ~]# service iptables start

Make sure iptables starts up by default after a server restart
[root@locahost ~]# chkconfig iptables on

Then set the iptables rule.
[root@localhost ~]# iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 8080

Save this rule.
[root@localhost ~]# service iptables save


You can test it from server IP Address. Open the browser and type the server IP Address.

http://server_ip_address/

Thats it...