<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jan 23, 2013 at 4:10 PM, Craig Latta <span dir="ltr">&lt;<a href="mailto:craig@netjam.org" target="_blank">craig@netjam.org</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><br>
Hi Chris--<br>
<br>
     Off your off-topic topic, but... did you consider using FastCGI (or<br>
whatever) to hand off the request to an already-running Smalltalk, and<br>
use Smalltalk to start the requested image, instead of either Perl or<br>
Python?</blockquote><div><br></div><div>If I understand correctly, Chris wants to use mod_rewrite&#39;s &lt;RewriteMap&gt; with the &#39;prg&#39; option[1]. That runs the specified binary/script and communicates with it over stdin/stdout. There&#39;s no way to get it to use the FastCGI protocol[2]. </div>
<div><br></div><div>However, mod_rewrite doesn&#39;t run the rewrite program for each request like a CGI. It invokes it once, and sends it urls on stdin as requests come in. So it might be possible prepare an image that starts a rewrite server on startup. The tricky bit is synchronization[3].<br>
</div><div><br></div><div>For DabbleDB we wrote a ruby program to do this—each server had a few thousand images, each configured to run Seaside on a particular port. When a request came in for that image, the ruby program would look up the port, see if the image was running, and if not, start it, then rewrite the request URL so that it would get proxied through to the image. The images would automatically shut down if they didn&#39;t receive any requests for a while. </div>
<div><br></div><div>[1] See <a href="https://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewritemap">https://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewritemap</a></div><div>[2] Short of writing an Apache module to do it</div>
<div>[3] Note the &quot;But be very careful:&quot; section at the bottom of [1]</div><div><br></div><div>Colin</div></div></div></div>