sexta-feira, 2 de junho de 2017

RAILS Faq, HowTo, Reference, Sample Setup a Rails App With Apache and Passenger on CentOS 6

1. Introduction


This post gathers information about how to setup RAILS APP with Apache and Passenger on CentOS 6.


2. Step-by-Steyp


  • Step#1: First of all, mantain your linux so up-to-date

# yum update



  • Step#2: Install Apache
# yum install httpd


  • Step#3: Install apache

# yum install httpd curl-devel httpd-devel



  • Step#4:  Get Apache to start on boot:

# chkconfig httpd on



  • Step#5: Install Phusion Passenger and dependency packages

# gem install passenger
# yum install curl-devel httpd-devel



  • Step#6: Compile the environment:

# passenger-install-apache2-module



  • Step#7 Edit the Apache config file in etc/httpd/conf/httpd.conf 
Uncomment the line containing NameVirtualHost *:80 towards the end
Paste the output from (Step#6 Compile environment) anywhere at the end of the file, eg:


# vim etc/httpd/conf/httpd.conf
LoadModule passenger_module /usr/local/rvm/gems/ruby-2.1.1/gems/passenger-4.0.41/buildout/apache2/mod_passenger.so

PassengerRoot /usr/local/rvm/gems/ruby-2.1.1/gems/passenger-4.0.41

PassengerDefaultRuby /usr/local/rvm/gems/ruby-2.1.1/wrappers/ruby
<VirtualHost *:80>
 ServerName 1.2.3.4 # www.whatever.com
 DocumentRoot /var/www/rails/public # the path to your rails app
 <Directory /var/www/rails/public>
 AllowOverride all
 Options -MultiViews
 </Directory>
</VirtualHost>



3. References

https://www.digitalocean.com/community/tutorials/how-to-setup-a-rails-4-app-with-apache-and-passenger-on-centos-6
https://stackoverflow.com/questions/5584759/start-rails-server-automatically-after-boot

Nenhum comentário:

Postar um comentário