set limits for services in systemd
mkdir -p /etc/systemd/system/tftp.service.d/ cat >/etc/systemd/system/tftp.service.d/filelimit.conf [Service] LimitNOFILE=500000 systemctl daemon-reload systemctl restart tftp.service
mkdir -p /etc/systemd/system/tftp.service.d/ cat >/etc/systemd/system/tftp.service.d/filelimit.conf [Service] LimitNOFILE=500000 systemctl daemon-reload systemctl restart tftp.service
change Listen directives to: Listen [::]:80 Listen [::]:443 while your NameVirtualHost *:80 remain the same.
modify /etc/sysctl.conf. append net.ipv6.conf.all.disable_ipv6=1 net.ipv6.conf.default.disable_ipv6=1 net.ipv6.conf.lo.disable_ipv6=1 sudo sysctl -p
Debian7和8 的可用源,解决apt-get update的404错误 Debian 官方源失效了(太老放入存档了),导致更新和安装软件失败. Debian7一键解决方法: cp -r /etc/apt/sources.list /etc/apt/sources.list.bak;echo “deb http://archive.debian.org/debian/ wheezy main contrib non-free” > /etc/apt/sources.list;cat /etc/apt/sources.list;apt-get update; 复制代码 其实就是把源修改为: http://archive.debian.org/debian/ 发现的几个其他可用源,如果http://archive.debian.org/debian/太慢可以自己换换 # 阿里云的,目前可用,但可能是没同步好,过几天就和官方的同步了,就不行了. http://mirrors.aliyun.com/debian/ # debian官方的存档 https://snapshot.debian.org/archive/debian/20190321T212815Z/ # 这里可以找到不少(其实只要点进去看看dists目录里有没有wheezy就知道了) https://www.debian.org/distrib/archive 一键方案不明白的话,这是阿里云给的详细帮助,阿里云如果失效的话自己替换相关源的网址即可. debian…
一、检测 BBR 是否开启: root@itkylin.com:~# sysctl net.ipv4.tcp_available_congestion_control 若返回的是如下值说明你的系统没有开启BBR: net.ipv4.tcp_available_congestion_control = cubic reno 执行以下命令查看当前系统使用的控制算法: root@itkylin.com:~# sysctl net.ipv4.tcp_congestion_control 返回的结果是: net.ipv4.tcp_congestion_control = cubic 说明你的系统默认使用的是cubic算法。 二、为Ubuntu 16.04安装4.10 + (截止20181129日,目前内核是4.15.xx)新内核 和之前的ubuntu 14.04下安装4.10内核不同,在ubuntu 16.04系统下不需要自己下载源代码编译,只需执行一条安装命令即可: root@itkylin.com:~# apt-get install linux-generic-hwe-16.04 只要这样,就 OK 了…是不是超简单?因为HWE,即:HareWare Enablement,是专门为在老的系统上支持新的硬件而推出的内核。你可以像安装其他软件包一样在…
如果运行一段时间后,你发现服务器无法连接,同时ssh连上去后,执行 netstat -ltnap | grep -c CLOSE_WAIT 显示的数值很大(超过50是严重不正常),那么一定是系统的[最大连接数]限制得太低了,提供的服务达到了系统的最大文件数。 如果是ubuntu/centos均可修改/etc/sysctl.conf 找到fs.file-max这一行,修改其值为1024000,并保存退出。然后执行sysctl -p使其生效 打开文件/etc/security/limits.conf 添加两行: * soft nofile 512000 * hard nofile 1024000 针对centos,还需要于/etc/pam.d/login文件检查有没有session required pam_limits.so,没有就加上 保存后,重启操作系统生效。 针对ubuntu系统,你还需要额外的在运行前使用ulimit命令ulimit -n 51200设置最大文件数,可使用附带的运行脚本。 如果还是出现大量的too many open files错误,可以通过执行以下命令确定占用大量文件数的进程: lsof -n |awk…
1.添加流量统计器 vim /etc/raddb/modules/monthlytrafficcounter 加入以下代码 sqlcounter monthlytrafficcounter { counter-name = Monthly-Traffic check-name = Max-Monthly-Traffic reply-name = Monthly-Traffic-Limit sqlmod-inst = sql key = User-Name reset = monthly query = “SELECT ifnull(SUM(AcctInputOctets + AcctOutputOctets),0) div 1048576 \ FROM…
关闭 FireWall 1 2 systemctl stop firewalld.service #停止firewall systemctl disable firewalld.service #禁止firewall开机启动 安装 iptables 1 yum install iptables–services 配置 iptables 1 vim /etc/sysconfig/iptables 配置文件参考: 1 2 3 4 5 6 7 8 9 10 11…
killall can be found in the psmisc package so simply install using sudo apt-get install psmisc
bash: netstat: command not found This simply means that the relevant package net-tools which includes netstat executable is not installed, thus missing. The package net-tools may not be installed on your system by default so you need to install…