[Locomotive-users] Locomotive and Apache?

Ryan Raaum ryan.raaum at gmail.com
Mon Jan 22 14:05:46 GMT 2007


On 1/20/07, Rich Morin <rdm at cfcl.com> wrote:
>
> At 5:11 PM -0700 1/6/07, Grant Neufeld wrote:
> > At 2:47 PM -0800 1/6/07, Rich Morin wrote:
> >>Now I'm looking into adding Locomotive to the mix.
> > ...
> >>I'll be needing to tie Rails into the existing Apache setup.
> >
> > Here's a (kind of) quick and dirty way (no software installs/builds
> > except your existing apache, Locomotive and a simple StartupItem).
> > ...
>
> I've been playing with this, quite successfully in general, but I'm
> getting some undesirable behavior.  What I'm trying to do is map a
> virtual host to different servers, based on the requested URL:
>
> <VirtualHost *:80>
>   ServerName       hack.cfcl.com
>   ServerAdmin      rdm at cfcl.com
>   ErrorLog         /dev/null
>   CustomLog        /dev/null common
>   ProxyRequests    Off
>   ProxyPass        /play  http://192.168.1.205:3000
>   ProxyPassReverse /play  http://192.168.1.205:3000
>   ProxyPass        /      http://192.168.1.205/hack
>   ProxyPassReverse /      http://192.168.1.205/hack
> </VirtualHost>
>
> This resolves URLS as follows:
>
>   http://hack.cfcl.com/
>
>     maps to port 80 (Apache) and the "hack" directory
>
>   http://hack.cfcl.com/play/monkeys/list
>
>     maps to port 3000 (Locomotive)
>
> The "undesirable behavior" is that the "Address" line in my web
> browser is displaying "http://cerberus.cfcl.com/hack/" in the
> first (Apache) case.  I'd much prefer that it just show the URL
> as entered.  Help?


I think you're looking for ProxyPreserveHost, check out the mod_proxy docs:
http://httpd.apache.org/docs/2.0/mod/mod_proxy.html

However, I think that directive may not be available in apache 1.3, so you
may have to go to 2.0 to get that behavior...

Best,

-r

-r
> --
> http://www.cfcl.com/rdm            Rich Morin
> http://www.cfcl.com/rdm/resume     rdm at cfcl.com
> http://www.cfcl.com/rdm/weblog     +1 650-873-7841
>
> Technical editing and writing, programming, and web development
> _______________________________________________
> Locomotive-users mailing list
> Locomotive-users at lists.raaum.org
> http://lists.raaum.org/mailman/listinfo/locomotive-users
>



-- 
Ryan Raaum
http://raaum.org
http://rails.raaum.org -- Rails docs
http://locomotive.raaum.org -- Self contained Rails for Mac OS X
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://one.textdrive.com/pipermail/locomotive-users/attachments/20070122/a3aa8257/attachment.htm


More information about the Locomotive-users mailing list