For some strange reason, I seem to generate a new session file every time I touch my website. That wouldn''t be so bad, except they''re piling up in /tmp, and making a huge mess. What is the best way to change the directory that Rails uses for session files and CGI uploads? -- Steve
On Thu, 2005-06-02 at 12:56 -0700, Steve Sloan wrote:> For some strange reason, I seem to generate a new session file every time I touch my website. That wouldn''t be so bad, except > they''re piling up in /tmp, and making a huge mess. > > What is the best way to change the directory that Rails uses for session files and CGI uploads?If you''re still running in pure CGI, you might want to try FastCGI. Having said that, once you do (and you will like the results...) try this in your apache conf. <IfModule mod_fastcgi.c> FastCgiIpcDir /tmp/fcgi_ipc/ <---- set tmp dir for fcgi AddHandler fastcgi-script .fcgi </IfModule> -- /****************************************************** * Robby Russell, Owner.Developer.Geek * PLANET ARGON, Open Source Solutions & Web Hosting * Portland, Oregon | p: 503.351.4730 | f: 815.642.4068 * www.planetargon.com | www.robbyonrails.com *******************************************************/
Robby Russell wrote:> On Thu, 2005-06-02 at 12:56 -0700, Steve Sloan wrote: > >>For some strange reason, I seem to generate a new session file every time I touch my website. That wouldn''t be so bad, except >>they''re piling up in /tmp, and making a huge mess. >> >>What is the best way to change the directory that Rails uses for session files and CGI uploads?> If you''re still running in pure CGI, you might want to try FastCGI.I''m already using FCGI (and it is pretty sweet).> Having said that, once you do (and you will like the results...) try > this in your apache conf.Already have: FastCgiIpcDir /tmp/.fcgi_ipc/ But that only controls where to store the sockets for communication between Apache and FCGI process. From my investigation, I suspect I need to change something in CGI::Session::PStore (or use a different session class), but no amount of grepping will reveal what to change or where. -- Steve
On Thu, 2005-06-02 at 12:56 -0700, Steve Sloan wrote:> For some strange reason, I seem to generate a new session file every time I touch my website. That wouldn''t be so bad, except > they''re piling up in /tmp, and making a huge mess. > > What is the best way to change the directory that Rails uses for session files and CGI uploads? > > -- SteveDepending on your OS, you may want to figure out how to have that directory cleaned out automatically every so often. For example, under FreeBSD you can add the first, or both lines to /etc/periodic.conf: daily_clean_tmps_enable="YES" daily_clean_tmps_verbose="YES"
On Jun 2, 2005, at 1:15 PM, Steve Sloan wrote:> From my investigation, I suspect I need to change something in > CGI::Session::PStore (or use a different session class), but no amount > of grepping will reveal what to change or where.Page 307 in the new Rails book... Add this to environment.rb: ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS[:tmpdir] = "/some/other/path/to/tmp" :tmpdir is used by FileStore and PStore session managers. Zach
Zach Thompson wrote:> Page 307 in the new Rails book... Add this to environment.rb: > > ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS[:tmpdir] = > "/some/other/path/to/tmp" > > :tmpdir is used by FileStore and PStore session managers.Perfect, that''s just what I wanted, thanks. -- Steve