一   conf.ini文件:

[uwsgi]

http = $(HOSTNAME):9033

http-keepalive = 1

pythonpath = ../

module = service

master = 1

processes = 8

daemonize = logs/uwsgi.log

disable-logging = 1

buffer-size = 16384

harakiri = 5

pidfile = uwsgi.pid

stats = $(HOSTNAME):1733

运行:uwsgi --ini   conf.ini

二   conf.xml文件

<uwsgi>

  <!--

  <cluster>225.1.1.1:3333</cluster>

  <socket>192.168.60.*:3031</socket>

  <http>127.0.0.1:3031</http>

  -->

  <http>192.168.3.40:9033</http>

  <pythonpath>../</pythonpath>

  <module>service</module>

  <master>1</master>

  <processes>8</processes>

  <disable-logging />

  <daemonize>logs/uwsgi_bfdds.log</daemonize>

  <buffer-size>16384</buffer-size>

  <harakiri>30</harakiri>

  <pidfile>uwsgi_bfdds.pid</pidfile>

  <stats>192.168.3.40:1716</stats>

</uwsgi>

1  !--开头的是注释掉的。

2  接收的数据有两种方式,socket和http方式。分别写成:

<http>ip:port</http>

<socket>ip:por</socket>

3 <module>service</module>   是应用文件,例子中对应的文件service.py,用来处理请求

4   <pythonpath>../</pythonpath>  是应用文件所在的路径,也就是service.py所在路径。

三  应用内容

service.py脚本:

01 #!/usr/bin/python
02 import os
03 import sys

06 def
application(environ, start_response):
07     status
'200
OK'
08     output
'Hello
World!'
09     response_headers
= [(
'Content-type''text/plain'),
10                     ('Content-Length',
str(len(output)))]
11     start_response(status,
response_headers)
12     return [output]

application
是  wsgi app入口函数

UWSGI配置文件---ini和xml示例的更多相关文章

  1. Solr 6.7学习笔记(02)-- 配置文件 managed-schema (schema.xml)(3)

         5. <fieldType> fieldType主要定义了一些字段类型,其name属性值用于前面<field>中的type属性的值.e.g. <fieldTyp ...

  2. uwsgi配置文件示例

    uwsgi配置文件参考 相关路径请根据自己项目的实际路径配置 在进行Nginx+uwsgi部署Django项目的时候,需要Nginx的配置中包含uwsgi的配置项,具体请查看另一篇:Nginx配置文件 ...

  3. .NET开源类库Nini手册(INI、XML、注册表的配置应用)-中文翻译

    目录 1.简介 1.1什么是应用程序配置数据? 1.2问题 1.3介绍Nini 2.入门 2.1一个简单的例子 2.2默认值 2.3设置.保存和删除键 2.4添加和删除配置 2.5键值扩展 3.高级主 ...

  4. Solr 6.7学习笔记(02)-- 配置文件 managed-schema (schema.xml) -- 样例(6)

    managed-schema 样例: <?xml version="1.0" encoding="UTF-8" ?> <!-- License ...

  5. supervisor uwsgi配置文件

    ; ================================ ; uwsgi supervisor ; ================================ [program:uw ...

  6. Spring项目的配置文件们(web.xml context servlet springmvc)

    我们的spring项目目前用到的配置文件包括1--web.xml文件,这是java的web项目的配置文件.我理解它是servlet的配置文件,也就是说,与spring无关.即使你开发的是一个纯粹jsp ...

  7. SPRING IN ACTION 第4版笔记-第二章WIRING BEANS-008-在Java配置文件中引入xml配置文件@Import、@ImportResource

    1. package soundsystem; import org.springframework.beans.factory.annotation.Autowired; public class ...

  8. 1-2 hibernate主配置文件hibernate.cfg.xml详解

    详 http://www.cnblogs.com/biehongli/p/6531575.html Hibernate的主配置文件hibernate.cfg.xml 1:Hibernate的主配置文件 ...

  9. LabVIEW--为设备添加配置文件.ini

    需求:我同一个程序下载到两台机器人上,有些参数是不一样的,比如说服务器的ID或者端口,以及存放文件的位置,如果我每次下载之前改程序的话就非常麻烦了(虽然在程序里面是作为全局变量来存的),不利于后期的更 ...

随机推荐

  1. qmake pro工程设置

    ----我的生活,我的点点滴滴!! #以下是在terminal里面编译,想编译哪个就修改pro文件 #================================================= ...

  2. android-support-v7-appcompat

    只要把values-v14下的styles.xml修改 用在4.0以上的设备 <!-- Base application theme for API 14+. This theme comple ...

  3. PHP中json序列化后中文的编码显示问题

    在接口返回数据中,我们经常会返回json或者xml格式,php的json序列化函数json_encode非常好用,但是默认会把中文编码为ASCII码(注意,很多人认为这是乱码,其实不是),尤其在调试接 ...

  4. 准备着手学习python

    1. python 的框架 Tornado 网址: http://www.tornadoweb.org/en/stable/ github: https://github.com/tornadoweb ...

  5. Rar related CMD

    recursively add folder Document to archive: (with all the files) rar a *.rar Document recursively ad ...

  6. 多校 Cow Bowling

    题目链接:http://acm.hust.edu.cn/vjudge/contest/124435#problem/I 密码:acm Sample Input Sample Output 分析: #i ...

  7. UVALive 6887 Book Club

    最大流,有向环覆盖问题. #include<cstdio> #include<cstring> #include<string> #include<cmath ...

  8. ZEN_CART_如何添加自定义页面

    按照下面的路径,添加自己的文件,就OK了 以about us页面为例, 默认模板 \includes\templates\template_default\templates\tpl_about_us ...

  9. Chapter 1 First Sight——24

    He looked away quickly, more quickly than I could, though in a flush of embarrassment I dropped my e ...

  10. USER-AGENT是什么

    USER-AGENT是什么? USER-AGENT:记录请求所来自的浏览器. User-Agent分析网站 http://www.useragentstring.com/ 通过解析User-Agent ...