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.
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?
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?
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.
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?
What are standard error pages in rails in production mode? How to
modify them?
Is there anything else that i should watch out for while moving my
app into production?
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.
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.
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.
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
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
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
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
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?
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
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
Actually 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: