<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; ">Hey folks,<DIV><BR class="khtml-block-placeholder"></DIV><DIV>I have the following situation: I have a secure server, and I'd like to run multiple Rails apps without dealing with setting up multiple secure servers, with their fixed IPs, etc. So, I want to do <A href="https://secure.domain.com/app1/">https://secure.domain.com/app1/</A> and <A href="https://secure.domain.com/app2/">https://secure.domain.com/app2/</A> etc.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>In lighttpd this is possible using a combination of relative_url_root in each app (in environment.rb), some URL handling in lighttpd.conf, and mod_alias, which maps "/app1" to the public directory for app1, etc, so that stylesheets, images, etc, get served right.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>I'm trying out switching to an Apache/Pound/Mongrel setup (on PlanetArgon's servers). Pound can handle directing to different ports for different URLs, so I can sent /app1/ to port 3000, and /app2/ to port 3010, for example. This works with separate Mongrels running on those different ports, except that Mongrel can't find the stylesheets and other "assets". That is, the app runs fine, but looks awful and has no javascript.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Yesterday as I was setting this up, I managed to get it to work by hacking Mongrel itself. i added a "-u" (--urlroot) flag to mongrel_rails, added a @urlroot variable to the RailsHandler, and added the following lines to change the request path:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>In rails.rb/RailsHandler#process</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN>path_info = path_info[@urlroot.length, <A href="mailto:path_info.length-@urlroot.length">path_info.length-@urlroot.length</A>] unless @urlroot.nil? or path_info[0,@urlroot.length]!=@urlroot</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>and in handlers.rb / DirHandler#process</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN>path_info = request.params[Const::PATH_INFO]</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN>path_info = path_info[urlroot.length,path_info.length-urlroot.length] unless urlroot.nil? or path_info[0,urlroot.length]!=urlroot</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN>req_path = can_serve path_info</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>I imagine there are other places where such a parameter might need to be added to get serving things other than rails apps to work right. I also didn't try to add it to the Windows service binaries.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>So, I guess my question is twofold:</DIV><DIV>1) I'm new to making changes/adding features to open source code. How would I go about lobbying for this feature (if not the code that I wrote) to be included in a release, so that when PlanetArgon updates their gems I can use this feature there?</DIV><DIV>2) Lacking that, how do I create a separate copy of mongrel that uses my changes and ignores the installed gems?</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Thanks!</DIV><DIV>Asa</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR><DIV> <SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><DIV>-----------------</DIV><DIV>Work is love made visible</DIV><DIV>-----------------</DIV><DIV>Asa S. Hopkins</DIV><DIV>MC 266-33, Pasadena, CA 91125</DIV><DIV><A href="mailto:asa@caltech.edu">asa@caltech.edu</A></DIV><DIV><A href="http://www.its.caltech.edu/~asa/">http://www.its.caltech.edu/~asa/</A></DIV><DIV>-----------------</DIV><BR class="Apple-interchange-newline"></SPAN> </DIV><BR></DIV></BODY></HTML>