szymek
2006-Apr-08 18:31 UTC
[Rails] Moving my site into production mode - general questions
Hi! I''ve just finished my ror site and i''d like to move it into production mode. Now it runs on linux/apache 1.3/cgi. 1. Can i use fcgi in development mode? I''ve read somewhere that because of caching it causes memory leaks and fcgi shouldn''t generally be used in development. Does plain cgi also causes memory leaks in development mode? 2. Does rails automatically delete its session files? If not how to set up cron to automatically delete session files that are i.e. 24h old? Does rails app with fcgi create any other temporary files that i should take care of? 3. Is there good tutorial about caching in rails? What it is, how to use it, what can/should be cached, when to use it etc. 4. Where to set RAILS_ENV to production mode? Is it ok if i set it in enviroment.rb or should i set it in .htaccess or httpd.conf? I''ve read that it''s not ''clean'' way to set it inside enviroment.rb. Why? 5. What are standard error pages in rails in production mode? How to modify them? 6. Is there anything else that i should watch out for while moving my app into production? Thanks in advance -- Posted via http://www.ruby-forum.com/.
charlie bowman
2006-Apr-08 18:55 UTC
[Rails] Re: Moving my site into production mode - general questions
szymek wrote:> Hi! > > I''ve just finished my ror site and i''d like to move it into production > mode. > Now it runs on linux/apache 1.3/cgi. > > 1. Can i use fcgi in development mode? I''ve read somewhere that because > of caching it causes memory leaks and fcgi shouldn''t generally be used > in development. Does plain cgi also causes memory leaks in development > mode?You shouldn''t have any problems with cgi in development mode because your process die after each request. You can use fcgi in development mode if you want. Just restart your processes often.> > 2. Does rails automatically delete its session files? If not how to set > up cron to automatically delete session files that are i.e. 24h old? > Does rails app with fcgi create any other temporary files that i should > take care of?Rails does not automatically delete any temp/session files.> > 3. Is there good tutorial about caching in rails? What it is, how to use > it, what can/should be cached, when to use it etc.The best tutorial I''ve seen is in the agile web devleopment book> > 4. Where to set RAILS_ENV to production mode? Is it ok if i set it in > enviroment.rb or should i set it in .htaccess or httpd.conf? I''ve read > that it''s not ''clean'' way to set it inside enviroment.rb. Why?I set mine in envrioment.rb> > 5. What are standard error pages in rails in production mode? How to > modify them?You can modify them in your .htaccess or you can actuall modify the error pages in public> > 6. Is there anything else that i should watch out for while moving my > app into production? >Make sure you freeze your version of rails into your vendor folder if you are on shared hosting> Thanks in advancecharlie recentrambles.com -- Posted via http://www.ruby-forum.com/.
szymek
2006-Apr-08 23:10 UTC
[Rails] Re: Moving my site into production mode - general questions
Thanks! Regarding session files: if i don''t use sessions in my site, can i somehow turn if off, so the files won''t be created or rails uses them for something? And what about log file? Should i also delete it or truncate it, if it grows to big, or just leave it? Does it by default log only errors or everything? -- Posted via http://www.ruby-forum.com/.
charlie bowman
2006-Apr-08 23:24 UTC
[Rails] Re: Moving my site into production mode - general questions
szymek wrote:> Thanks! > > Regarding session files: if i don''t use sessions in my site, can i > somehow turn if off, so the files won''t be created or rails uses them > for something? > > And what about log file? Should i also delete it or truncate it, if it > grows to big, or just leave it? Does it by default log only errors or > everything?If you don''t explicitly create a session then there won''t be to worry about. there is a shell script that comes with rails that will clean out your logs. If you freeze rails into your vendor directory, you can find it at vendor/rails/cleanlogs.sh Charlie Bowman www.recentrambles.com -- Posted via http://www.ruby-forum.com/.
Ezra Zygmuntowicz
2006-Apr-08 23:39 UTC
[Rails] Re: Moving my site into production mode - general questions
On Apr 8, 2006, at 4:24 PM, charlie bowman wrote:> szymek wrote: >> Thanks! >> >> Regarding session files: if i don''t use sessions in my site, can i >> somehow turn if off, so the files won''t be created or rails uses them >> for something? >> >> And what about log file? Should i also delete it or truncate it, >> if it >> grows to big, or just leave it? Does it by default log only errors or >> everything? > > If you don''t explicitly create a session then there won''t be to worry > about. there is a shell script that comes with rails that will clean > out your logs. If you freeze rails into your vendor directory, you > can > find it at vendor/rails/cleanlogs.sh > > Charlie Bowman > www.recentrambles.comActually even if your app doesnt ever store anything in the sessions, session files will still be created for every user. To turn off sessions put the following in your application.rb inside the class definition: session :off You can also do conditional sessions like this: session :off, :except => %w{foo bar} OR session :off, :only => %w{foo bar} Cheers- -Ezra
charlie bowman
2006-Apr-09 00:00 UTC
[Rails] Re: Re: Moving my site into production mode - general questi
> You can also do conditional sessions like this: > > session :off, :except => %w{foo bar} > OR > session :off, :only => %w{foo bar} > > Cheers- > -EzraI''m assuming that foo and bar are controlers and that if you had contollers in directorys that your could do session :off, :except => ''admin/private_stuff'' is that correct? -- Posted via http://www.ruby-forum.com/.