在切诺基和uwsgi上部署烧瓶 [英] Deploying flask on cherokee and uwsgi

查看:178
本文介绍了在切诺基和uwsgi上部署烧瓶的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图部署一个使用cherokee和uwsgi开发的Web应用程序。我安装了cherokee和uwsgi并运行(我认为uwsgi有效),但是当我在cherokee中配置应用程序时,我得到一个错误,提示 uWSGI Error wsgi应用程序未找到

 < uwsgi>使用xml配置文件(我认为您需要使用cherokee)。 
< pythonpath> / srv / mobile-site / app /< / pythonpath>
< app mountpoint =/>
< module> mobilecms< / module>
< callable> app< / callable>
< / app>
< / uwsgi>

我的应用程式在 / srv / mobile-site / app / 文件夹,其主脚本为 mobilecms.py



是否有错用这个文件?权限错误会导致这种情况?提前感谢您的帮助!

解决方案

罗伯托的建议是一个很好的建议;这将有助于诊断错误发生的位置(即是否是uWSGI或切诺基)。

我最近还争取让uWSGI和Cherokee一起工作。我最终在Cherokee手动配置了uWSGI源代码:




  • 在Cherokee Admin的Sources选项卡中,添加一个新的源代码uWSGI Source和套接字/tmp/foo.sock

    • 将类型更改为本地解释器

    • 在解释器输入: / usr / local / bin / uwsgi -x /path/to/uwsgiconfig.xml


  • 在虚拟服务器的规则管理中,单击以添加新的行为规则。

    • 选择路径为/的类型为Directory的手动配置

    • 将处理程序设置为uWSGI li>
    • 滚动到底部并为平衡器设置循环

    • 添加uWSGI源信息源

    • 保存更改并重启Cherokee



    在我的uWSGI配置文件中,像这样(适应你的例子):

     < uwsgi> 
    < chdir> / srv / mobile-site / app /< / chdir>
    < wsgi-file> /srv/mobile-site/app/mobilecms.py< / wsgi-file>
    < callable> app< / callable>

    < socket> /tmp/foo.sock< / socket>
    < chmod-socket> 666< / chmod-socket>

    < master />
    <进程> 1< /进程>

    < disable-logging /><! - 错误仍然记录;这只是禁用切诺基照顾的请求日志 - >

    < vacuum />
    < no-orphans />
    < / uwsgi>请注意,切诺基uWSGI向导不接受这是一个有效的配置文件(因此手动配置)。


    I'm attempting to deploy a flask web app I've developed using cherokee and uwsgi. I got cherokee and uwsgi installed and working (i think uwsgi works), but when I configure the app in cherokee, i just get an error saying uWSGI Error wsgi application not found. I used an xml config file (I think you need to with cherokee), and that contains this:

    <uwsgi>
        <pythonpath>/srv/mobile-site/app/</pythonpath>
        <app mountpoint="/">
            <module>mobilecms</module>
            <callable>app</callable>
        </app>
    </uwsgi>
    

    My flask app is obviouly in the /srv/mobile-site/app/ folder with the main script being mobilecms.py.

    Is there something wrong with this file? Would permission errors cause this? Thanks in advance for any help!

    解决方案

    Roberto's suggestion is a good one; it will help diagnose where the error is occurring (i.e. whether it's uWSGI or Cherokee).

    I've also recently fought to get uWSGI and Cherokee to work together. I ended up configuring the uWSGI source in Cherokee manually:

    • In Cherokee Admin, under the "Sources" tab, add a new source with nickname "uWSGI Source" and socket "/tmp/foo.sock"
      • Change the type to "Local Interpreter"
      • In the interpreter field, enter: /usr/local/bin/uwsgi -x /path/to/uwsgiconfig.xml
    • In rule management for the virtual server, click to add a new behaviour rule.
      • Choose a manual configuration of type "Directory" with a path of "/"
      • Set the handler to "uWSGI"
      • Scroll to the bottom and set "Round Robin" for the balancer
      • Add the "uWSGI Source" information source
    • Save changes and restart Cherokee

    In my uWSGI config file I have something like this (adapted to your example):

    <uwsgi>
        <chdir>/srv/mobile-site/app/</chdir>
        <wsgi-file>/srv/mobile-site/app/mobilecms.py</wsgi-file>
        <callable>app</callable>
    
        <socket>/tmp/foo.sock</socket>
        <chmod-socket>666</chmod-socket>
    
        <master />
        <processes>1</processes>
    
        <disable-logging /><!-- Errors are still logged; this just disables request logging which Cherokee takes care of -->
    
        <vacuum />
        <no-orphans />
    </uwsgi>
    

    Note that the Cherokee uWSGI wizard doesn't accept this as a valid configuration file (hence the manual configuration).

    这篇关于在切诺基和uwsgi上部署烧瓶的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆