[Twisted-web] Twisted Web behind Apache
Jonathan Lange
twisted-web@twistedmatrix.com
Fri, 19 Dec 2003 00:04:00 +1100
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