阿里云搭建django环境
更新源
sudo apt-get update
sudo apt-get upgrade
安装nginx
sudo apt-get install nginx
sudo /etc/init.d/nginx start (start可以改成restart/stop)
#或是sudo service nginx start
然后浏览器输入服务器IP,观察是否有welcom to nginx!
安装py3和virtualenv
sudo apt-get install git python3 python3-pip
sudo pip3 install virtualenv
修改python版本:
法一:(不建议)
$ gedit ~/.bashrc #gedit .bash_aliases
在顶部加入一行alias python=python3
$ source ~/.bashrc #或是source ~/.bash_aliases o
$ python --version
就会发现是Python 3.5.2啦
/*or
Open your .bashrc file nano ~/.bashrc. Type alias python=python3 on to a new line at the top of the file then save the file with ctrl+o and close the file with ctrl+x. Then, back at your command line type source ~/.bashrc. Now your alias should be permanent.
*/
▲.切换Python