Problem running Ruby / Rails Passenger-Apache-CentOS

June 13, 2014 1.7k views
I follow this guide, https://www.digitalocean.com/community/tutorials/how-to-setup-a-rails-4-app-with-apache-and-passenger-on-centos-6 Everything sees OK but Ruby Code does not see to be interpreted or rendered. If I go to the IP I get the default Apache "Apache 2 Test Page powered by CentOS" page. No rails. If I type in the direct path to a page with Ruby code in it, the page just renders as HTML. I have checked that all the paths are correct and have added the passenger code to the bottom of the httpd.conf. I don't know what I am doing wrong.
1 Answer
Make sure your DocumentRoot is set to the public folder, not the app's root:
DocumentRoot /var/www/html/helloapp/public 
Also, make sure you use the real output of the passenger-install-apache2-module command, not what is in the article. It will be different depending on the most recent version of passenger when you run it. For instance, right now it is:
LoadModule passenger_module /usr/local/rvm/gems/ruby-2.0.0-p481/gems/passenger-4.0.45/buildout/apache2/mod_passenger.so
<IfModule mod_passenger.c>
     PassengerRoot /usr/local/rvm/gems/ruby-2.0.0-p481/gems/passenger-4.0.45
     PassengerDefaultRuby /usr/local/rvm/gems/ruby-2.0.0-p481/wrappers/ruby
Have another answer? Share your knowledge.