【问题标题】:OpenBSD httpd bottle app and uwsgiOpenBSD httpd 瓶应用程序和 uwsgi
【发布时间】:2017-09-15 23:13:58
【问题描述】:

我想使用本地 httpd Web 服务器在 OpenBSD 上开发和部署瓶子应用程序。根据我的发现,uWSGI 将运行瓶子应用程序,httpd 将代理请求。我不了解 uWSGI 是如何启动的,也不了解如何在 OpenBSD 上使用 ini 文件。

我可以启动 httpd 并提供静态内容,并且我的 Bottle 应用程序可以在开发 Web 服务器和 pythonanywhere 上正常工作。现在我需要使用 httpd 和 uwsgi 运行它。如何启动 uwsgi 服务器?

httpd.conf
server "default" {
        listen on egress port 80

        location "/bottleapp/*" {
                fastcgi socket ":3031"
        }
}
types {
        text/css css ;
        text/html htm html ;
        text/txt txt ;
        image/gif gif ;
        image/jpeg jpg jpeg ;
        image/png png ;
        application/javascript js ;
        application/xml xml ;
}

【问题讨论】:

    标签: apache uwsgi bottle openbsd


    【解决方案1】:

    一种方法是创建一个 uwsgi rc.d 文件以放置在 /etc/rc.d 中。像下面这样的东西可能会起作用:

    #!/bin/sh
    
    daemon="/path/to/uwsgi"
    
    . /etc/rc.d/rc.subr
    
    rc_reload="NO"
    
    rc_stop() {
            ${daemon} --stop /path/to/uwsgi.pid
    }
    
    rc_cmd $1
    

    然后你可以运行:rcctl enable uwsgi

    还有:rcctl set uwsgi flags "--ini /path/to/uwsgi.ini"

    具有 uwsgi ini 文件、二进制文件和 pid 文件的正确路径。

    【讨论】:

      猜你喜欢
      • 2014-04-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-09-01
      • 1970-01-01
      • 1970-01-01
      • 2018-08-21
      • 1970-01-01
      相关资源
      最近更新 更多