Quick and Dirty Install
Assumes you are logged in as root. Use sudo where necessary (like any make or gem installs). Skip the steps that you already have (i.e. Ruby/RubyGems installation)
Install dependencies:
yum -y install zlib openssl-devel readline-devel gcc-c++
Install Ruby and RubyGems (if the REE installer fails for lack of finding an interpreter):
wget ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p72.tar.gz
tar -zxvf ruby-1.8.7-p72.tar.gz
cd ruby-1.8.7-p72
./configure
make && make install
wget http://rubyforge.org/frs/download.php/45905/rubygems-1.3.1.tgz
tar -zxvf rubygems-1.3.1.tgz
cd rubygems-1.3.1
ruby setup.rb
Install Ruby Enterprise (if you are on a 64-bit distro, you may have duplicate i386 AND x86_64 versions of libstdc++ and you will get an error… either uninstall the i386 version, or add –no-tcmalloc option to installer command):
wget http://rubyforge.org/frs/download.php/51100/ruby-enterprise-1.8.6-20090201.tar.gz
tar -zxvf ruby-enterprise-1.8.6-20090201.tar.gz
./ruby-enterprise-1.8.6-20090201/installer
/opt/ruby-enterprise-1.8.6-20090201/bin/passenger-install-apache2-module
Add the following directory to your path (you could use symlinks too)
/opt/ruby-enterprise-1.8.6-20090201/bin
Add the following to Apache config:
LoadModule passenger_module /opt/ruby-enterprise-1.8.6-20090201/lib/ruby/gems/1.x/gems/passenger-2.0.6/ext/apache2/mod_passenger.so
PassengerRoot /opt/ruby-enterprise-1.8.6-20090201/lib/ruby/gems/1.x/gems/passenger-2.0.6
PassengerRuby /opt/ruby-enterprise-1.8.6-20090201/bin/ruby
Install any gems you want or that are required that *did not* get installed as a result of the REE installer..
gem install passenger rake rails fastthread rack sqlite3-ruby postgres
gem install mysql -- --with-mysql-config='/usr/bin/mysql_config'
Install Subversion:
yum install subversion
Create repository:
mkdir /usr/local/svn/repos/
svnadmin create /usr/local/svn/repos/project
chown -R apache:apache /usr/local/svn/repos/project
Add the following lines to subversion.conf (or whatever apache config file you choose to use):
<Location /svn/repos>
DAV svn
SVNParentPath /usr/local/svn/repos
</Location>
Create a password file:
htpasswd -cm /etc/svn-auth-file username
Add more usernames/passwords:
htpasswd -m /etc/svn-auth-file username
Modify your subversion.conf to use whatever security method you deem necessary
Create your rails app:
rails rails_app
Import your rails app:
svn import -m "Initial import" rails_app file:///usr/local/svn/repos/project
Add virtual host for rails app (this will entirely depend on your server/application setup, but mainly concern yourself with the fact that your DocumentRoot and Directory directives should have /public at the end):
<VirtualHost *:80>
ServerAdmin webmaster@yourdomain.com
DocumentRoot /path/to/rails_app/public
ServerName yourdomain.com
ErrorLog logs/yourdomain.com-error_log
CustomLog logs/yourdomain.com-access_log common
</VirtualHost>
Done. Time to go caffeinate.
Full install approach after the break.
Continue reading →