I'm configuring a new EC2 instance, which will be running Tomcat, and I want it accessible on Port 80.
Within Amazon Linux 1, the primary strategy I saw people using was to use iptables to do port forwarding. It's not my ideal strategy, but it has worked fine.
Setting up a new EC2 instances with Amazon Linux 2, it quickly became apparent that Amazon Linux 2 uses systemd. As a result, you definitely can't do service iptables save:
The service command supports only basic LSB actions (start, stop, restart, try-restart, reload, force-reload, status). For other actions, please try to use systemctl.
Sure. So is there an iptables service like there seems to be in some distros? systemctl status iptables suggests no:
Unit iptables.service could not be found.
Is there a mechanism in Amazon Linux to to load iptables configuration from a file? I don't mind putting my configuration in a file, or doing an iptables-save to a file, but I haven't found any sign in Amazon Linux 2 that there's a mechanism already in place to use a file. If there isn't one, what's the best strategy -- make my own iptables unit in systemd? Or is there a better way to make Tomcat accessible on Port 80 with Amazon Linux 2?
firewalldis installed by default -- I could certainly install it, does seem to be in the yum repo.iptablesseems to be there by default, although perhaps not configured to do anything. I've usedfirewalldon Fedora, so I can live with that, I know how to use it to port-forward to Tomcat as well.Mostly, just looking for the right way to hook up Tomcat to the default HTTP port with a minimum of installation and configuration and in the most idiomatic way. You're recommending
– Geoffrey Wiseman Sep 26 '18 at 12:56firewalldis the best path?