阿帕奇,网页.py找不到Mod\u WSGI问题页

2024-04-26 13:41:51 发布

您现在位置:Python中文网/ 问答频道 /正文

请帮助您了解我的配置Apache+有什么问题网页.py+无法加载Mod\u WSGI和我的网站,这是我的配置:

Apache版本:2.7.4

在网页.py版本->;https://github.com/webpy/webpy

mod\wsgi->;不确定是3.3还是3.4

目录 /var/www/pyapps/bot

web -> link webpy webpy code.py static templates

阿帕奇 服务器管理员站长@localhost在

    DocumentRoot /var/www
    <Directory />
            Options FollowSymLinks
            AllowOverride None
    </Directory>

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


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

    ErrorLog ${APACHE_LOG_DIR}/error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    CustomLog ${APACHE_LOG_DIR}/access.log combine

^{pr2}$

在代码.py在

导入web

URL=( '/.*,'你好', )在

大家好: def GET(自我): return“你好,世界”

应用程序=web.application应用程序(url,globals()).wsgifunc()

找不到

在此服务器上找不到请求的URL/sitea。在

Apache/2.2.22(Ubuntu)服务器xxx.xxx.xxx.xxx端口80


Tags: py服务器nonewebbinvarapachewww
1条回答
网友
1楼 · 发布于 2024-04-26 13:41:51

WSGIScriptAlias路径的结尾不应该有斜杠:

WSGIScriptAlias /sitea /var/www/pyapps/bot/code.py

另外请注意,您不应该将WSGI应用程序文件放在文档根目录(/var/www)中。将它们放在其他地方(并相应地更改WSGIScriptAlias路径)。在

相关问题 更多 >