I followed these instructions to deploy my rails app to a suburi:
http://www.modrails.com/documentation/Users%20guide%20Apache.html#deploying_rails_to_sub_uri
On Dec. 23 my application was deployed under a suburi and working fine. When I tried it on dec. 26 I noticed that url helpers like stylesheet_link_tag were no longer using the RackBaseURI. So instead of requesting //myapp.com/suburi/app/assets/application.css my browser was requesting //myapp.com/assets/application.css Of course that’s a 404. I looked at all my logs from both the app and apache, and didn’t see anything suspicious.
Restarting apache made the suburi suddenly start working again.
Here is my vhost.conf https://gist.github.com/4382822
Anyone have any ideas what I might be doing wrong?
So I finally figured this out. The problem was that if you have a passenger app set to use a sub-uri like http://local-webservice.localhost/sub/uri/route, but the first request after restart hits the app via the root like http://local-webservice.localhost/route then passenger will essentially throw away your sub-uri configuration until you restart the app.
The solution to this was given to me in the passenger google group, but i’m including it here in the hopes it helps somebody else. Here is the answer i got there: