需要准备一张含有1美元或以上的信用卡用于注册
接着创建实例需要注意2点
1.添加一个盘(加上之前默认分配的8G一共不超过30G)
2.保存好创建的密钥(为了以后也能成功登录,必须设置密钥)
在EC2的网络与安全项中申请一个弹性IP然后绑定你的实例(若申请后未绑定会产生额外费用)
域名解析,我是在腾讯云买的域名,登录腾讯云进行域名解析,将域名指向你的弹性IP
接着用SSH链接我们的云服务器
1.CD到密钥路径
2.
chmod 400 oyjx1211.pem (设置密钥不公开可见)
3.
ssh -i "oyjx1211.pem" ubuntu@ec2-34-227-117-170.compute-1.amazonaws.com (链接)
详见 实例,右键选择链接项
[ 可以尝试用root链接 ]
配置pip3,安装包时报错
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_TIME = "zh_CN.UTF-8",
LC_MONETARY = "zh_CN.UTF-8",
LC_ADDRESS = "zh_CN.UTF-8",
LC_TELEPHONE = "zh_CN.UTF-8",
LC_NAME = "zh_CN.UTF-8",
LC_MEASUREMENT = "zh_CN.UTF-8",
LC_IDENTIFICATION = "zh_CN.UTF-8",
LC_NUMERIC = "zh_CN.UTF-8",
LC_PAPER = "zh_CN.UTF-8",
LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_US.UTF-8").
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_TIME = "zh_CN.UTF-8",
LC_MONETARY = "zh_CN.UTF-8",
LC_ADDRESS = "zh_CN.UTF-8",
LC_TELEPHONE = "zh_CN.UTF-8",
LC_NAME = "zh_CN.UTF-8",
LC_MEASUREMENT = "zh_CN.UTF-8",
LC_IDENTIFICATION = "zh_CN.UTF-8",
LC_NUMERIC = "zh_CN.UTF-8",
LC_PAPER = "zh_CN.UTF-8",
LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_US.UTF-8").
解决方案
在 ~/.bashrc最后一行添加export LC_ALL=C
保存并退出后source ~/.bashrc
换一个实例后,又不一样了,简直各种错
wget https://bootstrap.pypa.io/get-pip.py
sudo -s
python get-pip.py
部署
#这是django环境
sudo apt
-get
install python
-django
-common
python
-django
sudodjango-admin startproject mysite
#安装nginx并启动,然后关闭是:nginx -s stop
sudo apt-get install nginx
sudo service nginx start
oyjx.club