On Sep 22, 2005, at 9:38 AM, Warner Onstine wrote:
> So I''m getting ready to setup a production environment on my boxen
> (running Fedora Core 3), what are my options? I''ve seen a number
of
> posts about FastCGI, SCGI, etc. and am completely lost as to what I
> should be setting up on my box (that I hopefully won''t have to
> touch for a while).
>
> I need to run Collaboa, Typo and probably 3 or 4 other apps on
> this, so what''s my best solution?
>
> -warner
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
Go with lighttpd/fcgi for now. SCGI is probably going to be
really nice and easy to use but isn''t quite ready for production IMHO
(will be very soon). Here are my crib notes for installing the entire
Ruby/Gems/Rails/Lighttpd/FCGI/PHP-FCGI stack from source on OSX,
Linux and BSD. Hope this helps you. Let me know if you need a good
lighttpd.conf file and Icna send that as well.
------------------------------------------------------------------------
---------------------------------------------
Install the complete Ruby on Rails and Lighttpd/fastcgi/php Stack
from source with the fastcgi dev kit and the pcre''s. This has been
tested on RHEL4, Debian Sarge, Ubuntu and OSX. It should work on most
Linux Distro''s and probably BSD as well(not tested)
__________________________________________________ ______________
Get Ruby1.8.2
wget http://rubyforge.org/frs/download.php/2338/ruby-1.8.2.tar.gz
tar xvzf ruby-*
cd ruby-1.8.2
./configure
make
make test
sudo make install
__________________________________________________ ______________
Get Ruby gems
wget http://rubyforge.org/frs/download.php/3700/rubygems-0.8.10.tgz
tar xvzf rubygems*
cd rubygems*
sudo ruby setup.rb
__________________________________________________ ______________
Get Rails and a few other gems
sudo gem install rails RedCloth search_generator
salted_login_generator production_log_analyzer
answer yes to all dependencies
__________________________________________________ ______________
Get mysql-ruby C bindings (the pure ruby ones suck)
wget http://www.tmtm.org/en/mysql/ruby/mysql-ruby-2.7.tar.gz
tar zxvf mysql-ruby-*
cd mysql-ruby-*
ruby extconf.rb --with-mysql-config
make
sudo make install
__________________________________________________ ______________
download fastcgi developers kit
wget http://fastcgi.com/dist/fcgi.tar.gz
tar xvzf fcgi-2.4.0.tar.gz
cd fcgi*
./configure
make
sudo make install
__________________________________________________ ______________
Get the new non memory leaking ruby-fastcgi bindings
wget http://sugi.nemui.org/pub/ruby/fcgi/ruby-fcgi-0.8.6.tar.gz
tar xzvf ruby-fcgi*
ruby install.rb config --without-ext
ruby install.rb setup
sudo ruby install.rb install
__________________________________________________ ______________
We need the correct pcre .so’s for lighttpd to work correctly
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/
pcre-5.0.tar.gz
tar xzvf pcre-5.0.tar.gz
cd pcre-*
./configure
make
sudo make install
__________________________________________________ ______________
Get lighttpd
I''m using 1.3.16 in production on http://yakimaherald.com
and serving 55,000 dynamic rails pages a day. But you might want
to use 1.4.4
wget http://www.lighttpd.net/download/lighttpd-1.3.16.tar.gz
tar xzvf lighttpd-1.3.16.tar.gz
cd lighttpd-*
./configure
make
sudo make install
__________________________________________________ ______________
Compile php as a fast-cgi binary The main thing here is the following
configure options. You can add whatever else you like to your php
binary but these are needed for fast-cgi support.
$ ./configure \
--enable-fastcgi \
--enable-discard-path \
--enable-force-cgi-redirect \
__________________________________________________ ______________
Lighttpd Launcher Script
Here is a link for a sweet enhancement. Put this script in your
RAILS_ROOT/script folder and put the lighttpd.conf file in RAILS_ROOT/
config. Now you can launch your rails app by cd’ing into your
RAILS_ROOT for your app and typing:
$ruby script/lighty -p 7500 -e development (or whatever port & env
you want to use)
Now you can hit http://localhost:7500/ and you will get your app
running on lighttpd no muss no fuss. Very sweet for development. Here
is the link: http://www.bigbold.com/snippets/posts/show/303 . Name
the first ruby script lighty and name the config file lighttpd.conf.
Now every time you start your app this way is creates a new
lighttpd.conf in /tmp and starts lighttpd up with that file. This way
you can give it command line options as to what port to bind to and
others. I’m using this for development and it is sweet!
-Ezra Zygmuntowicz
Yakima Herald-Republic
WebMaster
http://yakimaherald.com
509-577-7732
ezra-gdxLOakOTQ9oetBuM9ipNAC/G2K4zDHf@public.gmane.org