阿里云轻云服务器做网站CDN节点

老邢博客 行者杂谈评论338阅读模式

最近有个哥们要小型服务器做网站cdn的节点教程,我这里记录一下,然后分享一下。有需要的朋友可以自行搞定。

如果你是国内的用户的话,建医用阿里云轻云服务器香港节点或者是阿里云国际节点,就是买个香港轻音服务器,或者是阿里云国际的香港服务器,因为他们都是30MB/S的带宽。节点服务器暂时是不需要服务器性能有多强悍,只需要后端的服务器的性能好一些。

买服务器那个步骤我就不推荐了,下面直接来到配置CDN的节点教程

如果你是centos6.9的话,建议用小樱的kangle,

[code]

  1. yum -y install wget
  2. echo "timeout=120" >> /etc/yum.conf
  3. yum -y update
  4. yum -y install epel-release
  5. 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
  6. rm -rf /etc/yum.repos.d/CentOS-Base.repo
  7. wget http://github.itzmx.com/1265578519/mirrors/master/CentOS/CentOS6-Base-itzmx.repo -O /etc/yum.repos.d/CentOS6-Base-itzmx.repo
  8. rm -rf /etc/yum.repos.d/*pel.repo /etc/yum.repos.d/epel-testing.repo
  9. wget http://github.itzmx.com/1265578519/mirrors/master/EPEL/epel.repo -O /etc/yum.repos.d/epel.repo
  10. rpm -ivh http://github.itzmx.com/1265578519/repo/master/CentOS/mysql-community-release-el6-5.noarch.rpm
  11. rm -rf /etc/yum.repos.d/mysql-community.repo /etc/yum.repos.d/mysql-community-source.repo
  12. wget http://github.itzmx.com/1265578519/repo/master/CentOS/mysql-community.repo -O /etc/yum.repos.d/mysql-community.repo
  13. yum clean all;yum makecache
  14. yum -y install which file wget make automake gcc gcc-c++ pcre-devel zlib-devel openssl-devel sqlite-devel quota unzip bzip2 libaio-devel
  15. ulimit -n 1048576
  16. echo "* soft nofile 1048576" >> /etc/security/limits.conf
  17. echo "* hard nofile 1048576" >> /etc/security/limits.conf
  18. wget http://github.itzmx.com/1265578519/kangle/master/ent/e.sh -O e.sh;sh e.sh /vhs/kangle
  19. wget http://github.itzmx.com/1265578519/kangle/master/kangle/easypanel/ep.sh -O ep.sh;sh ep.sh
  20. yum -y install memcached php-pecl-memcache
  21. yum -y install php-pecl-apc
  22. rm -rf /etc/sysconfig/memcached
  23. wget http://github.itzmx.com/1265578519/kangle/master/memcached/memcached -O /etc/sysconfig/memcached
  24. service memcached start
  25. chkconfig --level 2345 memcached on
  26. echo "127.0.0.1 download.safedog.cn" >> /etc/hosts
  27. setenforce 0 && sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
  28. wget http://github.itzmx.com/1265578519/safedog/master/2.4/safedog_linux64.tar.gz
  29. tar xzf safedog_linux64.tar.gz
  30. cd safedog_linux64
  31. chmod -R 777 install.py
  32. ./install.py
  33. sdcmd webflag 0
  34. sdcmd twreuse 1
  35. sdcmd sshddenyflag 1
  36. cd ..
  37. yum -y install mysql mysql-server
  38. rm -rf /etc/my.cnf
  39. wget http://github.itzmx.com/1265578519/kangle/master/mysql/5.6/my.cnf -O /etc/my.cnf
  40. service mysqld restart

[/code]

复制以上代码刀xshell,然后粘贴就可。

安装后通过访问进入后台设置,默认用户名admin,密码kangle,mysql数据库用户名root,密码空,初始化后点击左边的mysql管理进行修改root密码,修改后记得去服务器设置填写新密码

[code]http://ip:3312/admin[/code]

然后进入easypanel的后台,建立一个站点

阿里云轻云服务器做网站CDN节点 阿里云轻云服务器做网站CDN节点

这里要注意的是www.baidu.com 是你的网站域名,你的后端服务器IP是你的后端服务器,A记录ip是你这台机器的IP地址,你需要将你的域名解析到A记录IP

如果你是centos7的话,也是进入xhsell,复制粘贴如下代码:

[code]

yum update -y;yum install wget -y;wget http://www.osyum.com/yum/eprpm.sh -O ep.sh;sh ep.sh

[/code]

之后也是傻瓜类的安装,不过要注意的是,当你安装面板以后,登录到ip:3312/admin的界面时,centos7以下需要如下设置

阿里云轻云服务器做网站CDN节点

centos7以上需要将主机localhost改为127.0.0.1既可。

你后端服务器也可以设置为kangle,话说kangle的并发能力也是不错的,

https暂时没有设置成功,如果设置成功的话,我也会给大家写一个简用的文章。

 

 
老邢博客
  • 本文由 老邢博客 发表于 2020年5月24日 15:40:03
  • 转载请务必保留本文链接:https://xingyangs.com/lxzt/37.html
匿名

发表评论

匿名网友 填写信息

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定