running cherrypy with mod_wsgi on apache along with another php app. The cherrypy app is NOT mounted on root, but rather on something like 'localhost/apps/myapp' via WSGIScriptAlias in the apache config file.
In testapp.py, I have tried the following, and when I try to access localhost/apps/myapp in a browser:
app = cherrypy.tree.mount(MyApp(), '', 'settings.config') #FAILS WITH 404
and
app = cherrypy.tree.mount(MyApp(), '/apps/myapp', 'settings.config') # WORKS
The first case fails because cherrypy expects to be at the server root, instead of relative to where it is mounted via WSGI in apache.
Is there a preferred way to make cherrypy apps work relative to the path they are mounted in apache under WSGIScriptAlias?
Basically, I'll be running several cherrypy apps under several different paths, and would prefer if apache handled the dispatching (i.e. cherrypy just runs the app and doesn't worry about the relative path). This way i can avoid updating several different python files/config files everytime some of the relative paths on the server change.
Any suggestions?
btw, the cherrypy app is currently passed to the wsgi application as follows:
app = cherrypy.tree.mount(HelloWorld(), '', 'settings.config')
return app(environ, start_response)