runs cherrypy with mod_wsgi on apache along with another php application. The cherry application is NOT mounted in the root directory, but rather looks like "localhost / apps / myapp" through WSGIScriptAlias ββin the apache configuration file.
In testapp.py, I 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 root of the server, and not as to where it is mounted via WSGI in apache.
Is there a preferred way to make cherry applications work relative to the path they install in apache in WSGIScriptAlias?
Basically, I will run several cherry applications in several different ways and prefer that apache handle dispatching (i.e. cherry just starts the application and doesn't worry about the relative path). This way, I can avoid updating multiple python files / configuration files every time some of the relative paths on the server change.
Any suggestions?
btw, the cherrypy application is currently being passed to the wsgi application as follows:
app = cherrypy.tree.mount(HelloWorld(), '', 'settings.config') return app(environ, start_response)
python cherrypy
Bill zimmerman
source share