Mongrel/WEBrick Forwarding in Apache

Posted by hardwarehank, Tue Jun 13 22:55:48 UTC 2006

This will let you redirect an apache request to a local mongrel or webrick server. Very handy, yet maybe some logging of the used ports would be good at some point.


<VirtualHost collaboa.example.com:80>
  Servername collaboa.example.com
  CustomLog /www/collaboa/logs/access.log combined
  ErrorLog  /www/collaboa/logs/error.log
        ProxyPass / http://127.0.0.1:3005/
        ProxyPassReverse / http://127.0.0.1:3005/
</VirtualHost>

Tags:

Comments

  • no avatar available for bryce bryce
    July 16, 2006 @ 03:32 AM
    I tried using this for a public-facing server (which is probably a huge mistake in its own right). I ran into two major issues. First, you have to remember to have mod_proxy running on your server. Second, to define permissions, you have to add a directive like: <proxy /> Order allow,deny allow from all </proxy> At least, that did it for me. Without that directive, you'll get nothing but 403 forbiddens, which can only entertain you for so long.
  • no avatar available for bryce bryce
    July 16, 2006 @ 03:33 AM
    <Proxy http://127.0.0.1:3000> Order allow,deny allow from all </Proxy> Sorry. Should have previewed.
  • no avatar available for Andy Andy
    August 10, 2006 @ 09:07 AM
    I searched hours and hours to find a solution for my apache2, suse 9.3, plesk VPS. I matched tons of tutorials how to build this with lighttpd or from the bottom of a new installation. So this saved me and i want to thank you a lot :) P.S. for some reasons i don“t know, my rails - mongrel - apache - proxy works without that directive. I have mod_proxy installed but no directive. Do you have any suggestions why this works also ? best wishes Andy
  • photo of Hank Hank
    August 10, 2006 @ 09:33 AM
    Andy, What directive do you mean?

Have your say

A name is required. You may use Markdown in your comments.