Jruby rails routes proxy_ajp

Hello,
i am trying to use mod_proxy_ajp to route to a tomcat jruby install
located
at /myapp. When doing this

ProxyPass / ajp://localhost:8009/myapp

I get the error "No route matches “/myapp/session/new” with {:method
=>
:get}

I am not sure if there is a cleaner way to route this through AJP (since
this works fine when going to http://localhost:8080/myapp) or if I need
to
tell rails it lives under /myapp/. Any suggestions on how to best
handle
the routing here ?

Thx
Adam

thanks I just set my app to be the default and used

  <Context path="" docBase="myapp" debug="0" reloadable="false">

in the server.xml file

Then in apache just did:

LoadModule proxy_ajp_module modules/mod_proxy_ajp.so

<Proxy balancer://tomcat/>
BalancerMember ajp://localhost:8009 route=myapp

NameVirtualHost *:80
<VirtualHost *:80>
ServerName myapp.com
ProxyPass / balancer://tomcat/
ProxyPassReverse / balancer://tomcat/

Thanks for the help
Adam

On Wed, Jun 25, 2008 at 11:45 PM, AD [email protected] wrote:

Hello,
i am trying to use mod_proxy_ajp to route to a tomcat jruby install located
at /myapp. When doing this
ProxyPass / ajp://localhost:8009/myapp
I get the error "No route matches “/myapp/session/new” with {:method =>
:get}
I am not sure if there is a cleaner way to route this through AJP (since
this works fine when going to http://localhost:8080/myapp) or if I need to
tell rails it lives under /myapp/. Any suggestions on how to best handle
the routing here ?

I haven’t done any ajp-based mounting of Rails apps yet. Rails has
this environment variable ENV[‘RAILS_RELATIVE_URL_ROOT’] which is used
for situations like this. JRuby-Rack sets this up for you based on the
value of HttpServletRequest.getContextRoot, but maybe for some reason
that value is not getting transmitted properly with AJP? You could
play around with it by doing something like this in your
environment.rb:

ActionController::Dispatcher.before_dispatch do
puts “Before: #{ENV[‘RAILS_RELATIVE_URL_ROOT’]}”
ENV[‘RAILS_RELATIVE_URL_ROOT’] = “/myapp” # play around with other
values here
end

/Nick


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email