python2.7安装和uwsgi

tar zxf Python-2.7.13xxxx# 这里,必须用–enable-shared,生成动态库,否则会遇到wsgi不能编译的问题。

Bonus: multiple Python versions for the same uWSGI binary

As we have seen, uWSGI is composed of a small core and various plugins. Plugins can be embedded in the binary or loaded dynamically. When you build uWSGI for Python, a series of plugins plus the Python one are embedded in the final binary.

This could be a problem if you want to support multiple Python versions without building a binary for each one.

The best approach would be having a little binary with the language-independent features built in, and one plugin for each Python version that will be loaded on-demand.

In the uWSGI source directory:

  1. make PROFILE=nolang

This will build a uwsgi binary with all the default plugins built-in except the Python one.

Now, from the same directory, we start building Python plugins:

  1. PYTHON=python3.4 ./uwsgi --build-plugin "plugins/python python34"
  2. PYTHON=python2.7 ./uwsgi --build-plugin "plugins/python python27"
  3. PYTHON=python2.6 ./uwsgi --build-plugin "plugins/python python26"

You will end up with three files: python34_plugin.so, python27_plugin.so, python26_plugin.so. Copy these into your desired directory. (By default, uWSGI searches for plugins in the current working directory.)

Now in your configurations files you can simply add (at the very top) the plugins-dir and plugin directives.

  1. [uwsgi]
  2. plugins-dir = <path_to_your_plugin_directory>
  3. plugin = python26

This will load the python26_plugin.so plugin library from the directory into which you copied the plugins.

python2.7安装和uwsgi的更多相关文章

  1. 安装Nginx+uWSGI+Django环境

    Ubuntu Server 12.04 安装Nginx+uWSGI+Django环境 今天要介绍的是利用APT源直接apt-get install安装配置我们所需要的环境,首先按惯例先安装MySQL和 ...

  2. python2.7安装beautifulsoup包

    python2.7安装beautifulsoup包 准备条件: 1.已经安装好python2.7 2.下载beautifulsoup包,选择合适的包,网址:https://www.crummy.com ...

  3. python2.7安装mysql-python

    环境:python2.7.14+mysql-python-1.2.3.win-amd64-py2.7.exe 安装版本许参照解释器版本,有64和32位之分,如果安装错误版本,则运行时会报错:Impor ...

  4. Atitti python2.7安装 numpy attilax总结

    Atitti python2.7安装 numpy attilax总结 1.1. easy_install 安装模式,没有 easy_install ,先手动安装1 1.2. 安装setuptools ...

  5. python2在安装pywin32后出现ImportError: DLL load failed 解决方法

    python2在安装pywin32后出现ImportError: DLL load failed 解决方法 在python2中有时候会出现: import win32api   ImportError ...

  6. win7 64位环境下,为python2.7 安装pip

    第一步: 安装python并配置好环境变量 参见:http://blog.csdn.net/donggege214/article/details/52062855 第二步: 下载setuptools ...

  7. centos 6.x Python2.7x安装

    centos 6.x Python2.7x安装 yum install -y gcc gcc-develwget https://www.python.org/ftp/python/2.7.14/Py ...

  8. 在Win10下,python3和python2同时安装并解决pip共存问题

    前提 本文是在Windows64位系统下进行的,32位系统请下载相应版本的安装包,安装方法类似. 在Win10下,python3和python2同时安装并解决pip共存问题解决: 1.下载python ...

  9. centos7下python2环境安装pip2、kazoo、bottle、beaker

    摘自:https://mp.weixin.qq.com/s?src=11&timestamp=1576355125&ver=2034&signature=mNp2na6VjFz ...

随机推荐

  1. Confluence 6 workbox 包含从 Jira 来的通知

    如果你的 Confluence 站点链接了一个 Jira 应用,你可以包含从 Jira 应用来的通知,例如 Jira 软化或 Jira 服务器桌面. 希望包含有从 Jira 应用来的通知: 你的 Ji ...

  2. Niagara 泵阀

    1.泵阀系统 2.Niagara 每次在启动workbench的时候安装一下daemon,后启动platform 启动station的时候,当station的status变成Running之后启动

  3. hdu5015构造转移矩阵

    /* 构造转移矩阵: 先推公式: 首先是第0行:A[0][j+1]=A[0][j]*10+3 1-n行: A[i][j+1]=A[i][j]+A[i-1][j+1]=... =A[i][j]+A[i- ...

  4. A^B Mod C

    A^B Mod C 时间限制: 1 Sec  内存限制: 32 MB Problem Description 给出3个正整数A B C,求A^B Mod C. 例如,3 5 8,3^5 Mod 8 = ...

  5. ajax----发送异步请求的步骤

    1)获取(创建)Ajax对象:获取XMLHttpRequest对象2)创建请求:调用xhr的open方法3)在发送请求之前需要设置回调函数:绑定指定xhr的onreadystatechange事件4) ...

  6. 不显示TensorFlow加速指令警告

    vim ~/.bashrc 在打开的文件中追加: export TF_CPP_MIN_LOG_LEVEL= 最后再执行 source ~/.bashrc

  7. [转] Nodejs 进阶:Express 常用中间件 body-parser 实现解析

    写在前面 body-parser是非常常用的一个express中间件,作用是对post请求的请求体进行解析.使用非常简单,以下两行代码已经覆盖了大部分的使用场景. app.use(bodyParser ...

  8. [转] babel-plugin-react-css-modules配置

    自己的react项目用到了css-modules,由于不太想在写className时写style.xxx于是google解决方案,找到了这货->babel-plugin-react-css-mo ...

  9. JS高级程序设计3

    PS:有一小部分写在了 JS 2017了 JSON <!DOCTYPE html> <html lang="en"> <head> <me ...

  10. 【回顾】html链接、头部

    1.HTML 链接 HTML 使用超级链接与网络上的另一个文档相连.几乎可以在所有的网页中找到链接.点击链接可以从一张页面跳转到另一张页面. HTML 超链接(链接) HTML使用标签 <a&g ...