mod_cgid モジュールを使用して、web.py アプリケーションを Apache にデプロイしようとしています。
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 と一致しません」というメッセージが表示されます。
そして、それらの 2 つの変数を notfound ページ自体に出力しようとしましたが、それぞれ /app/webstart.py と /app/ を取得しました。
localhost/app/ でアプリケーションにアクセスしたときにアプリケーションを動作させるにはどうすればよいですか?