Created
February 18, 2012 03:56
-
-
Save shiftb/1857296 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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