Skip to content

Instantly share code, notes, and snippets.

@shiftb
Created February 18, 2012 03:56
Show Gist options
  • Save shiftb/1857296 to your computer and use it in GitHub Desktop.
Save shiftb/1857296 to your computer and use it in GitHub Desktop.
echo "ServerName [name]" | tee /etc/apache2/conf.d/fqdn
service apache2 restart
hostname -f
# Potentially: vi /etc/hostname
# Setup IPTABLES
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -p tcp --dport 22 -j ACCEPT
iptables -A INPUT -p tcp --dport 80 -j ACCEPT
iptables -A INPUT -p tcp --dport 443 -j ACCEPT
iptables -A INPUT -j DROP
iptables-save > /etc/iptables.rules
# Edit interfaces
vi /etc/network/interfaces
# Put this right after the first interface, before the other settings
# pre-up iptables-restore < /etc/iptables.rules
# Reboot the server
reboot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment