How to configure direct http access to EC2 instance?

后端 未结 6 2047
面向向阳花
面向向阳花 2020-12-25 13:12

This is a very basic Amazon EC2 question, but I\'m stumped so here goes.

I want to launch an Amazon EC2 instance and allow access to HTTP on ports 80 and 8888 from a

6条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-25 14:00

    Amazon support answered it and it worked instantly:

    I replicated the issue on my end on a test Ubuntu instance and was able to solve it. The issue was that in order to run Tomcat on a port below 1024 in Ubuntu/Unix, the service needs root privileges which is generally not recommended as running a process on port 80 with root privileges is an unnecessary security risk.

    What we recommend is to use a port redirection via iptables :-

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

    I hope the above information helps.

提交回复
热议问题