與web.py匹配REQUEST_URI我試圖部署具有mod_cgid模塊中的Apache我的web.py應用。SCRIPT_NAME不存在於Apache cgid進行模塊
我在urls.py中定義的URL這樣
urls = (
'/app/', 'index.index',
'/', 'index.index'
)
這是我的應用程序啓動webstart.py
import web, urls, sys, os
def notfound():
return web.notfound()
if __name__ == "__main__":
app = web.application(urls.urls, globals())
app.notfound = notfound
app.run()
我的Apache配置看起來像這樣
<Directory "dirname">
Options +ExecCGI +FollowSymLinks +Indexes
Order allow,deny
Allow from all
Require all granted
DirectoryIndex webstart.py
</Directory>
當我嘗試用localhost/app /來打我的服務器時,它總是顯示notfound頁面和日誌,我看到消息話題「警告:SCRIPT_NAME不匹配REQUEST_URI」
然後我試圖打印這兩個變量在NOTFOUND網頁它的自我和我/app/webstart.py和/應用/分別。
如何讓我的應用程序工作時,我與本地主機/應用程序訪問/?
我刪除了,並沒有工作。它會產生以下錯誤消息。 「AH01265:嘗試調用目錄爲腳本」 –
thefourtheye
2013-03-28 08:37:43
@thefourtheye抱歉,我的錯。我已經更新了答案。 – 2013-03-28 09:27:36
其實我可以像這個localhost/app/webstart.py /那樣訪問它,但不能訪問靜態文件夾。現在閱讀關於mod_rewrite – thefourtheye 2013-03-28 09:39:47