标签:and lin The roc cookie mys icmp done str
echo "ulimit -n 204800" >> /etc/profile# 检查ping,开启
PING=$(cat cat /proc/sys/net/ipv4/icmp_echo_ignore_all)
if [ $PING -ne 0 ]; then
echo 0 > /proc/sys/net/ipv4/icmp_echo_ignore_all
sysctl -p
fi
# 杀掉已连接sshd
if netstat -antp | grep sshd | grep -wq ESTABLISHED ; then
pid=$(netstat -antp | grep sshd | grep -w ESTABLISHED | awk ‘{print $7}‘ | cut -d‘/‘ -f1)
for i in $pid ; do
kill -9 $i
done
fi
# tcp重用和快速回收
echo "net.ipv4.tcp_syncookies = 1" >> /etc/sysctl.conf
echo "net.ipv4.tcp_tw_reuse = 1" >> /etc/sysctl.conf
echo "net.ipv4.tcp_tw_recycle = 1" >> /etc/sysctl.conf
sysctl -p
ip=$(ifconfig | grep -w inet | grep -v 127 | awk ‘{print $2}‘)
# httpd配置
cat << EOF >> /etc/httpd/conf/httpd.conf
ExtendedStatus On
<Location /server-status>
SetHandler server-status
Order deny,Allow
Deny from all
Allow from 127.0.0.1
</Location>
EOF
# mariadb配置
sed -i ‘/^[mysqld]$/a\bind-address=192.168.26.60‘ /etc/my.cnf
标签:and lin The roc cookie mys icmp done str
原文地址:https://blog.51cto.com/14075442/2449351