sudo apt-get -y install build-essential zlib1g-dev libssl-dev libreadline-dev libyaml-dev libcurl4-openssl-dev curl git-core python-software-properties
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p194.tar.gz
tar -xvzf ruby-1.9.3-p194.tar.gz
cd ruby-1.9.3-p194/
./configure
make
sudo make install
echo "gem: --no-ri --no-rdoc" >> ~/.gemrc
sudo apt-get install mysql-server mysql-client libmysqlclient-dev libmysql-ruby
sudo apt-get -y install nodejs
sudo apt-get install apache2 apache2-mpm-prefork apache2-prefork-dev
sudo apt-get install apache2-mpm-itk -- folosit pentru AssignedUserID in VirtualHost
sudo gem install bundler
sudo gem install passenger
sudo passenger-install-apache2-module
In /etc/apache2/apache2.conf:
LoadModule passenger_module /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.17/ext/apache2/mod_passenger.so
PassengerRoot /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.17
PassengerRuby /usr/local/bin/ruby
Warning apache2: vim /etc/apache2/httpd.conf ServerName localhost
/etc/init.d/apache2 restart
Surse:
http://excid3.com/blog/setting-up-ubuntu-12-04-with-ruby-1-9-3-nginx-passenger-and-postgresql-or-mysql/
http://coding.smashingmagazine.com/2011/06/28/setup-a-ubuntu-vps-for-hosting-ruby-on-rails-applications-2/
http://nathanhoad.net/how-to-ruby-on-rails-ubuntu-apache-with-passenger
http://aslamnajeebdeen.com/blog/how-to-fix-apache-could-not-reliably-determine-the-servers-fully-qualified-domain-name-using-127011-for-servername-error-on-ubuntu
Exemplu Virtual Host RoR:
<VirtualHost *:80>
ServerName domain.com
ServerAdmin admin@domain.comDocumentRoot /var/www/app/public
AssignUserID user_name user_name
PassengerUploadBufferDir /tmp
RailsEnv production
AllowOverride All
Options -MultiViews
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel infoCustomLog /var/www/app/logs/access.log combined
ErrorLog /var/www/app/logs/error.log
</VirtualHost>
Exemplu Virtual Host HTML:
<VirtualHost *:80>
ServerName domain.com
ServerAdmin admin@domain.comDocumentRoot /var/www/app
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
AssignUserID user_name user_name
CustomLog /var/www/app/logs/access.log combined
ErrorLog /var/www/app/logs/error.log</VirtualHost>