The .htaccess :
AddHandler wsgi-script .wsgi
RewriteEngine On
RewriteBase /
RewriteRule ^(media/.*)$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /index.wsgi/$1 [QSA,L,PT]
The index.wsgi :
import atexit
import threading
import cherrypy
cherrypy.config.update({'environment': 'embedded'})
if cherrypy.engine.state == 0:
cherrypy.engine.start(blocking=False)
atexit.register(cherrypy.engine.stop)
class Root:
def index(self):
return "..."
index.exposed = True
def default(self):
return "default"
index.exposed = True
application = cherrypy.tree.mount(Root(), "/")
- It is a shared host, i don't have access to apache
- I'm not allowed to use WSGIScriptAlias
The 404 error comes from cherrypy(powered by cherrypy on the botton), so i conclude apache is calling the .wsgi file correctly, it seems that its also passing /index.wsgi/, and cherrypy does not know what to do with it.
Can anyone help me with this?
I never deployed a cherrypy app before, is this the best/only/recommended way to do it?
Thanks in advance.