I''ve just updated a (Debian) server to Rails 0.14.2. It seems the RAILS_ROOT path is being set incorrectly when symlinking to /public (Apache reports it can''t find the production.rb file and the path reported ignores the symlink). If I hard-code the path in config/boot.rb everything works fine. Also, if I remove the symlink and access /public directly instead (in a browser) everything works. Anyone else having issues with symlinked /public directories and apache? Everything works fine under Webrick. -- Jack Baty Fusionary Media - http://www.fusionary.com
I''ve never been able to use symlinks on my Apache installations (redhat es 3). I''ve just used the Alias directive and pointed that to my public folder. Everything''s worked fine. Symlinks actually gave me more problems than I needed. (I had to use RewriteBase = /aliasname in the .htaccess file) That seems to still work for me with the latest version of Rails... -----Original Message----- From: rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Jack Baty Sent: Wednesday, October 26, 2005 10:52 AM To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: [Rails] 0.14.2, symlinks and RAILS_ROOT I''ve just updated a (Debian) server to Rails 0.14.2. It seems the RAILS_ROOT path is being set incorrectly when symlinking to /public (Apache reports it can''t find the production.rb file and the path reported ignores the symlink). If I hard-code the path in config/boot.rb everything works fine. Also, if I remove the symlink and access /public directly instead (in a browser) everything works. Anyone else having issues with symlinked /public directories and apache? Everything works fine under Webrick. -- Jack Baty Fusionary Media - http://www.fusionary.com _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
I''m not sure I exactly get your problem but for apache to follow a symlink you probably need something like this: <Directory "/path/to/directory/containing/symlink"> Options +FollowSymLinks </Directory> There may be other ways and more settings (for security purposes,etc...), but I''m not that well versed with apache settings. -andy On 10/26/05, Jack Baty <jbaty-CJJywlgOJhvqlBn2x/YWAg@public.gmane.org> wrote:> > I''ve just updated a (Debian) server to Rails 0.14.2. It seems the > RAILS_ROOT path is being set incorrectly when symlinking to /public > (Apache reports it can''t find the production.rb file and the path > reported ignores the symlink). If I hard-code the path in > config/boot.rb everything works fine. > > Also, if I remove the symlink and access /public directly instead (in > a browser) everything works. > > Anyone else having issues with symlinked /public directories and > apache? Everything works fine under Webrick. > > -- > Jack Baty > Fusionary Media - http://www.fusionary.com > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Andrew Stone _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Oh yeah...sorry. For debian, that would be placed in the /etc/apache2/sites-available/sitename.conf (if I remember correctly). On 10/26/05, Andrew Stone <stonelists-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > I''m not sure I exactly get your problem but for apache to follow a symlink > you probably need something like this: > > <Directory "/path/to/directory/containing/symlink"> > Options +FollowSymLinks > </Directory> > > There may be other ways and more settings (for security purposes,etc...), > but I''m not that well versed with apache settings. > > -andy > > On 10/26/05, Jack Baty <jbaty-CJJywlgOJhvqlBn2x/YWAg@public.gmane.org> wrote: > > > > I''ve just updated a (Debian) server to Rails 0.14.2. It seems the > > RAILS_ROOT path is being set incorrectly when symlinking to /public > > (Apache reports it can''t find the production.rb file and the path > > reported ignores the symlink). If I hard-code the path in > > config/boot.rb everything works fine. > > > > Also, if I remove the symlink and access /public directly instead (in > > a browser) everything works. > > > > Anyone else having issues with symlinked /public directories and > > apache? Everything works fine under Webrick. > > > > -- > > Jack Baty > > Fusionary Media - http://www.fusionary.com > > _______________________________________________ > > Rails mailing list > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > -- > Andrew Stone-- Andrew Stone _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
On 10/26/05, Andrew Stone <stonelists-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Oh yeah...sorry. For debian, that would be placed in the > /etc/apache2/sites-available/sitename.conf (if I remember > correctly). >I should''ve mentioned that FollowSymLinks is enabled. Symlinks have always worked fine for me on this particular server and others. The same directory/symlink structure was working until I upgraded Rails and the app itself this morning. An earlier version of the app is still running fine right "next to it" on the server (using the pre-0.14 environment.rb) In boot.rb, if I change... root_path = File.join(File.dirname(__FILE__), ''..'') ... to ... root_path = "/sites/mysite/htdocs/alpha" ...everything works. The directory layout looks like this... /sites/mysite/alpha -> htdocs/alpha/public /sites/mysite/htdocs/alpha Apache''s root points to the symlink at /sites/mysite/alpha -- Jack Baty Fusionary Media - http://www.fusionary.com
On Oct 26, 2005, at 11:08 AM, Jack Baty wrote:> On 10/26/05, Andrew Stone <stonelists-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> Oh yeah...sorry. For debian, that would be placed in the >> /etc/apache2/sites-available/sitename.conf (if I remember >> correctly). >> >> > > I should''ve mentioned that FollowSymLinks is enabled. Symlinks have > always worked fine for me on this particular server and others. The > same directory/symlink structure was working until I upgraded Rails > and the app itself this morning. An earlier version of the app is > still running fine right "next to it" on the server (using the > pre-0.14 environment.rb)What happens if you update your boot.rb to the latest version? - Jamis
On 10/26/05, Jamis Buck <jamis-uHoyYlH2B+GakBO8gow8eQ@public.gmane.org> wrote:> > What happens if you update your boot.rb to the latest version?Same thing. I pulled a copy from Revision 2752 which appears to be identical to the one released in 0.14.2. Here''s the relevant Apache error log.... /usr/lib/ruby/gems/1.8/gems/rails-0.14.2/lib/initializer.rb:150:in `read'': No such file or directory - /sites/mysite/config/environments/development.rb (Errno::ENOENT) from /usr/lib/ruby/gems/1.8/gems/rails-0.14.2/lib/initializer.rb:150:in `load_environment'' from /usr/lib/ruby/gems/1.8/gems/rails-0.14.2/lib/initializer.rb:147:in `silence_warnings'' from /usr/lib/ruby/gems/1.8/gems/rails-0.14.2/lib/initializer.rb:147:in `load_environment'' from /usr/lib/ruby/gems/1.8/gems/rails-0.14.2/lib/initializer.rb:73:in `process'' from /usr/lib/ruby/gems/1.8/gems/rails-0.14.2/lib/initializer.rb:36:in `send'' from /usr/lib/ruby/gems/1.8/gems/rails-0.14.2/lib/initializer.rb:36:in `run'' from /sites/mysite/alpha/../config/environment.rb:10 from /sites/mysite/alpha/dispatch.cgi:3:in `require'' from /sites/mysite/alpha/dispatch.cgi:3 Note that the actual path to development.rb is... /sites/mysite/htdocs/alpha/config/environments/development.rb I just tried removing the symlink and replacing it with the "real" directory and browsing to /public. Things work fine that way. I''m kinda stumped. -- Jack Baty Fusionary Media - http://www.fusionary.com