Ruby, Ruby Gems, Rails and FastCGI Installation
Posted by Miraenda Sun, 04 Jun 2006 04:34:00 GMT
A. Install Ruby (latest source package - http://ruby-lang.org/en/20020102.html):
mkdir /root/setup
cd /root/setup && wget ftp.ruby-lang.org/pub/ruby/ruby-1.8.4.tar.gz
tar -xvzf ruby-*
cd ruby-*
./configure && make && make install
B. Install Ruby Gems (latest version - http://rubyforge.org/frs/?group_id=126):
cd /root/setup && wget rubyforge.org/frs/download.php/5207/rubygems-0.8.11.tgz
tar -xvzf rubygems-*
cd rubygems-*
ruby setup.rb
C. Install Rails:
gem install rails
(Answer y to all the dependancies)
D. Install FCGI and FastCGI (sourced from http://fastcgi.com/dist/):
cd /root/setup && wget fastcgi.com/dist/fcgi-2.4.0.tar.gz
tar -xvzf fcgi-2.4.0.tar.gz
cd fcgi-2.4.0
./configure && make && make install
cd /root/setup && wget fastcgi.com/dist/mod_fastcgi-2.4.2.tar.gz
tar -xvzf mod_fastcgi-*
cd mod_fastcgi-*
/usr/local/apache/bin/apxs -o mod_fastcgi.so -c *.c
/usr/local/apache/bin/apxs -i -a -n fastcgi mod_fastcgi.so
E. Install Ruby Gems fcgi:
gem install fcgi
F. Edit Apache config file:
vi /etc/httpd/conf/httpd.conf
Find the following (usually I do esc + / and enter SSLL to find this area in httpd.conf file):
SSLLog /usr/local/apache/logs/ssl_engine_log SSLLogLevel info </IfModule>
Enter these lines under the ending </IfModule> line:
<IfModule mod_fastcgi.c>
FastCgiIpcDir /tmp/fcgi_ipc/
AddHandler fastcgi-script .fcgi
</IfModule>
Check for the fastcgi apache module entries:
LoadModule fastcgi_module libexec/mod_fastcgi.so
and
AddModule mod_fastcgi.c
G. Make the /tmp/fcgi_ipc/ directory and setup Apache permissions for it:
mkdir -p /tmp/fcgi_ipc
chown nobody:nobody /tmp/fcgi_ipc -R
chmod -755 /tmp/fcgi_ipc -R
H. Install MySQL for Ruby:
gem install mysql
Select option 3 for the installation process.
I. Install PostGRESQL for Ruby (if you have PostGRESQL on your cPanel Dedicated server):
gem install postgres
J. Restart Apache:
/etc/init.d/httpd stop
killall -9 httpd
/etc/init.d/httpd startssl
K. Additional Information:
Please note that user and appname should be replaced by the specific account's cPanel username and the application folder name you want to use for your Rails' application.
a. Make sure Apache can find dispatch.fcgi
Edit your Rails application’s /home/user/appname/public/.htaccess and change the following lines to make sure that the Rails app is using FastCGI.
Change:
RewriteRule ^(.*)$ dispatch.cgi?$1 [QSA,L]
to
RewriteRule ^(.*)$ dispatch.fcgi?$1 [QSA,L]
b. Make sure that dispatch.fcgi is executable
chmod 755 /home/user/appname/public/dispatch.fcgi
c. For existing applications:
Make sure that your app lives in /home/user/appname. Add the following lines in your Rails application’s /home/user/appname/public/dispatch.fcgi file:
require 'fcgi'
require 'rubygems'
require_gem 'fcgi'
d. For a new account, you can test Rails doing the following:
cd /home/user
rails appname
cd appname
ruby script/generate controller test
cd /home/user/public_html
ln -s ../appname/public appname
Navigate to http://domain.com/appname/ and you should see a “Congratulations” page!

new stable version of Ruby, 1.8.5: ftp://ftp.ruby-lang.org/pub/ruby/ruby-1.8.5.tar.gz
n,
hh
.
cccbvcv
Good post.
Thanks for the great post. It reminds me that I have to bring more structure in to my blogging. Your blog is very interesting. Please let me know how to go for your rss blog.
http://www.casual-mall.com http://www.mycasualmall.com http://www.holydress.com http://www.fuzhou-traffic.com http://www.brands-center.com
Thanks for a great time visiting your site. It's really a pleasure knowing a site like this packed with great information.
Cool comments. Big thanks for all visitors and for author. I love this site!!!
Thanks for a great time visiting your site. It's really a pleasure knowing a site like this packed with great information.
Thank you for the info, it really helps.
Nice job, it’s a great post. The info is good to know!
Thanks for a great time visiting your site. It's really a pleasure knowing a site like this packed with great information.
cheap lv handbags on sale
Chanel 2.55 handbags
Supra Shoes
cheap UGG Boots outlet
MBT Sneaker,Anti Shoes
thanks… I’ve been bookmarking them for a while now and just decided to create a post to provide them to others…
http://www.rep1ica.com/GoodsBrand/Corum-35.html http://www.rep1ica.com/GoodsBrand/Daniel-Roth-36.html http://www.rep1ica.com/GoodsBrand/Ebel-37.html http://www.rep1ica.com/GoodsBrand/Franck-Muller-38.html http://www.rep1ica.com/GoodsBrand/Gerald-Genta-39.html
Thanks for the great post. It reminds me that I have to bring more structure in to my blogging. Your blog is very interesting. Please let me know how to go for your rss blog. http://www.blogigo.com/Dress_Clothing_Blog
Perhaps this is one of the most interesting blogs that I have ever seen. Interesting article, Funny comment. Keep it up!
Fantastic Read! Looking forward to more! Bookmarked the site and will be back again!
You have got some great posts in your blog. Keep up with the good work.
This is a great post; it was very informative. I look forward in reading more of your work. Also, I made sure to bookmark your website so I can come back later. I enjoyed every moment of reading it
it was very informative. I look forward in reading more of your work. Also, I made sure to bookmark your website so I can come back later. I enjoyed every moment of reading it
Thank you for sharing
I really want learn it better.
This article is very good, thank you for sharing! http://dressclothingblog.blog.com/ http://mickeyli.vox.com/
This article is really great, strong support Rolex Submariner http://www.topluxwatch.com/
Thank you ,it's really useful.