Hi, where can I find documentation on setting up a Twisted Web server behind Apache? I googled a bit, but I didn't find anything official / suggested. Regards, -- Michal Pasternak :: http://pasternak.w.lub.pl :: http://winsrc.sf.net
On Wed, 2003-12-17 at 00:29, Michal Pasternak wrote:
where can I find documentation on setting up a Twisted Web server behind Apache? I googled a bit, but I didn't find anything official / suggested.
I was doing this for a while, way back when I was too chicken to just actually run Twisted.Web ;) I set up Twisted.Web to run on port 8088, then used Apache's mod_rewrite and mod_proxy to say, "If any requests come in for /foo/(.*), rewrite this to http://myserver:8088/$1". I can't remember the exact syntax for the rewrite rules, but it only took a couple lines. You use the internal proxy, so for the user, the fact that you've got two web servers is totally transparent. Hope this helps. -- Alex Levy WWW: http://mesozoic.geecs.org "Never let your sense of morals prevent you from doing what is right." -- Salvor Hardin, Isaac Asimov's _Foundation_
On Thu, 2003-12-18 at 01:32, Alex Levy wrote:
On Wed, 2003-12-17 at 00:29, Michal Pasternak wrote:
where can I find documentation on setting up a Twisted Web server behind Apache? I googled a bit, but I didn't find anything official / suggested.
I was doing this for a while, way back when I was too chicken to just actually run Twisted.Web ;)
Conversely, if you want to run Apache behind a Twisted Web server (maybe you want fast PHP, or you are serving Subversion or something), do this: * Set up Apache to run on a port that is not 80, say 81. * Configure Twisted Web to ignore the RPY extension * ignoreExt('rpy') in /etc/twisted-web/default the debian package * --ignore-ext=rpy when using mktap web. * Drop in an RPY, say foo.rpy, somewhat akin to: from twisted.web import proxy resource = proxy.ReverseProxyResource('hostname', 81, '/url/on/apache/') [note that there are many ways to get a resource into a twisted web server, RPY is often a convenient one] http://hostname/foo/bar/baz now transparently proxies to http://hostname:81/url/on/apache/bar/baz, completely hiding your apache server. Not relevant, probably documented elsewhere, but I feel good about writing it down. jml
participants (3)
-
Alex Levy
-
Jonathan Lange
-
Michal Pasternak