分类 云计算 下的文章
迁移ECS云服务器(阿里云)
阿里云11月10日前的“双11爆款”活动,其中低配的“三个1”(1核1GB内存1Mbps)的机型,三年付是720元,对于我的博客来说,很值。所以,计划之前用了约五年的,续费约九百元/年的ECS实例替换。
过程:
- 查看旧机配置,为新机选型作参考
- 查看旧机数据盘使用情况,将数据复制到系统盘中,因为新机不打算购买数据盘
- 为旧机系统盘打快照
- 为旧机快照创建自定义镜像
- 订购新机时,选择“自定义镜像”
- 将域名解析到新机的公网IP
在 CentOS 7 系统里安装 squid
过程:
yum update# 更新yum install squid# 安装 squidvi /etc/squid/squid.conf# 编辑 squid 的配置文件,将默认的 3128 端口替换成其它,如 3888,http_port 3888,且在添加上用户的IP地址,允许访问 squid,如 acl localnet src x.x.x.x/32systemctl restart squid# 重启 squid 服务systemctl stop firewalld# 停止 CentOS 7 的默认防火墙服务- 在阿里云ECS实例安全组规则里,放行相应的端口,如本例的 3888 端口
- 在用户的浏览器里填写相应的 http 代理连接信息
- 浏览器里测试,可用
参考:https://www.liquidweb.com/kb/how-to-install-squid-caching-proxy-on-centos-7/
在 CentOS 7 通过 Software Collections 源安装 python3.5
CentOS 7里默认的python版本是2.7.5,如需使用python3.5,可以通过 Software Collections 源安装。
过程:
- yum install centos-release-scl # 安装 Software Collections 源
- yum install rh-python35 # 安装 python3.5
- scl enable rh-python35 bash # 启用 python3.5
- python -m http.server 8082 # http访问测试
参考:
在 CentOS 7 通过 Software Collections 源安装 apache2.4 php5.6 mysql5.6
现在不少商家,默认选择 CentOS 7 系统,但里边默认的php版本是5.4的,已经不太适合一些新版本的程序要求了。
过程:
- yum install centos-release-scl # 安装 Software Collections 源
- yum install httpd24 # 安装 apache 2.4
- scl enable httpd24 bash
- service httpd24-httpd start # 启动 apache 2.4 服务
- yum install rh-php56 rh-php56-php rh-php56-php-gd rh-php56-php-mbstring rh-php56-php-mysqlnd rh-php56-php-pdo rh-php56-php-xml # 安装 php5.6 及相关
- scl enable rh-php56 bash
- yum install rh-mysql56 # 安装 mysql5.6
- scl enable rh-mysql56 bash
- service rh-mysql56-mysqld start # 启动 mysql 服务
- mysql_secure_installation # 修改mysql的默认空密码
- 上传一份 phpmyadmin 到 opt/rh/httpd24/root/var/www/html/ ,测试正常
参考:
