Apache with Passenger doesn't load Rails app

I'm developing a Rails app and am trying to configure the web server it's deployed on. My problem is that the page doesn't load.

In Apache's error.log there are no errors and in my app's log/production.log only the line(s) Connecting to database specified by database.yml appears.

I have no index.html in app's public folder and the application works fine in the development environment.

I'm using an Amazon instance with Ubuntu 12.04 and I've installed ruby through RVM. In my httpd.conf I have:

LoadModule passenger_module /home/ubuntu/.rvm/gems/ruby-1.9.3-p194/gems/passenger-3.0.17/ext/apache2/mod_passenger.so
PassengerRoot /home/ubuntu/.rvm/gems/ruby-1.9.3-p194/gems/passenger-3.0.17
PassengerRuby /home/ubuntu/.rvm/wrappers/ruby-1.9.3-p194/ruby

Apache starts without errors.

Below there is my sites-available/default:

# other virtualhosts

<VirtualHost *:80>
    ServerName my_app.mydomain.com
    ServerAdmin mail@mail.com

    DocumentRoot /home/ubuntu/public_html/my_app/current/public

    <Directory /home/ubuntu/public_html/my_app/current/public>
        Allow from all
        Options -MultiViews

    ErrorLog ${APACHE_LOG_DIR}/error.log

What should I do now to get passenger working?


I decided to reinstall Ruby and all the other stuff and moving to nginx. Finally now I have all working (both in ngnix and apache). This is what I've done, if someone cares:

Ruby + Rails

Install ruby + rails via RVM

curl -L https://get.rvm.io | bash -s stable --rails

Load rvm in all opened shells

source ~/.rvm/scripts/rvm

Install gem

gem install passenger

Install apache and passenger module

rvmsudo passenger-install-apache2-module

Copy these lines to /etc/apache2/httpd.conf

LoadModule passenger_module /home/ubuntu/.rvm/gems/ruby-1.9.3-p194/gems/passenger-3.0.17/ext/apache2/mod_passenger.so
PassengerRoot /home/ubuntu/.rvm/gems/ruby-1.9.3-p194/gems/passenger-3.0.17
PassengerRuby /home/ubuntu/.rvm/wrappers/ruby-1.9.3-p194/ruby

Install nginx and passenger module

rvmsudo passenger-install-nginx-module

Copy these lines to /opt/nginx/conf/nginx.conf

passenger_root /home/ubuntu/.rvm/gems/ruby-1.9.3-p194/gems/passenger-3.0.17;
passenger_ruby /home/ubuntu/.rvm/wrappers/ruby-1.9.3-p194/ruby;

Setup a script to allow you to control Nginx

wget -O init-deb.sh http://library.linode.com/assets/660-init-deb.sh
sudo mv init-deb.sh /etc/init.d/nginx
sudo chmod +x /etc/init.d/nginx
sudo /usr/sbin/update-rc.d -f nginx defaults

You can now control Nginx with this script

sudo /etc/init.d/nginx stop
sudo /etc/init.d/nginx start
Final setup with nodejs

One of the other things you’ll want is Node.js. This will help you do the compiling of assets on deployments

sudo apt-add-repository ppa:chris-lea/node.js
sudo apt-get -y update
sudo apt-get -y install nodejs

Need Your Help

Excel macro to convert HTML entities to text

html excel text html-entities

I have a huge Excel file that contains the result of an online survey. The person who built the survey messed up the formatting in several respects, and the mess-up I need to take care of first is

Should I migrate from Ant to Maven?

maven-2 ant migration

I am working on a fairly large project (with a number of modules, a bunch of external libraries etc.) and we are now considering switching from Ant to Maven. I understand the differences between th...