[Twisted-web] NameVirtualHost

Matt Goodall matt at pollenation.net
Mon Jun 21 16:03:31 MDT 2004


On Sat, 2004-06-19 at 18:39 -0700, Alex Newby wrote:
> Hi,
> 
> I'm a stumped newbie. I've adapted the moin_twisted.py script for
> MoinMoin on localhost on WinXP Python2.3.3 to use the Nevow vhost module
> instead of from twisted.web, and from twisted.application import
> internet, service and replaced the call to app.Application as follows. 
> 
> #application = app.Application("web")
> #application.listenTCP(httpd_port, site, interface=httpd_host)
> 
> application = service.Application('web')
> sc = service.IServiceCollection(application)
> site = server.Site(root)
> i = internet.TCPServer(8001, site)
> i.setServiceParent(sc)

You need to use nevow.appserver.NevowSite instead of twisted.web.server.

Cheers, Matt

> 
> I am using mod_rewrite behind apache. Twisted handles localhost requests
> passed from Apache for 127.0.0.2, 127.0.0.3 no problem, but the remote
> server gives the error.
> 
> /usr/local/lib/python2.3/site-packages/twisted/web/resource.py, line 59
> in getChildForRequest
> 57def getChildForRequest(resource, request):
> 58  """Traverse resource tree to find who will handle the request."""
> 59  while request.postpath and not resource.isLeaf:
> 60    pathElement = request.postpath.pop(0)
>  
> exceptions.AttributeError: 'NameVirtualHost' object has no attribute
> 'isLeaf'
> ---------------------------------
> Sincerely,
> 
> Alex Newby 
> E-mail: alex at alexnewby.com
> Website: http://www.alexnewby.com
> 
> 
> _______________________________________________
> Twisted-web mailing list
> Twisted-web at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web
-- 
     __
    /  \__     Matt Goodall, Pollenation Internet Ltd
    \__/  \    w: http://www.pollenation.net
  __/  \__/    e: matt at pollenation.net
 /  \__/  \    t: +44 (0)113 2252500
 \__/  \__/
 /  \          Any views expressed are my own and do not necessarily
 \__/          reflect the views of my employer.




More information about the Twisted-web mailing list