Linux安装在虚拟机上

虚拟机上安装centos7 minimal

  详细操作链接:https://blog.csdn.net/babyxue/article/details/80970526

  镜像文件 xxx.iso 本质就是压缩文件

  DHCP服务,在计算机启动时分配中IP dns 网管的参数,DNS服务器则是解析域名为IP地址

  补充 后续minimal安装图形界面 切换到root权限(一开始不给安装)

    -yum 可以以程序组的模式来安装成套的软件包。支持的软件包可以通过,

    -1. yum grouplist  在 group 软件包中找到有 KDE Plasma Workspaces 和 Gnome Desktop 两大桌面环境(这是centos7的)

   -2. yum groupinstall "GNOME Desktop" 安装程序会自动解决安装包和组件的依赖关系   
   -3.
从命令行直接启动图形桌面环境, startx
   -4.CentOS 7 中直接使用 systemd 指令修改启动目的状态即可。使用systemctl get-default 需要的模式类型(修改启动时的配置,初始时minimal的)
如果需要卸载图形界面
    yum  groupremove 'GNOME Desktop' 终端执行移除命令
    systemctl set-default graphical.target(图形界面模式) reboot重启系统

    反之切回字符界面模式 systemctl set-default multi-user.target(字符界面模式) 

Linux 搭建uwsgi服务详细教程https://blog.csdn.net/heyddo/article/details/51075280
    -1.安装需要的开发包

        yum groupinstall "Development tools" (整体安装)
        yum install zlib-devel bzip2-devel pcre-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel python-devel
    如果需要升级Python版

        wget http://python.org/ftp/python/2.7.5/Python-2.7.5.tar.bz2 (a.通过wget访问网络资源,下载Python压缩包)
        tar xvf Python-2.7.5.tar.bz2 (b.解压Python文件) 
        cd python-2.7.5 (进入目录,配置文件)
        
./configure --prefix=/usr/local
        make && make altinstall (进行编译)

    -2.安装Python管理包easy_install (easy_install包 https://pypi.python.org/pypi/distribute)  已经Python的请无视以上步骤 

          wget 资源地址

          tar xf distribute-0.6.49.tar.gz
          cd distribute-0.6.49         -**********-  通过Python安装
          python setup.py install
          easy_install --version(查看版本)

        安装pip,相比easy_install ,更好管理Python包  执行easy_install pip

    -3.安装uwsgi

      

uwsgi:https://pypi.python.org/pypi/uWSGI

uwsgi参数详解:http://uwsgi-docs.readthedocs.org/en/latest/Options.html


在安装uWSGI的时候有可能提示说是libxml2不存在,针对此情况,建议通过 yum install libxml2-devel来解决</font>

raise Exception("you need a C compiler to build uWSGI")

    Exception: you need a C compiler to build uWSGI

出现以上错误是因为没有c的编译器,执行:yum install gcc  

  (ubuntu下可用apt-get install libxml2-dev)

    如编译出现下问题:

     In file included from plugins/python/python_plugin.c:1:0:
    plugins/python/uwsgi_python.h:2:20: fatal error: Python.h: No such file or directory
    compilation terminated.
    需安装python-devel(ubuntu下出现依赖问题,可使用aptitude install python-devel)我没有apt-get,直接用了 yum install python-devel
(可能会出现确认之类的)

 

python安装包的工具有easy_install, setuptools, pip,distribute。使用这些工具都能下载并安装django

 

 

 


  
posted @ 2019-01-19 20:30  coding天荒地老  阅读(234)  评论(0编辑  收藏  举报