Python WSGI handler directly in Apache .htaccess, not in VirtualHost

前端 未结 1 1955
慢半拍i
慢半拍i 2021-01-27 23:14

I know how to have a Python Bottle server:

import os
from bottle import route, template, default_app
os.chdir(os.path.dirname(__file__))

@route(\'/hello\')
def          


        
相关标签:
1条回答
  • 2021-01-27 23:52

    I just found the doc, and it seems that the answer is no, sadly:

    When using mod_cgi to host CGI applications, this would be done using the ScriptAlias directive. For mod_wsgi, the directive is instead called WSGIScriptAlias:

    WSGIScriptAlias /myapp /usr/local/www/wsgi-scripts/myapp.wsgi
    

    This directive can only appear in the main Apache configuration files. The directive can be used at server scope but would normally be placed within the VirtualHost container for a particular site. It cannot be used within either of the Location, Directory or Files container directives, nor can it be used within a “.htaccess” file.

    (emphasis mine)

    0 讨论(0)
提交回复
热议问题