【问题标题】:Apache running static content and flask appApache 运行静态内容和烧瓶应用程序
【发布时间】:2012-05-27 13:10:17
【问题描述】:

我有一个通过 wsgi 运行的 Flask 应用程序。

为了教训我的应用程序的负载,它加载了很多东西,我想通过 apache 提供我的主页或根 url,但我在尝试通过发送“/”静态索引文件时遇到冲突apache,然后将其他所有内容发送到wsgi:

<VirtualHost *:80>
    ServerName www.yada.com

    Alias /static /home/ubuntu/yada/static
    <Location /static>
        SetHandler None
    </Location>

    WSGIDaemonProcess yada
    WSGIScriptAliasMatch /.+ /home/ubuntu/yada/wsgi.py

    <Directory /home/ubuntu/yada>

        RewriteEngine On
        RewriteRule ^/$ /static/html/index.html [L]

        WSGIProcessGroup postwire
        WSGIApplicationGroup %{GLOBAL}
        Order deny,allow
    </Directory>
</VirtualHost>

有什么帮助吗?

【问题讨论】:

    标签: python apache mod-rewrite wsgi


    【解决方案1】:

    参见章节末尾的 AddHandler/mod_rewrite 解决方案:

    http://code.google.com/p/modwsgi/wiki/ConfigurationGuidelines#The_Apache_Alias_Directive

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-12-13
      • 2016-12-09
      • 1970-01-01
      • 2015-07-05
      • 2012-11-19
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多