I am trying to run a rails application on Apache2. When viewing the site on the browser it list all the files in the directory instead of running the application. The error log for Apache shows a message
[Fri Nov 20 15:15:04.274304 2015] [mpm_event:notice] [pid 7656:tid 139998747531136] AH00489: Apache/2.4.7 (Ubuntu) Phusion_Passenger/5.0.21 configured -- resuming normal operations
[Fri Nov 20 15:15:04.274334 2015] [core:notice] [pid 7656:tid 139998747531136] AH00094: Command line: '/usr/sbin/apache2'
Conf:
<Directory />
Options FollowSymLinks
AllowOverride None
Require all denied
</Directory>
<Directory /usr/share>
AllowOverride None
Require all granted
</Directory>
<Directory /home/adminuser/hroot>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
<VirtualHost *:80>
ServerName www.hroot.ncl.ac.uk
# Tell Apache and Passenger where your app's 'public' directory is
DocumentRoot /home/adminuser/hroot/
PassengerRuby /usr/local/rvm/gems/ruby-2.1.2/wrappers/ruby
# Relax Apache security settings
<Directory /home/adminuser/hroot>
Allow from all
Options -MultiViews
# Uncomment this if you're on Apache > 2.4:
Require all granted
</Directory>
</VirtualHost>
I am now getting this message in the log file.
App 11778 stderr: Trying next mirror...
App 11778 stderr: Could not download https://s3.amazonaws.com/phusion-passenger/binaries/passenger/by_release/5.0.21/rubyext-ruby-2.1.2-x86_64-linux.tar.gz: The requested URL returned error: 403 Forbidden
App 11778 stderr: --> Continuing without passenger_native_support.so.
App 11778 stdout:
[ 2015-11-24 13:04:47.5518 11693/7fdca9f4e700 age/Cor/App/Implementation.cpp:304 ]: Could not spawn process for application /home/adminuser/hroot: An error occured while starting up the preloader.
Error ID: eee6139e
Error details saved to: /tmp/passenger-error-EzX9GD.html
Message from application: cannot load such file -- bundler/setup (LoadError)
/usr/local/rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/usr/local/rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:430:in `activate_gem'
/usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:297:in `block in run_load_path_setup_code'
/usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:435:in `running_bundler'
/usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:296:in `run_load_path_setup_code'
/usr/share/passenger/helper-scripts/rack-preloader.rb:100:in `preload_app'
/usr/share/passenger/helper-scripts/rack-preloader.rb:156:in `<module:App>'
/usr/share/passenger/helper-scripts/rack-preloader.rb:30:in `<module:PhusionPassenger>'
/usr/share/passenger/helper-scripts/rack-preloader.rb:29:in `<main>'
After trying the link you suggested i am getting this error message:
[ 2015-11-24 14:50:58.1887 15008/7efc7eab5700 age/Cor/App/Implementation.cpp:304 ]: Could not spawn process for application /hroot/hroot: An error occured while starting up the preloader.
Error ID: d5e32def
Error details saved to: /tmp/passenger-error-33KRJ9.html
Message from application: /hroot/hroot/config/application.rb:23: invalid multibyte char (US-ASCII)
/hroot/hroot/config/application.rb:23: invalid multibyte char (US-ASCII)
/hroot/hroot/config/application.rb:23: syntax error, unexpected $end, expecting '}'
... 'Deutsch (de)', :fr => 'Français (fr)'}
... ^ (SyntaxError)
/hroot/hroot/config/environment.rb:2:in require'
/hroot/hroot/config/environment.rb:2:in
'
config.ru:3:in require'
config.ru:3:in
block in '
/var/lib/gems/1.9.1/gems/rack-1.4.5/lib/rack/builder.rb:51:in instance_eval'
/var/lib/gems/1.9.1/gems/rack-1.4.5/lib/rack/builder.rb:51:in
initialize'
config.ru:1:in new'
config.ru:1:in
'
/usr/share/passenger/helper-scripts/rack-preloader.rb:110:in eval'
/usr/share/passenger/helper-scripts/rack-preloader.rb:110:in
preload_app'
/usr/share/passenger/helper-scripts/rack-preloader.rb:156:in <module:App>'
/usr/share/passenger/helper-scripts/rack-preloader.rb:30:in
'
/usr/share/passenger/helper-scripts/rack-preloader.rb:29:in `'