separate sites and server
![](https://secure.gravatar.com/avatar/16922df7c2459acc73113a6f34d3e84e.jpg?s=120&d=mm&r=g)
Hi! Is there a way to create separate NevowSites and then 'register'/'unregister' them in a running Twisted application? My goal is to make possible to many users to run and restart their sites separately without stopping the whole system (all the apps). Note that virtual hosts mechanism is used to select the desired app. Any experiences or solutions? Regards, -- Bartek Bargiel
![](https://secure.gravatar.com/avatar/15fa47f2847592672210af8a25cd1f34.jpg?s=120&d=mm&r=g)
On Sep 10, 2004, at 8:34 PM, Bartek Bargiel wrote:
Is there a way to create separate NevowSites and then 'register'/'unregister' them in a running Twisted application?
My goal is to make possible to many users to run and restart their sites separately without stopping the whole system (all the apps). Note that virtual hosts mechanism is used to select the desired app.
Allowing users to run arbitrary python code in your main server is not generally a good idea. Generally the best way to do this is to have them run separate servers under their user account and proxy requests from the main server to the sub-servers. The t.web.distrib module is designed for this. On twistedmatrix.com, the bugtracker is run this way: <http://www.twistedmatrix.com/users/roundup.twistd/>. All the /users/*.twistd entries are connecting to another server process. I have no experience with using distrib with Nevow -- it may or may not work. This issue of mostly compatible, but slightly different interfaces between twisted.web and Nevow is something that we hope to solve soon. James
![](https://secure.gravatar.com/avatar/16922df7c2459acc73113a6f34d3e84e.jpg?s=120&d=mm&r=g)
Well, actually you're right. That was actually the simplest solution I was thinking about. But had no idea about twisted.web.distrib. I'll take a look at it and report results :-) regards, -- Bartek Bargiel
![](https://secure.gravatar.com/avatar/3bef09da3292c944649ffc28673df870.jpg?s=120&d=mm&r=g)
On Fri, Sep 10, 2004, James Y Knight wrote:
I have no experience with using distrib with Nevow -- it may or may not work. This issue of mostly compatible, but slightly different interfaces between twisted.web and Nevow is something that we hope to solve soon.
My experience as of about three months ago is that distrib does not work with Nevow, although you can get it to fail in amusingly different ways. It was something to do with flatten doing the wrong thing. This *may* be only in combination with vhosts, but perhaps not. I have been using twisted.web.proxy to do something similar, but it has a few flaws: - it only works over TCP so your users will need to open a port - it doesn't set the right forward headers for Nevow, so all of Nevow's "what is my hostname?" stuff will return "localhost" (in particular, this is a problem with Nevow's static.File, which likes to add a trailing / to directories and will do this by redirecting to... localhost) To overcome the second problem, I've ended up having to hard-code my Nevow application's hostname pending a better proxy framework. -Mary
![](https://secure.gravatar.com/avatar/15fa47f2847592672210af8a25cd1f34.jpg?s=120&d=mm&r=g)
On Sep 13, 2004, at 6:55 AM, Mary Gardiner wrote:
- it doesn't set the right forward headers for Nevow, so all of Nevow's "what is my hostname?" stuff will return "localhost" (in particular, this is a problem with Nevow's static.File, which likes to add a trailing / to directories and will do this by redirecting to... localhost)
To overcome the second problem, I've ended up having to hard-code my Nevow application's hostname pending a better proxy framework.
You're supposed to use VHostMonster to solve this. It mutates the effective host of the request for just this reason. James
participants (3)
-
Bartek Bargiel
-
James Y Knight
-
Mary Gardiner