zoukankan      html  css  js  c++  java
  • uwsgi --http :8000 --wsgi-file test.py报错问题

    测试uwsgi是否安装成功时,我们一般建一个test.py的文件

    # test.py

    def application(env, start_response):

      start_response('200 OK', [('Content-Type','text/html')])

      return "Hello World"

    然后执行 uwsgi --http :8000 --wsgi-file test.py

    我遇到的问题显示如下:

    ***Starting uWSGI 2.0.13.1 (64bit) on [Tue Aug 23 13:16:46 2016] *** compiled with version: 4.8.5 20150623 (Red Hat 4.8.5-4) on 19 August 2016 14:24:34 os: Linux-3.10.0-327.el7.x86_64 #1 SMP Thu Nov 19 22:10:57 UTC 2015 nodename: iZ230ph83b2Z machine: x86_64 clock source: unix pcre jit disabled detected number of CPU cores: 1 current working directory: /alidata/websites/LandsBLog detected binary path: /root/.virtualenvs/blog/bin/uwsgi uWSGI running as root, you can use --uid/--gid/--chroot options *** WARNING: you are running uWSGI as root !!! (use the --uid flag) *** *** WARNING: you are running uWSGI without its master process manager *** your processes number limit is 7283 your memory page size is 4096 bytes detected max file descriptor number: 65535 lock engine: pthread robust mutexes thunder lock: disabled (you can enable it with --thunder-lock) uWSGI http bound on :8001 fd 4 spawned uWSGI http 1 (pid: 2399) uwsgi socket 0 bound to TCP address 127.0.0.1:45777 (port auto-assigned) fd 3 Python version: 3.4.1 (default, Aug 19 2016, 10:38:55) [GCC 4.8.5 20150623 (Red Hat 4.8.5-4)] *** Python threads support is disabled. You can enable it with --enable-threads *** Python main interpreter initialized at 0x25ccb10 your server socket listen backlog is limited to 100 connections your mercy for graceful operations on workers is 60 seconds mapped 72768 bytes (71 KB) for 1 cores *** Operational MODE: single process *** WSGI app 0 (mountpoint='') ready in 0 seconds on interpreter 0x25ccb10 pid: 2398 (default app) *** uWSGI is running in multiple interpreter mode *** spawned uWSGI worker 1 (and the only) (pid: 2398, cores: 1)

    解决方法:

    linux 防火墙开放特定端口(使用iptables命令):iptables -I -INPUT -p tcp --dport 8000 -j ACCEPT

    使8000端口对外开发,浏览器中访问即可看到打印了 Hello World

  • 相关阅读:
    win2008服务器,fastCGI完美设置教程
    IIS7中配置FastCGI运行PHP
    Apple 移动设备绑定动态生成元素点击事件$(document).on('click',element,callback)失效解决方法
    MacOS Catalina 10.15 brew 安装 PHP 和 使用 pecl 安装 Mcrypt
    Redis 列表命令记录
    Redis hash类型命令
    Redis 字符串命令
    Redis 通用命令记录
    Redis 三种启动方式
    Mac 使用 wget 安装 Redis3.0
  • 原文地址:https://www.cnblogs.com/qfdmmh/p/9916698.html
Copyright © 2011-2022 走看看