Hey all, Sorry to spam a personal help message, but I'm tearing my hair out here. I've previously done all my development with webbrick and deployed on TextDrive where all the hard work was pretty much done for me. Today, however, I need to deploy on one of our servers. I've got Apache2 and SCGI installed, finally, and the app is running. It correctly serves up content from the controllers. The problem is that requests for the static files (/images/*, /stylesheets/*, etc) aren't working. If I try to go to http://127.0.0.1/stylesheets/ I get the following: Routing Error Recognition failed for "/stylesheets/" Again, this works fine under webbrick, so I would think it is an Apache config problem. However, the error message itself looks like its coming from the Rails router, implying a problem with my routes config. Is there something I need to tell SCGI, Rails, or Apache to help find my public folder? (I set the document root in the Apache http.conf) Any advice? I appreciate it. -Jeff
on 2005-11-29 18:59
on 2005-11-29 19:39
On 11/29/05, Jeff Casimir <firstname.lastname@example.org> wrote: > It correctly serves up content from the controllers. The problem is > there something I need to tell SCGI, Rails, or Apache to help find my > public folder? (I set the document root in the Apache http.conf) > > Any advice? I appreciate it. > You need to add some directives to to Apache's httpd.conf file to tell it not to send requests for static files through SCGI, but to serve those up directly. The exact specification depends on your application. Instant Rails has a page describing how to do this for Typo (you can probably adapt this for your own use): http://instantrails.rubyforge.org/wiki/wiki.pl?Ins... Curt
on 2005-11-29 20:48
Is the document root for the web application in the Apache config, the public folder under your app directory? John
on 2005-11-29 22:54
Jeff, I'm not familiar with scgi yet but i solved it as follows. My railsapp 'root' is one level higher then my apache docroot and have symlinks as shown below: depot -> ../depot/public/ images -> ../depot/public/images/ index.html robots.txt stylesheets -> ../depot/public/stylesheets/ This results in urls looking like: http://www.example.com/depot/store In the apache2 conf you add the "FollowSymLinks" as shown here. DocumentRoot /home/.../htdocs <Directory /home/.../htdocs> Options ExecCGI FollowSymLinks AllowOverride All Allow from all Order allow,deny </Directory> There can be a security 'issue', when people have shell access to your system. (I'm running vhosts in a chrooted env). If so, they can create symlinks to anywhere om your system, and are able access it. If not, there's no hazard. Setting the config specs for scgi should do the trick. My next challenge is setting up scgi (thanx for the tip .. :-). Regards, Gerard. On Tuesday 29 November 2005 18:58, Jeff Casimir tried to type something like: > that requests for the static files (/images/*, /stylesheets/*, etc) > public folder? (I set the document root in the Apache http.conf) > > Any advice? I appreciate it. > > -Jeff > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails -- "Who cares if it doesn't do anything? It was made with our new Triple-Iso-Bifurcated-Krypton-Gate-MOS process ..." My $Grtz =~ Gerard; ~ :wq!