Cannot get Passenger to launch Redmine

Added by Ruari Mactaggart over 5 years ago

My situation is not an uncommon one and it is in danger of breaking me.

I have been running Redmine 2.3 succesfully under Webrick for a few months. But I cannot get it to do the same with Apache + Passenger. I have read through sooo many how-to's on this subject on here, and read lots of Stackoverflow questions too. This got me over some of my problems but one big one remains.

I am accessing redmine on my own sub-domain, http://issues.mydomain.com. When I go there, I get default server Apache holding page. If I put an index.html in the dir this will get served up, so I guess my vhost.conf is sending the request to the right place. But that's all.

My virtual host currently looks like this;

<VirtualHost *:80>
    ServerName issues.ember.co.uk
    DocumentRoot /var/www/html/redmine-2.3/public
    ErrorLog logs/redmine_error_log
    PassengerDefaultUser apache
    <Directory "/var/www/html/redmine-2.3/public">
        Allow from all
        Options -MultiViews
    </Directory>
</VirtualHost>

which ruby reports this

/usr/local/rvm/rubies/ruby-1.9.3-p392/bin/ruby

rails --version reports this;

Rails 3.2.13

OS is CentOS release 6.4

Is there anything else I should post to help diagnose what is going wrong? Passenger mod is enabled in my httpd.conf also if that is relevant.

Replies (10)

RE: Cannot get Passenger to launch Redmine - Added by Jan Niggemann (redmine.org team member) over 5 years ago

Where do you set RailsEnv and RailsBaseURI?

RE: Cannot get Passenger to launch Redmine - Added by Ruari Mactaggart over 5 years ago

HI, thanks for getting back.

I have now added these lines to my VirtualHost, inside the <Directory> tags;

RailsBaseURI /var/www/redmine-2.3/public
RailsEnv production

I restarted apache, but I still end up in doc root with default apache holding page showing. Is this the correct place for these please?

RE: Cannot get Passenger to launch Redmine - Added by Jan Niggemann (redmine.org team member) over 5 years ago

Oh, just to make sure: What version of rails do you use?
The option RackBaseURI is for rails 3, in rails 2 it was called RailsBaseURI.

According to this page you don't put it inside the directory tags...

RE: Cannot get Passenger to launch Redmine - Added by Ruari Mactaggart over 5 years ago

My rails is 3.2.13.

I have moved RailsBaseURI and RailsEnv into the VirtualHost directive, outside the <Directory> tag. I have also tried RackBaseURI, same result - default Apache page.

RE: Cannot get Passenger to launch Redmine - Added by Jan Niggemann (redmine.org team member) over 5 years ago

Just to make sure: You restarted apache after changing the config, did you?
What's the actual filename of your configuration?
Does apachectl configtest return "Syntax OK"?
Do you LoadModule passenger_module... somewhere?
Something interesting in the apache logs?

RE: Cannot get Passenger to launch Redmine - Added by Alex Wilhelmy over 5 years ago

I came across a similar problem. Have a look at:
root@yourserver:/etc/apache2/mods-available# cat passenger.load
LoadModule passenger_module /usr/lib/apache2/modules/mod_passenger.so

Does the library /usr/lib/apache2/modules/mod_passenger.so exist?

If not: search for it. I placed the full qualified path of mod_passenger.so into the passenger.load
LoadModule passenger_module /var/lib/gems/1.8/gems/passenger-4.0.20/buildout/apache2/mod_passenger.so

Then also modified passenger.conf accordingly (I suppose a symlink would also have done the trick).

Don't give up

Cheers

Alex

RE: Cannot get Passenger to launch Redmine - Added by Jan Niggemann (redmine.org team member) over 5 years ago

Alex Wilhelmy wrote:

If not: search for it. I placed the full qualified path of mod_passenger.so into the passenger.load
LoadModule passenger_module /var/lib/gems/1.8/gems/passenger-4.0.20/buildout/apache2/mod_passenger.so

Yeah, it depends on how you install passenger in the first place.

Don't give up

We're here to help you so stay calm and keep posting ;-)

RE: Cannot get Passenger to launch Redmine - Added by Ruari Mactaggart over 5 years ago

So actually I have 4 copies of mod_passenger.so on the server, in these 4 locations.

  • /usr/lib64/httpd/modules/mod_passenger.so
  • /usr/local/lib/ruby/gems/1.9.1/gems/passenger-4.0.14/buildout/apache2/mod_passenger.so
  • /usr/local/lib/ruby/gems/1.9.1/gems/passenger-4.0.20/buildout/apache2/mod_passenger.so
  • /usr/local/rvm/gems/ruby-2.0.0-p247/gems/passenger-4.0.10/buildout/apache2/mod_passenger.so

It is loading in httpd.conf, like this;

LoadModule passenger_module /usr/local/rvm/gems/ruby-2.0.0-p247/gems/passenger-4.0.10/buildout/apache2/mod_passenger.so
PassengerRoot /usr/local/rvm/gems/ruby-2.0.0-p247/gems/passenger-4.0.10
PassengerDefaultRuby /usr/local/rvm/wrappers/ruby-2.0.0-p247/ruby

I believe it is loading ok because if I try and also load it in my vhost, I get the message that it is already loaded and will be skipped.

I have even more copies of passenger.conf, 8 in all.

which ruby
reports

/usr/local/rvm/rubies/ruby-1.9.3-p392/bin/ruby

could this be the problem? The module PassengerDefaultRuby is set to /usr/local/rvm/wrappers/ruby-2.0.0-p247/ruby

RE: Cannot get Passenger to launch Redmine - Added by Alex Wilhelmy over 5 years ago

I don't know. Maybe have a look at:
http://stackoverflow.com/questions/6162196/setting-up-rails-app-on-apache-with-passenger-rails-doesnt-seem-to-load

From there I got the hint to try passenger-status, and I am getting:

root@myserver:~# passenger-status
Version : 4.0.20
Date : Thu Feb 27 15:35:51 +0100 2014
Instance: 1586
----------- General information -----------
Max pool size : 6
Processes : 1
Requests in top-level queue : 0

----------- Application groups -----------
/usr/share/redmine2#default:
App root: /usr/share/redmine2
Requests in queue: 0
  • PID: 3860 Sessions: 0 Processed: 72 Uptime: 23m 48s
    CPU: 4% Memory : 161M Last used: 31s ago

root@myserver:~#

Maybe try passenger-status and post the result?

Just getting a directory listing seems a clear indicator that passenger is not loading or not processing your application.

Hope this helps.

Alex

RE: Cannot get Passenger to launch Redmine - Added by Ruari Mactaggart over 5 years ago

passenger-status gave me this;

/usr/local/lib/ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find passenger (>= 0) amongst [actionmailer-3.2.13, actionpack-3.2.13, activemodel-3.2.13, activerecord-3.2.13, activeresource-3.2.13, activesupport-3.2.13, arel-3.0.2, bigdecimal-1.1.0, builder-3.0.0, bundler-1.3.5, bundler-unload-1.0.1, charlock_holmes-0.6.9, coderay-1.0.9, erubis-2.7.0, hike-1.2.3, i18n-0.6.1, io-console-0.3, journey-1.0.4, jquery-rails-2.0.3, json-1.8.0, json-1.5.5, mail-2.5.4, mime-types-1.25, minitest-2.5.1, multi_json-1.7.9, mysql2-0.3.13, net-ldap-0.3.1, polyglot-0.3.3, rack-1.4.5, rack-cache-1.2, rack-openid-1.3.1, rack-ssl-1.3.3, rack-test-0.6.2, rails-3.2.13, railties-3.2.13, rake-10.1.0, rake-0.9.2.2, rdoc-3.12.2, rdoc-3.9.5, ruby-openid-2.2.3, rubygems-bundler-1.2.2, rvm-1.11.3.8, sprockets-2.2.2, thor-0.18.1, tilt-1.4.1, treetop-1.4.15, tzinfo-0.3.37] (Gem::LoadError)
        from /usr/local/lib/ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
        from /usr/local/lib/ruby/1.9.1/rubygems.rb:1231:in `gem'
        from /usr/local/bin/passenger-status:22:in `<main>'

So this is encouraging in that I hopefully now know what the error is, i.e. it can't find passenger, but I don't know how to fix it. Any thoughts?

(1-10/10)