[Mongrel] Apache+Mongrel Redirection Problems

Stan Baptista stan.baptista at gmail.com
Wed Feb 7 13:53:47 EST 2007


Hi folks,

Newbie issues...I'm prototying an Apache/Mongrel configuration setup
as follows:

* Two Mongrel servers each serving a Rails application.
* Apache front-end.
* Linux system (CentOS)
* The plan is to create two virtual hosts.

/ETC/HOSTS LOOKS LIKE THIS:

# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1       localhost.localdomain   localhost       egovm04
10.4.1.84       rss
10.4.1.84       railstest

HTTPD.CONF LOOKS LIKE THIS:

[snip]

NameVirtualHost 10.4.1.84

<VirtualHost rss>
    ServerName rss
    ServerAlias rss

    RewriteEngine on
    RewriteRule ^/rss(.*) http://10.4.1.84:5432$1 <http://10.4.1.84:5432/>[P]

    ProxyPass / http://10.4.1.84:5432/
    ProxyPassReverse / http://10.4.1.84:5432/

</VirtualHost>

<VirtualHost railstest>

    ServerName railstest
    ServerAlias railstest

    RewriteEngine on
    RewriteRule ^/railstest(.*)
http://10.4.1.84:8021$1<http://10.4.1.84:8021/>[P]

    ProxyPass / http://10.4.1.84:8021/
    ProxyPassReverse / http://10.4.1.84:8021/

</VirtualHost>

ISSUES

1. App 1 (rss) URL rewrite problem.

Typing 'http://10.4.1.84/rss' <http://10.4.1.84/rss%27> in the browser
correctly accesses app #1
(rss), HOWEVER...

This: 'http://10.4.1.84/rss/about' <http://10.4.1.84/rss/about%27> finds the
right page, but the URL
is rewritten to this: 'http://10.4.1.84/about' <http://10.4.1.84/about%27>

2. App # 2 not found.

Typing this: 'http://10.4.1.84/railstest'
<http://10.4.1.84/railstest%27>yields this:

Routing Error
Recognition failed for "/railstest"

This is a Rails message reported by app # 1( rss). So the (Apache)
server is not redirecting to the second Virtual Host (railstest).

Sorry for the question, I'm quite sure this is a setup problem on my
part.

Thanks,
Stan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20070207/ff145793/attachment-0001.html 


More information about the Mongrel-users mailing list