ubuntu_ROR_Apache2
==================
How To configure Apache to run ROR
1, Install LAMP and other packages
apt-get install apache2 mysql-server libapache2-mod-auth-mysql php5-mysql php5 libapache2-mod-php5 php5-mcrypt
apt-get install libcurl4-openssl-dev apache2-threaded-dev libapr1-dev libaprutil1-dev
2, Remove old Ruby
apt-get remove ruby1.9.1
apt-get remove ruby1.8
3 Install RVM (for ubuntu)
apt-get --purge remove ruby-rvm
rm -rf /usr/share/ruby-rvm /etc/rvmrc /etc/profile.d/rvm.sh
env | grep rvm
\curl -L https://get.rvm.io | bash -s stable --ruby --autolibs=enable --auto-dotfiles
source /usr/local/rvm/scripts/rvm
rvm
4, Install Rails
gem install rails
5, Ruby versions (by Feb. 15 2014)
ruby 2.1.0p0 (2013-12-25 revision 44422) [i686-linux]
gem 2.2.2
irb 0.9.6(09/06/30)
rvm 1.25.18 (stable)
Rails 4.0.2
rake (10.1.0)
6,install Phusion Passenger.
DO NOT USE APT-GET TO INSTALL PASSENGER, OTHERWISE, RUBY WILL BE DOWNGRADED TO LOWER VERSION, AND RAILS WILL NOT WORK.
#apt-get install libapache2-mod-passenger
gem install passenger
passenger-install-apache2-module
passenger start
Please edit your Apache configuration file, and add these lines:
vim /etc/apache2/apache2.conf
LoadModule passenger_module /usr/local/rvm/gems/ruby-2.1.1/gems/passenger-4.0.37/buildout/apache2/mod_passenger.so
<IfModule mod_passenger.c>
PassengerRoot /usr/local/rvm/gems/ruby-2.1.1/gems/passenger-4.0.37
PassengerDefaultRuby /usr/local/rvm/gems/ruby-2.1.1/wrappers/ruby
</IfModule>
7, update apache2 config file (assume your rails application path is /opt/ruby/demo/)
vim /etc/apache2/sites-available/default
<VirtualHost x.x.x.x:80>
ServerAdmin xxng@gmail.com
ServerName 3w.com
ServerAlias www.3w.com
RailsEnv development
DocumentRoot /opt/ruby/demo/public
<Directory /opt/ruby/demo/public>
AllowOverride all
Options -MultiViews
</Directory>
</VirtualHost>
8, service apache2 restart
Subscribe to:
Post Comments (Atom)
-
Step 1, New a project rails new demo Step 2, Update Gemfile add paperclip, mysql2 gem, enable JavaScript runtime gem 'mysql2' ...
-
I used 7z to zip this file under Windows, try to unzip it under linux [ang@walker temp]$ gunzip 2011.sdf.zip gunzip: 2011.sdf.zip: unkno...
-
When trying to access transmission from web-browswer i got the message : 403: Forbidden Unauthorized IP Address. Either disable the IP ad...
Thanks for sharing this Information !!
ReplyDeleteCheck out More Linux Related.
(Installation/Configururation/Trouble Shooting etc) at :
Linux Trouble Shooting