Redmine runs under webrick but not Apache

Added by Ruari Mactaggart about 6 years ago

Sorry to post a common issue but I have been looking for days and not yet got a solution.

I am running Redmine 2.3 on Centos 6.2 I have been using it fine for weeks using webrick, but every time I try to get it to run under Apache I cannot. Here is the error I get when I try and visit it at issue.mydomain.com.

Could not find mime-types-1.25 in any of the sources (Bundler::GemNotFound)
  /usr/local/rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/spec_set.rb:92:in `block in materialize'
  /usr/local/rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/spec_set.rb:85:in `map!'
  /usr/local/rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/spec_set.rb:85:in `materialize'
  /usr/local/rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/definition.rb:114:in `specs'
  /usr/local/rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/definition.rb:159:in `specs_for'
  /usr/local/rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/definition.rb:148:in `requested_specs'
  /usr/local/rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/environment.rb:18:in `requested_specs'
  /usr/local/rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:13:in `setup'
  /usr/local/rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler.rb:120:in `setup'
  /usr/local/rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/setup.rb:17:in `<top (required)>'
  /usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:116:in `require'
  /usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:116:in `rescue in require'
  /usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:122:in `require'
  /usr/local/rvm/gems/ruby-2.0.0-p247/gems/passenger-4.0.10/lib/phusion_passenger/loader_shared_helpers.rb:212:in `run_load_path_setup_code'
  /usr/local/rvm/gems/ruby-2.0.0-p247/gems/passenger-4.0.10/helper-scripts/rack-preloader.rb:73:in `preload_app'
  /usr/local/rvm/gems/ruby-2.0.0-p247/gems/passenger-4.0.10/helper-scripts/rack-preloader.rb:127:in `<module:App>'
  /usr/local/rvm/gems/ruby-2.0.0-p247/gems/passenger-4.0.10/helper-scripts/rack-preloader.rb:6:in `<module:PhusionPassenger>'

Here is my environment output

Environment:
  Redmine version                2.3.2.stable.12119
  Ruby version                   1.9.3-p327 (2012-11-10) [x86_64-linux]
  Rails version                  3.2.13
  Environment                    production
  Database adapter               Mysql2
Redmine plugins:
  no plugin installed

and here is my virtual host entry

Listen *:3000

#LoadModule passenger_module /usr/lib64/ruby/gems/1.9.1/gems/passenger-3.0.19/ext/apache2/mod_passenger.so
#PassengerRoot /usr/lib64/ruby/gems/1.9.1/gems/passenger-3.0.19
#PassengerRuby /usr/bin/ruby

<VirtualHost *:80>
    ServerName issues.mydomain.com
    DocumentRoot /var/www/html/redmine-2.3/public/
    ErrorLog logs/redmine_error_log
    <Directory "/var/www/html/redmine-2.3/public/">
         Options Indexes ExecCGI FollowSymLinks
         Order allow,deny
         Allow from all
         AllowOverride all
         # MultiViews must be turned off.
         Options -MultiViews
      </Directory>
</VirtualHost>

If I go to issues.mydomain.com:3000, I get the default Apache page.

I have left in the commented out bits in case they will help enlighten anyone as to my problems. I don't really know anything about Ruby, nor about Passenger so am at a loss, any help would be massively appreciated!

Replies (1)

RE: Redmine runs under webrick but not Apache - Added by Martin Denizet (redmine.org team member) about 6 years ago

Hello Ruari,

I see 3 issues:
  1. The passenger loading is commented in your VirtualHost:
    #LoadModule passenger_module /usr/lib64/ruby/gems/1.9.1/gems/passenger-3.0.19/ext/apache2/mod_passenger.so
    #PassengerRoot /usr/lib64/ruby/gems/1.9.1/gems/passenger-3.0.19
    #PassengerRuby /usr/bin/ruby
    

    Should be:
    LoadModule passenger_module /usr/lib64/ruby/gems/1.9.1/gems/passenger-3.0.19/ext/apache2/mod_passenger.so
    PassengerRoot /usr/lib64/ruby/gems/1.9.1/gems/passenger-3.0.19
    PassengerRuby /usr/bin/ruby
    
  2. You listen on port 3000 but your VirtualHost in on port 80. That's why you get the Apache default page
  3. Did you run the bundle install correctly for the production environment?

Cheers,
Martin

(1-1/1)