阿里云服务
阿里云服务
云服务厂商
国内: 阿里云 腾讯云 百度云 京东云 华为云 青云 ucloud 国外: AWS google Azure
架构的区别
阿里云界面
计费方式
包年包月
按月付费
抢占式实例
可用区域
ECS
镜像
不用自己装系统
存储
网络和安全组
安全组
系统设置
Oldzhang123456
确认订单
创建成功
控制台
意外情况
连接密码
弹性公网IP
连接测试
[d:~]$ ssh root@120.24.174.219
[root@tomcat01 ~]# ip r
default via 172.16.0.253 dev eth0
169.254.0.0/16 dev eth0 scope link metric 1002 172.16.0.0/24 dev eth0 proto kernel scope link src 172.16.0.39
挂载数据盘
[root@tomcat01 ~]# fdisk -l|grep dev
Disk /dev/vda: 42.9 GB, 42949672960 bytes, 83886080 sectors
/dev/vda1 *
2048 83875364 41936658+ 83 Linux
Disk /dev/vdb: 21.5 GB, 21474836480 bytes, 41943040 sectors
[root@tomcat01 ~]# mkfs.xfs /dev/vdb
meta-data=/dev/vdb
isize=512 agcount=4, agsize=1310720 blks sectsz=512 attr=2, projid32bit=1
= =
crc=1
finobt=0, sparse=0
ta =
bsize=4096 blocks=5242880, imaxpct=25 sunit=0 swidth=0 blks
▽
=
naming =version 2 log =internal log =
bsize=4096 ascii-ci=0 ftype=1 bsize=4096 blocks=2560, version=2 sectsz=512 sunit=0 blks, lazy-count=1 extsz=4096 blocks=0, rtextents=0
realtime =none
[root@tomcat01 ~]# mkdir /data
[root@tomcat01 ~]# blkid
/dev/vda1: UUID="1114fe9e-2309-4580-b183-d778e6d97397" TYPE="ext4" /dev/vdb: UUID="4edca30b-93f2-440e-bd00-fbb2b067388c" TYPE="xfs"
[root@tomcat01 ~]# tail -1 /etc/fstab
UUID=4edca30b-93f2-440e-bd00-fbb2b067388c /data xfs defaults 0 0
[root@tomcat01 ~]# mount -a
[root@tomcat01 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/vda1 devtmpfs tmpfs
40G 1.9G 36G 6% /
909M 0 909M 0% /dev 920M 0 920M 0% /dev/shm 920M 492K 919M 1% /run
tmpfs
tmpfs
920M 0 920M 0% /sys/fs/cgroup 184M 0 184M 0% /run/user/0 20G 33M 20G 1% /data
tmpfs
/dev/vdb
[root@tomcat01 ~]#
阿里云安装tomcat
安全组开方8080端口
安装NGINX和PHP
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
yum -y install php71w php71w-cli php71w-common php71w-devel php71w-embedded php71w-gd php71w-mcrypt php71w-mbstring php71w-pdo php71w-xml php71w-fpm php71w-mysqlnd php71w-
opcache php71w-pecl-memcached php71w-pecl-redis php71w-pecl-mongodb
云数据库
创建高权限用户
测试连接
[root@tomcat01 ~]# mysql -uroot -pOldzhang123456 -hrm- wz97115cflb3rhrtx.mysql.rds.aliyuncs.com MySQL [(none)]>
MySQL [(none)]> select user,host from mysql.user;
+---------------+---------------+
| user
| host
|
+---------------+---------------+
| aurora
| %
| | |
| aurora_proxy | %
| root
| %
| replicator | 11.216.253.67 |
| aliyun_root | 127.0.0.1 |
| mysql.session | localhost |
| mysql.sys | localhost | +---------------+---------------+
创建数据库
授权账号
查看账号
LNMP设置
groupadd www -g 666
useradd www -s /sbin/nologin -M -u 666 -g 666
sed -i '/^group/c group = www' /etc/php-fpm.d/www.conf
sed -i '/^user/c user = www' /etc/php-fpm.d/www.conf
systemctl start php-fpm
wget https://cn.wordpress.org/wordpress-4.9.4-zh_CN.tar.gz mkdir /code
tar zxf wordpress-4.9.4-zh_CN.tar.gz -C /code
chown -R www:www /code/
web端配置
NAS
挂载测试
[root@tomcat01 ~]# yum install nfs-utils -y
[root@tomcat01 ~]# mount -t nfs -o vers=4,minorversion=0,noresvport 2033e486dc-bpq27.cn- shenzhen.nas.aliyuncs.com:/ /mnt
挂载到wordpress目录
cd /code/wordpress/wp-content
mv uploads uploads_bak
mount -t nfs -o vers=4,minorversion=0,noresvport 2033e486dc-bpq27.cn- shenzhen.nas.aliyuncs.com:/ /code/wordpress/wp-content/uploads
mv uploads_bak/* uploads/
rm -rf uploads_bak/
[root@tomcat01 ~]# tail -1 /etc/fstab
2033e486dc-bpq27.cn-shenzhen.nas.aliyuncs.com:/ /code/wordpress/wp-content/uploads nfs defaults 0 0
快照与自定义镜像
查看镜像
基于镜像创建新实例
负载均衡****SLB
很高兴各位朋友能欣赏作品,本文版权归作者和博客园共有,欢迎转载,请在文章页面明显位置给出原文出处,否则将追究法律责任。 原文链接: https://www.cnblogs.com/strugger-0316