Skip to content
cesarediaz edited this page Sep 13, 2010 · 37 revisions

Enviroment where was installed and tested

  • Debian GNU/Linux squeeze/sid \n \l installed over a virtual machine
  • 512 Mb of memory
  • 10 Gb in hard disk for the entire system

Debian Packages

  • ruby1.8
  • ruby1.8-examples
  • rdoc1.8
  • ri1.8
  • build-essential
  • ruby1.8-dev
  • libsqlite3-ruby1.8
  • libopenssl-ruby
  • apache2-prefork-dev
  • libapr1-dev
  • apache2
  • apache2-doc
  • sqlite3
  • git-core

Ruby

  1. Download rubygems package ( from Rubyforge ) and copy to ‘server#:/opt/’ path or where you can unzip with tar command the file on the server
cp rubygems-1.3.1.tgz to /opt/
tar -xvzf rubygems-1.3.1.tgz
cd rubygems-1.3.1
ruby setup.rb

Install gems

gem1.8 install rake
gem1.8 install pdf-writer
gem1.8 install spreadsheet
gem1.8 install geokit --version='1.3.0'
gem1.8 install railroad
  1. Download passenger ( from ModRails) the version “passenger-2.1.3.tar.gz” and copy to ‘server#:/opt/’ path or where you can unzip with tar command the file on the server
cp passenger-2.1.3.tar.gz
tar -xvzf passenger-2.1.3.tar.gz
cd passenger-2.1.3
./bin/passenger-install-apache2-module

and then edit with some command line editor “/etc/apache2/httpd.conf” and add the next lines:

LoadModule passenger_module /opt/passenger-2.1.3/ext/apache2/mod_passenger.so
PassengerRoot /opt/passenger-2.1.3
PassengerRuby /usr/bin/ruby1.8
PassengerDefaultUser root

To add a virtual website edit with some command line editor “/etc/apache2/httpd.conf” and add the next lines:

<VirtualHost *:80>
         ServerName www.my_inventory_site.com
         ServerAlias www.my_inventory_site.com
         DocumentRoot /var/www/apps/APP_FOLDER/current/public
         RailsBaseURI /APP_FOLDER
         CustomLog /var/log/apache2/my_inventory_site.log "%h %l %u %t \"%r\" %>s %b"
</VirtualHost>

To prepare the place where will deployed the application

cd /var/www
mkdir apps

To use with a SQLite database in this case

cd /var/www/apps
mkdir databases
cd /var/www/apps/databases
touch inventory_production.sqlite3
chown root:root inventory_production.sqlite3
chmod 664 inventory_production.sqlite3

Setup for the application with Capistrano from your capify place (place where you have downloaded your workcopy of this application and well configurated in ‘ROOT_PATH/conf/setup.rb’ ), so.. do that

cd "ROOT_PATH"
cap deploy:setup

Make database.yml and site_key.rb share folder for the application (as APP_FOLDER)

cd /var/www/apps/APP_FOLDER/
touch shared/system/site_key.rb
touch shared/system/database.yml
chmod 664 shared/system/database.yml

Advice, you can copy site_key.rb from another place, for example from your workcopy at
‘ROOT_PATH/conf/initializers/site_keys.rb’ to the server doing that


scp ROOT_PATH/conf/initializers/site_keys.rb an_user@:/var/www/apps/APP_FOLDER/shared/system
nano shared/system/database.yml

and add this code at ‘database.yml’ file

production:
  adapter: sqlite3
  database: ../../../databases/inventory_production.sqlite3
  pool: 5
  timeout: 5000

If you are a developer working with rails and have an account at Working With Rails you can give me a recomendation if you think that I deserve doing clicking at next link,
Recommend Me