Deployment: Segregating static files from RHTML

All,

I am deploying on a production system using Apache/fastcgi.

I would like Apache to take care of all of my static files and
dispatch.fcgi to take care of all of my Ruby templates.

In order to achieve this separation, do I need to set up two vhosts in
Apache, one to serve static content and one to serve dynamic content?

Has anyone done this in production and can point me to the right
approach?

Thanks,
Wes

Would mod_proxy - setting up Apache as a reverse proxy - be involved?

Wes G. wrote:

All,

I am deploying on a production system using Apache/fastcgi.

I would like Apache to take care of all of my static files and
dispatch.fcgi to take care of all of my Ruby templates.

In order to achieve this separation, do I need to set up two vhosts in
Apache, one to serve static content and one to serve dynamic content?

No, Rails set up to run under FastCGI with Apache should do exactly what
you want - Apache should serve static files from the public directory,
and Rails should only be involved when there isn’t a static file for a
given URL. That’s also how Rails caching works - a cached page appears
as a static file in the public directory, so can be served by Apache
without touching Rails.

regards

Justin

Justin,

Thanks - I realized a few hours after I posted this that my .htaccess
file was handling the segregation just fine.

Wes

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs