Created
November 28, 2011 23:20
-
-
Save hplc/1402572 to your computer and use it in GitHub Desktop.
iptables setting for apache httpd web sites
This file contains 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
#!/bin/sh | |
# Limit Apache user connect to updates.drupal.org,itself and LAN IPs only. | |
/sbin/iptables -A OUTPUT -p tcp -d 140.211.166.6 --dport 80 -m owner --uid-owner apache -j ACCEPT | |
/sbin/iptables -A OUTPUT -p tcp -d 140.211.166.21 --dport 80 -m owner --uid-owner apache -j ACCEPT | |
/sbin/iptables -A OUTPUT -p all -d 202.68.199.208 -m owner --uid-owner apache -j ACCEPT | |
/sbin/iptables -A OUTPUT -p all -d 192.168.168.0/24 -m owner --uid-owner apache -j ACCEPT | |
/sbin/iptables -A OUTPUT -p all -d 10.0.0.0/8 -m owner --uid-owner apache -j ACCEPT | |
/sbin/iptables -A OUTPUT -p all -d 127.0.0.1 -m owner --uid-owner apache -j ACCEPT | |
/sbin/iptables -A OUTPUT -p tcp --sport 8250 -m owner --uid-owner apache -j ACCEPT | |
/sbin/iptables -A OUTPUT -p udp -d 202.181.224.2 --dport 53 -m owner --uid-owner apache -j ACCEPT | |
/sbin/iptables -A OUTPUT -p tcp --dport 25 -m owner --uid-owner apache -j ACCEPT | |
/sbin/iptables -A OUTPUT -p udp -d 8.8.8.8 --dport 53 -m owner --uid-owner apache -j ACCEPT | |
/sbin/iptables -A OUTPUT -p all -m owner --uid-owner apache -j LOG | |
/sbin/iptables -A OUTPUT -p all -m owner --uid-owner apache -j REJECT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment