Skip to content

Instantly share code, notes, and snippets.

@barinek
Created January 6, 2010 16:13
Show Gist options
  • Save barinek/270375 to your computer and use it in GitHub Desktop.
Save barinek/270375 to your computer and use it in GitHub Desktop.
nginx with passenger and rails
#!/bin/bash
source /etc/profile
for ruby_package in ruby-ri-1.8.5 ruby-rdoc-1.8.5 ruby-irb-1.8.5 ruby-docs-1.8.5 ruby-tcltk-1.8.5 ruby-1.8.5 ruby-mode-1.8.5 rrdtool-ruby-1.2.27 ruby-devel-1.8.5.x86_64 ruby-devel-1.8.5.i386 ruby-libs-1.8.5.x86_64 ruby-libs-1.8.5.i386
do
if rpm -q $ruby_package >/dev/null; then
echo $ruby_package
rpm -e $ruby_package;
fi
done
rm -rf /usr/lib/ruby
rm -rf /usr/lib64/ruby
yum install -y fontconfig-devel freetype-devel glib2-devel libjpeg-devel libpng-devel libtiff-devel libwmf-devel libxslt libxslt-devel openssl-devel readline-devel zlib zlib-devel sqlite sqlite3 sqlite3-devel
wget http://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7.tar.gz
tar -zxvf ruby-1.8.7.tar.gz
cd ruby-1.8.7
./configure --with-openssl-dir=/usr/lib/openssl
make
make install
/usr/local/bin/ruby -v
wget http://rubyforge.org/frs/download.php/60718/rubygems-1.3.5.tgz
tar -zxvf rubygems-1.3.5.tgz
cd rubygems-1.3.5
/usr/local/bin/ruby setup.rb
/usr/local/bin/gem -v
/usr/local/bin/gem source -a http://gems.rubyforge.org/
/usr/local/bin/gem update --system
/usr/local/bin/gem install rails --no-rdoc --no-ri --version 2.3.4
/usr/local/bin/gem install rake sqlite3-ruby xml-simple nokogiri passenger --no-rdoc --no-ri
wget http://sysoev.ru/nginx/nginx-0.8.4.tar.gz
tar -zxf nginx-0.8.4.tar.gz
cd nginx-0.8.4
/usr/local/bin/passenger-install-nginx-module --auto --prefix=/opt/nginx --nginx-source-dir=`pwd` --extra-configure-flags=--with-http_ssl_module
mv /opt/nginx/conf/nginx.conf /opt/nginx/conf/nginx.conf_passenger
mv $ATTACH_DIR/nginx.conf /opt/nginx/conf/nginx.conf
mkdir -p /opt/applications
/usr/local/bin/rails /opt/applications/example/current
chown -R username:username /opt/applications
/opt/nginx/sbin/nginx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment