I'm trying to set up my system such that when it reboots (intentionally or not) my webserver starts running again without my intervention. I'm running my Guruplug Standard as an ethernet client. As things are set up currently when I reboot port 80 (on which Apache is set up to listen) is not open to connections.
chris@plug:~$ sudo iptables -L
[sudo] password for chris:
Chain INPUT (policy ACCEPT)
target prot opt source destination
fail2ban-ssh tcp -- anywhere anywhere multiport dports ssh
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Chain fail2ban-ssh (1 references)
target prot opt source destination
RETURN all -- anywhere anywhere
So I have to run
sudo iptables -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
and then restart Apache before I can start serving pages.
I would have thought that all I need to do to make sure that port 80 is opened on a reboot is to edit /root/init_setup.sh so it contains the line
iptables -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
but this doesn't work. I've tried also
iptables -A INPUT -i eth0 -p tcp -m tcp --dport 80 -j ACCEPT
Any suggestions for how I can make sure port 80 stays open on reboot? Thanks.