# 实战阿里云

# 创建ECS服务器

# 进入管理界面

image-20200305105518148

# 选择服务器配置

为了省钱 选择抢占式实例 中的最低配置

image-20200305105850701

image-20200305105938529

image-20200305110205025

# 网络设置

image-20200305110315646

# 安全组配置

image-20200305110633055

image-20200305110654833

image-20200305110723557

image-20200305110947283

# 启动实例

image-20200305111600380

image-20200305112256402

# 设置免密登录

vi .ssh/authorized_keys
~ cat .ssh/id_rsa.pub

# 安装mysql

#移除之前安装的mysql
sudo apt-get --purge remove mysql-server mysql-common mysql-client

#安装mysql-server
sudo apt-get install mysql-server mysql-common mysql-client


#更改mysql root账户认证模式
mysql
select user, plugin from mysql.user;
update mysql.user set authentication_string=PASSWORD('密码'), plugin='mysql_native_password' where user='root';
flush privileges;
exit

##example
mysql
select user, plugin from mysql.user;
update mysql.user set authentication_string=PASSWORD('kaikeba'), plugin='mysql_native_password' where user='root';
flush privileges;
exit

#重启mysql-server
service mysql restart

#配置root远程登陆
mysql
grant all on *.* to root@'%' identified by '密码' with grant option;
flush privileges;
exit

##example
mysql -u root -pkaikeba
grant all on *.* to root@'%' identified by 'kaikeba' with grant option;
flush privileges;
exit


#修改侦听地址127.0.0.1为0.0.0.0
vi /etc/mysql/mysql.conf.d/mysqld.cnf
bind-address = 0.0.0.0

# 远程登录验证

mysql -h 47.105.39.20 -u root -pkaikeba

# 安装Nginx


apt-get install nginx

添加安全组规则

image-20200305115603858

image-20200305115723135

# 安装Node

  • gzip
  • 缓存优化

Node安装