首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Mod_wsgi问题-这里不允许LoadModule

Mod_wsgi问题-这里不允许LoadModule
EN

Stack Overflow用户
提问于 2012-02-24 05:20:44
回答 1查看 1.7K关注 0票数 1

我想在我的服务器Ubuntu上测试mod_wsgi。

我的.htaccess:

代码语言:javascript
复制
LoadModule wsgi_module modules/mod_wsgi.so
WSGIScriptAlias / /home/apps/hello.py

我的hello.py:

代码语言:javascript
复制
def application(environ, start_response):
    status = '200 OK'
    output = 'Hello World!'

    response_headers = [('Content-type', 'text/plain'),
                        ('Content-Length', str(len(output)))]
    start_response(status, response_headers)

    return [output]

Apache返回:

.htaccess: LoadModule不允许在这里

我的apache conf (/etc/apache2/sites启用/000-默认值):

代码语言:javascript
复制
<VirtualHost *:80>
        ServerAdmin webmaster@localhost

        DocumentRoot /var/www
        <Directory />
                Options FollowSymLinks
                AllowOverride All
        </Directory>
        <Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all
        </Directory>

        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                AllowOverride All
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>

        ErrorLog /var/log/apache2/error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog /var/log/apache2/access.log combined

    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride All
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>

</VirtualHost>

.htaccess在/var/www/sub/

这有什么问题吗?

EN

回答 1

Stack Overflow用户

发布于 2012-02-24 05:39:34

来自阿帕奇医生:

代码语言:javascript
复制
Description:    Links in the object file or library, and adds to the list of active modules
Syntax: LoadModule module filename
Context:    server config
Status: Extension
Module: mod_so

因为它的上下文是Server config,所以您不能在.htaccess中使用它。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/9425785

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档