将CloudFlare的ip段添加/导入到宝塔的防火墙白名单内
最近在使用cloudflare的时候将网站添加到cf的时候发现网站无法访问经过检查是防火墙将cf的ip拦截了,导致网站无法正常访问下面也是做个记录,还有同事让有想问问题的同学们能够快速解决这个问题。 Cloudflare全部IP列表 CF CDN 服务器所用的所有IP地址(由于宝塔目前只支持IPv4,所以规则里只有IPv4,共计1,786,880个IP地址)有需要给服务器添加白名单的,可以使用这里的记录。 Cloudflare IPv4 CIDR列表 173.245.48.0/20 103.21.244.0/22 103.22.200.0/22 103.31.4.0/22 141.101.64.0/18 108.162.192.0/18 190.93.240.0/20 188.114.96.0/20 197.234.240.0/22 198.41.128.0/17 162.158.0.0/15 104.16.0.0/12 172.64.0.0/13 131.0.72.0/22 Cloudflare IPv6 CIDR列表 2400:cb00::/32 2606:4700::/32 2803:f800::/32 2405:b500::/32 2405:8100::/32 2a06:98c0::/29 2c0f:f248::/32
Linux增加swap空间
如果你的服务器的总是报告内存不足,并且时常因为内存不足而引发服务被强制kill的话,在不增加物理内存的情况下,启用swap交换区作为虚拟内存是一个不错的选择。 虚拟内存一般设置为物理内存的2倍即可,多了也是浪费硬盘 运行:free -m,可查询物理内存大小和swap空间大小,swap空间通常应为物理内存两倍大。 增加swap空间步骤: 1、dd if=/dev/zero of=/home/swap bs=1024 count=5120000 这样就会创建/home/swap分区文件。文件的大小是512000个block,一般情况下1个block为1K,所以这里空间是5120M。 2、/sbin/mkswap /home/swap 把这个分区变成swap分区. 3、/sbin/swapon /home/swap 使其成为有效状态。 现在再用free -m命令查看一下内存和swap分区大小,就发现增加了5120M。
宝塔面板绑定域名使用cloudflare隐藏服务器IP
宝塔面板的访问一般是服务器ip:端口号这样访问,但是不排除你的IP被那啥了之后访问不了的情况。突然奇想,如果我们给宝塔面板设置一个域名,然后在把这个域名套入到cdn中,来实现域名访问。这样理论上来说只要cloudflare不挂,你的面板就可以一直访问到。而且,通过cdn访问也隐藏了服务器ip,原则上来说也是安全的。 一: 新建网站 在面板中新建一个网站,不需要任何php版本只需选择纯静态 二: 在宝塔面板绑定域名 三: cloudflare端口 By default, Cloudflare proxies traffic destined for the HTTP/HTTPS ports listed below. HTTP ports supported by Cloudflare: 四: 修改端口 我们需要把端口改为8080,宝塔面板修改端口,就是在面板设置中,不会的看图。 五:域名接入CDN 上面的都做好之后,我们现在可以把域名接入cloudflare中了。如图: 先把加速关闭灰色哈 六: 这一步很重要,在刚刚的新建的网站里面设置一个反D。 目标URL:http://127.0.0.1:8080 然后去cloudflare那边开启服务即可 效果图 这个功能的话还是比较使用我的作用是可以隐藏原服务器的ip也可以实现利用cloudflare拯救你的ip 原文来自大鸟博客
kangle web server,linux centos 6 一键安装脚本(小樱)
安装脚本: 以下安装教程带的为mysql官方5.6最新版同步更新。内存占用已经优化到70M左右。 yum -y install wget echo "timeout=120" >> /etc/yum.conf yum -y update yum -y install epel-release chkconfig nscd off;service nscd stop;yum -y install dnsmasq;sed -i 's/#listen-address.*/listen-address=127.0.0.1/g' /etc/dnsmasq.conf;echo -e 'nameserver 127.0.0.1\nnameserver 8.8.8.8\nnameserver 2001:4860:4860::8888\nnameserver 2606:4700:4700::1111\nnameserver 1.1.1.1\nnameserver 114.114.114.114\nnameserver 119.29.29.29\noptions timeout:1 attempts:1 rotate' > /etc/resolv.conf;chkconfig dnsmasq on;service dnsmasq start rm -rf /etc/yum.repos.d/CentOS-Base.repo wget http://github.itzmx.com/1265578519/mirrors/master/CentOS/CentOS6-Base-itzmx.repo -O /etc/yum.repos.d/CentOS6-Base-itzmx.repo rm -rf /etc/yum.repos.d/*pel.repo /etc/yum.repos.d/epel-testing.repo wget http://github.itzmx.com/1265578519/mirrors/master/EPEL/epel.repo -O /etc/yum.repos.d/epel.repo rpm -ivh http://github.itzmx.com/1265578519/repo/master/CentOS/mysql-community-release-el6-5.noarch.rpm rm -rf /etc/yum.repos.d/mysql-community.repo /etc/yum.repos.d/mysql-community-source.repo wget http://github.itzmx.com/1265578519/repo/master/CentOS/mysql-community.repo -O /etc/yum.repos.d/mysql-community.repo yum clean all;yum makecache yum -y install which file wget make automake gcc gcc-c++ pcre-devel zlib-devel openssl-devel sqlite-devel quota unzip bzip2 libaio-devel ulimit -n 1048576 echo "* soft nofile 1048576" >> /etc/security/limits.conf echo "* hard nofile 1048576" >> /etc/security/limits.conf wget http://github.itzmx.com/1265578519/kangle/master/ent/e.sh -O e.sh;sh e.sh /vhs/kangle wget http://github.itzmx.com/1265578519/kangle/master/kangle/easypanel/ep.sh -O ep.sh;sh ep.sh yum -y install memcached php-pecl-memcache yum -y install php-pecl-apc rm -rf /etc/sysconfig/memcached wget http://github.itzmx.com/1265578519/kangle/master/memcached/memcached -O /etc/sysconfig/memcached service memcached start chkconfig --level 2345 memcached on echo "127.0.0.1 download.safedog.cn" >> […]
VPS服务器常用测试脚本集合
Bench.sh 秋水逸冰大佬的写的Bench.sh脚本 特点 显示当前测试的各种系统信息; 取自世界多处的知名数据中心的测试点,下载测试比较全面; 支持 IPv6 下载测速; IO 测试三次,并显示平均值。 项目地址 使用 wget -qO- bench.sh | bash #或者 curl -Lso- bench.sh | bash #或者 wget -qO- 86.re/bench.sh | bash #或者 curl -so- 86.re/bench.sh | bash SuperBench.sh 老鬼大佬的SuperBench测试脚本 特点 改进了显示的模式,基本参数添加了颜色,方面区分与查找。 I/O测试,更改了原来默认的测试的内容,采用小文件,中等文件,大文件,分别测试IO性能,然后取平均值。 速度测试替换成了 Superspeed 里面的测试,第一个默认节点是,Speedtest 默认,其他分别测试到中国电信,联通,移动,各三个不同地区的速度。 项目地址 使用 wget -qO- --no-check-certificate https://raw.githubusercontent.com/oooldking/script/master/superbench.sh | bash #或者 curl -Lso- -no-check-certificate https://raw.githubusercontent.com/oooldking/script/master/superb Zbench.sh 漏水和kirito大佬的测试脚本 特点 基于SuperBench二次修改 增加Ping以及路由测试功能 可以生成测评报告,可以很方便地分享给其他朋友看自己的测评数据。 项目地址 使用: #中文版 wget -N --no-check-certificate https://raw.githubusercontent.com/FunctionClub/ZBench/master/ZBench-CN.sh && bash ZBench-CN.sh #英文版 wget -N --no-check-certificate https://raw.githubusercontent.com/FunctionClub/ZBench/master/ZBench.sh && bash ZBench.sh LemonBench.sh LemonBench工具(别名LBench、柠檬Bench),是一款针对Linux服务器设计的服务器性能测试工具。通过综合测试,可以快速评估服务器的综合性能,为使用者提供服务器硬件配置信息。 特点 服务器基础信息(CPU信息/内存信息/Swap信息/磁盘空间信息等) Speedtest网速测试 (本地到最近源及国内各地域不同线路的网速) 磁盘测试(4K块/1M块 直接写入测试) 路由追踪测试(追踪到国内和海外不同线路的路由信息) Spoofer测试(获取详细网络信息,快速判断服务器接入线路) 项目地址 使用 curl -fsSL https://ilemonrain.com/download/shell/LemonBench.sh | bash #或者 wget -qO- https://ilemonrain.com/download/shell/LemonBench.sh | bash