阿里云服务

阿里云服务

云服务厂商

国内: 阿里云 腾讯云 百度云 京东云 华为云 青云 ucloud 国外: AWS google Azure

架构的区别

image-20210310204222674

阿里云界面

image-20210310204253874

image-20210310204306924

计费方式

包年包月

按月付费

image-20210310204335932

抢占式实例

image-20210310204421780

可用区域

image-20210310204446999

image-20210310204502465

ECS

image-20210310204533326

镜像

不用自己装系统

image-20210310204611121

存储

image-20210310204632287

网络和安全组

image-20210310204651440

image-20210310204740045

image-20210310204759674

image-20210310204817420

安全组

image-20210310204918866

image-20210310204950516

image-20210310205003859

image-20210310205207242

image-20210310205221981

image-20210310205233768

系统设置

Oldzhang123456

image-20210310205336512

确认订单

image-20210310205415060

image-20210310205438789

创建成功

image-20210310205505819

image-20210310205519100

控制台

image-20210310205546677

意外情况

image-20210310205611970

连接密码

image-20210310205640248

image-20210310205659487

弹性公网IP

image-20210310205753265

image-20210310205834209

image-20210310205847597

image-20210310205913935image-20210310205931790

image-20210310205946205

连接测试

[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端口
image-20210310210214425

image-20210310210232947

安装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 

云数据库

image-20210310210402260

image-20210310210413498

image-20210310210501667

image-20210310210521621

image-20210310210539516

image-20210310210552912

image-20210310210607520

image-20210310210624552

image-20210310210640547

image-20210310210652735

创建高权限用户

image-20210310210719297

测试连接

[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   |  +---------------+---------------+  

创建数据库

授权账号

image-20210310210940375

查看账号

image-20210310211002448

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端配置

image-20210310211137847

image-20210310211153302

image-20210310211242739

NAS

image-20210310211316397

image-20210310211329661

image-20210310211342898

image-20210310211401117

image-20210310211415638

挂载测试

[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  

快照与自定义镜像

image-20210310211549736

image-20210310211649474

image-20210310211702080

image-20210310211806197

image-20210310211844367

image-20210310211934659

image-20210310211949950

查看镜像

image-20210310212015085

基于镜像创建新实例

image-20210310212043617

image-20210310212056211

image-20210310212108625

负载均衡****SLB

image-20210310212132291

image-20210310212147507

posted @ 2021-03-10 21:27  上善若水~小辉  阅读(387)  评论(0编辑  收藏  举报