[Mongrel] Apache+Mongrel Redirection Problems

Stan Baptista stan.baptista at gmail.com
Thu Feb 8 16:15:36 EST 2007


 >that can't work, because the client (the browser) needs to send a
correct Host header for Apache to know which virtual host definition to
use. Usually the value for that host header is taken from the location
the user entered into the location bar. If possible you should get some
admin to create dns records for these host names pointing to your IP, so
that everyone can use these host names to access your apps.

I got this working as follows:

/etc/hosts:

# Do not remove the following line, or various programs
>
> # that require network functionality will fail.127.0.0.1    localhost.localdomain   localhost       egovm0410.4.1.84    rss10.4.1.84    railstest
>
> /usr/local/apache22/conf/httpd.conf:

   NameVirtualHost 10.4.1.84
>
>    <VirtualHost 10.4.1.84>
>
>      RewriteEngine on
>      RewriteRule ^/rss(.*) http://10.4.1.84:5432$1 [P]
>      RewriteRule ^/railstest(.*) http://10.4.1.84:8021$1 [P]
>
>    </VirtualHost>
>
>    <VirtualHost 10.4.1.84>
>
>      ServerName rss
>      ProxyPass / http://10.4.1.84:5432/
>      ProxyPassReverse /rss http://10.4.1.84:5432/
>      ProxyPreserveHost on
>
>    </VirtualHost>
>
>    <VirtualHost 10.4.1.84>
>
>      ServerName railstest
>      ProxyPass / http://10.4.1.84:8021/
>      ProxyPassReverse /railstest http://10.4.1.84:8021/
>      ProxyPreserveHost on
>
>    </VirtualHost>
>
>
Note that three VirtualHost directives are required. The first (default) is
to create the rewrite rules and the next two contain the ProxyPass...
directives that map to the Mongrel servers.

Issues

Typing this in the browser:

  http://egovm04.higov.net/rss/about
>
>
Correctly accesses the about page, but the address in the browser shows
this:

  http://egovm04.higov.net/about
>
> Link mappings within the browser do not work correctly (most likely not an
Apache problem.)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20070208/7be708cd/attachment.html 


More information about the Mongrel-users mailing list