List Info

Thread: Re: Need help to get cherrypy to work




Re: Need help to get cherrypy to work
user name
2007-11-06 07:43:12
Sorry for the long delay in a response.  I don't have any
personal
experience with mod_python, so I really don't have much
advise on
fixing your current setup (having your .py files inside of
htdocs/
sounds scary though).

I would suggest you try another method of deployment.  I've
personally
had great success with CherryPy+Apache+mod_proxy.  There is
decent
documentation to get you started with that combo:

http://tools.
cherrypy.org/wiki/ModProxy

For other tips on Apache+CherryPy (including some stuff on
mod_python
deployment) see:

http://to
ols.cherrypy.org/wiki/BehindApache

HTH,

Christian
http://www.dowski.com

On 10/31/07, martdi <martin.diongmail.com> wrote:
>
> Hi,
> I would like to know hot to get cherrypy to work in a
directory other
> than the root directory of the webserver.
>
> When I setup cherrypy in the htdocs folder and then
access the page at
> http://localhost/,
everything works fine. However, when i move
> the .htaccess and cpdeploy.py files to the cpytest
folder, located in
> htdocs, I get:
>
>
> 404 Not Found
> The path '/cpytest/' was not found.
> Powered by CherryPy 3.0.1
>
>
> I would like to have only the to have what is under http://localhost/cpytest/
> to be managed by cherrypy
>
> I am running apache 2.2.6 with mod_python under windows
xp.
>
> >From what I have tested, cpdeploy never gets
called.
>
>
> Location of the htdocs folder:
> C:Program FilesApache Software
FoundationApache2.2htdocs
>
> Location of the cpytest folder:
> C:Program FilesApache Software
FoundationApache2.2htdocscpytest
>
>
> contents of .htaccess file:
>
> SetHandler python-program
> PythonHandler cherrypy._cpmodpy::handler
> PythonOption cherrypy.setup cpdeploy::serverless
> PythonDebug On
>
>
> contents of file cpdeploy.py:
> """Deployment script for CherryPy +
Apache (or other front-end)."""
>
> import os
>
> import cherrypy
>
> class Root(object):
>
>     def index(self):
>         return "Hello World!"
>     index.exposed = True
>
> root = Root()
>
>
> def serverless():
>     """Start with no server (for
mod_python or other WSGI HTTP
> servers).
>
>     You can also use this mode interactively:
>         >>> import cpdeploy
>         >>> cpdeploy.serverless()
>     """
>     # Set up site-wide config. Do this first so that,
>     # if something goes wrong, we get a log.
>     cherrypy.config.update({
>         'log.screen': False,
>         'log.error_file':
os.path.join(os.path.dirname(__file__),
> 'site.log'),
>         'environment': 'production',
>         'request.show_tracebacks': False,
>         # Turn off signal handlers when CP does not
control the OS
> process
>         'engine.SIGTERM': None,
>         'engine.SIGHUP': None,
>         })
>     cherrypy.tree.mount(root)
>     try:
>         cherrypy.engine.start(blocking=False)
>     except:
>         cherrypy.log(traceback=True)
>         raise
>
> def serve():
>     """Start with the builtin
server."""
>     # Set up site-wide config. Do this first so that,
>     # if something goes wrong, we get a log.
>     cherrypy.config.update({
>         'log.screen': True,
>         'log.error_file':
os.path.join(os.path.dirname(__file__),
> 'site.log'),
>         'environment': 'production',
>         })
>     cherrypy.tree.mount(root)
>     cherrypy.server.quickstart()
>     cherrypy.engine.start()
>
>
> if __name__ == "__main__":
>     serve()
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-usersgooglegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribegooglegroups.com
For more options, visit this group at h
ttp://groups.google.com/group/cherrypy-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Need help to get cherrypy to work
country flaguser name
United States
2007-11-06 19:24:54
Thank you, I have been able to setup cherrypy behind
mod_proxy
relatively easily by following the instructions on the
website.

Most of the difficulties came from the fact that I never
used
VirtualHosts and mod_proxy in apache before. It was security
related,
but with some research, it worked just fine.


One more question, how hard is it to find an affordable web
hosting
plan for cherrypy websites ?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-usersgooglegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribegooglegroups.com
For more options, visit this group at h
ttp://groups.google.com/group/cherrypy-users?hl=en
-~----------~----~----~----~------~----~------~--~---


[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )