环境搭建

一、基本配置

  • 1、连接如果出现连接不上的时候运行

    ➜  / ssh -p 22 root@120.**.156.230
    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    @    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
    Someone could be eavesdropping on you right now (man-in-the-middle attack)!
    It is also possible that a host key has just been changed.
    The fingerprint for the ECDSA key sent by the remote host is
    SHA256:Jltt0WmFJjoolozkKlNOnbBA9GR/VphFUQ6cd6kSgeA.
    Please contact your system administrator.
    Add correct host key in /Users/shuiping.kuang/.ssh/known_hosts to get rid of this message.
    Offending RSA key in /Users/shuiping.kuang/.ssh/known_hosts:9
    ECDSA host key for 120.24.156.230 has changed and you have requested strict checking.
    Host key verification failed.
    
    ssh-keygen -R 输入服务器的IP
    
  • 2、更新源

    sudo apt-get update
    
    sudo apt-get upgrade
    
  • 3、更多关于Ubuntu命令

二、mysql的安装

  • 1、运行几条命令

    sudo apt-get install mysql-server
    sudo apt-get install libmysqlclient-dev
    
  • 2、运行过程中要输入密码,注意要记住(如果直接点击ok密码就是空)

  • 3、测试安装成功吗

    mysql -uroot -p
    mysql> show databases;
    +--------------------+
    | Database           |
    +--------------------+
    | information_schema |
    | mysql              |
    | performance_schema |
    | sys                |
    +--------------------+
    4 rows in set (0.00 sec)
    
    mysql>
    
  • 4、关于修改mysql密码的方式传送门

  • 5、配置客户端工具连接传送门

二、虚拟环境的安装

  • 1、安装包

    apt-get install python3-pip # 默认下是没有安装pip的,
    sudo pip install virtualenv
    sudo pip install virtualenvwrapper
    
  • 2、创建目录用来存放虚拟环境

    mkdir -p /var/env
    
  • 3、在/root打开vim .bashrc文件在尾部添加

    export WORKON_HOME=/var/env
    source /usr/local/bin/virtualenvwrapper.sh
    
  • 4、创建一个空间

    mkvirtualenv django_env --python=python3.4
    

三、安装nginx

  • 1、安装命令

    sudo apt-get install nginx
    
  • 2、几个常用的命令

    sudo service nginx start # 启动nginx
    sudo service nginx stop # 关闭nginx
    sudo /etc/init.d/nginx restart #重启
    sudo service nginx restart # 重启
    

四、安装uwsgi包(本地环境及虚拟空间都要安装)

  • 1、安装命令

    apt-get install python3-dev # 如果你本地是使用的python2就apt-get install python-dev
    apt-get install gcc
    sudo pip install uwsgi
    

results matching ""

    No results matching ""