linux常用命令
echo "ulimit -n 204800" >> /etc/profile
source /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
- LINUX常用的日志分析命令
- Linux常用命令(一)
- linux下的常用压缩解压缩命令
- linux常用命令之cat使用方法
- Linux常用命令(二)
- Linux常用命令(七)磁盘和文件系统管理
- 小女生的Linux技术~~~Linux/Unix系统中最常用的网络命令
- linux下开发php常用命令及必备tips
- Linux 常用命令
- linux 常用命令案例
- 嵌入式学习2(Linux常用shell命令上)
- linux常用命令记录
- linux常用命令
- Linux常用命令集锦
- linux常用基本命令之五wget
- linux中常用的一些命令
- Linux常用命令
- Linux Xshell Putty中常用的命令(积累,更新中)
- linux常用命令详解
- Linux中常用操作命令