I was asked to publish whole startup script and I could do, so go fetch it from http://nhw.pl/download/railsapp.sh and customize it a bit.
- /RAILS/APP/ROOT – it is directory where Rails application root is
- PORT – port on which You want to run application (default 3000)
- LOW_PRIV_UID – UID (numeric) of user who will be owning process (if You skip it UID will be root! so do not skip this part :) )
- Add railsapp_enable=”YES” to
/etc/rc.conf
With Webrick in current Rails (1.1.6) this script wont work – to give possibility of changing UID of Webrick process during its startup You have to apply my patch – http://dev.rubyonrails.org/ticket/5788