Project

General

Profile

Installing Redmine (1and1 Dual Perfect Webhosting package)

Added by Kai Röder almost 13 years ago

Hi,

I've spent many hours trying to install Redmine but it's not working..

At first, do I have the correct package to run Redmine?
http://www.1und1.info/FirmenHomepageTariff <- It's in german but most of it is self-explanatory.
I'm trying to run Redmine on "1&1 Dual Perfect"
If you click on "Alle Profi-Features auf einen Blick" you're seeing more detailed information about this hosting package.

Features:
- SSH-Access
- Ruby
- CGI
- No root-access (not a feature but maybe the problem?)
- .htaccess

-------
Installation info:
When I try to run redmine, I'm getting an Application Error thrown from my .htaccess file.
I've installed all packages for 1.3.x
ruby 1.8.7 Rails 2.3.14 Rack 1.1.1

- The db migration also worked fine.
- I created a sub-domain targeting the "redmine/public" folder

Problem: neither fcgi nor cgi are working..

There's a tutorial for installing redmine on 1&1 server (but for a very old version of redmine.. http://schalanda.name/static/rails_on_rtr/rails_on_rtr.html -> the quick installation guide: http://schalanda.name/static/rails_on_rtr/rails_on_rtr.html#Quickstart)
He told people to rename the "dispatch.fcgi" to "dispatch.orig.fcgi" and put this into the dispatch.fcgi:

#!/bin/bash
export GEM_HOME="/kunden/homepages/29/d209963223/htdocs/executable/ruby/gems" 
export GEM_PATH=${GEM_HOME}
export RUBYLIB="/kunden/homepages/29/d209963223/htdocs/executable/ruby/lib:/usr/lib/ruby/1.8/" 
export RAILS_ENV="production" 

exec ./dispatch.orig.fcgi $@

I have no clue why (UNIX beginner..) but this also won't work.

Here my .htaccess

# General Apache options
<IfModule mod_fastcgi.c>
    AddHandler fastcgi-script .fcgi
</IfModule>
<IfModule mod_fcgid.c>
    AddHandler fcgid-script .fcgi
</IfModule>
<IfModule mod_cgi.c>
    AddHandler cgi-script .cgi
</IfModule>
Options +FollowSymLinks +ExecCGI
<pre>

</pre>
# If you don't want Rails to look in certain directories,
# use the following rewrite rules so that Apache won't rewrite certain requests
# 
# Example:
#   RewriteCond %{REQUEST_URI} ^/notrails.*
#   RewriteRule .* - [L]

# Redirect all requests not available on the filesystem to Rails
# By default the cgi dispatcher is used which is very slow
# 
# For better performance replace the dispatcher with the fastcgi one
#
# Example:
#   RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
RewriteEngine On

# If your Rails application is accessed via an Alias directive,
# then you MUST also set the RewriteBase in this htaccess file.
#
# Example:
#   Alias /myrailsapp /path/to/myrailsapp/public
#   RewriteBase /myrailsapp

RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
<IfModule mod_fastcgi.c>
    RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
</IfModule>
<IfModule mod_fcgid.c>
    RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
</IfModule>
<IfModule mod_cgi.c>
    RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
</IfModule>

# In case Rails experiences terminal errors
# Instead of displaying this message you can supply a file here which will be rendered instead
# 
# Example:
#   ErrorDocument 500 /500.html

ErrorDocument 500 "<h2>Application error</h2>Rails application failed to start properly" 

------

I'm getting 404 when I comment the "mod_cgi" part which let me assume that my apache don't support fcgi?
With dispatch.cgi and the standard htaccess file I'm getting an application error (as I said before)

Any ideas?
Any newbie mistakes? -.- spent 8 hours on this problem.


Replies (10)

RE: Installing Redmine (1and1 Dual Perfect Webhosting package) - Added by Ulrich Biskup almost 13 years ago

Hi Kai,
I am dealing with exact the same problem. I would love to run Redmine in my 1and1 Dual Perfect account.
If you get this problem solved please let me know.
Regards,
Ulli

RE: Installing Redmine (1and1 Dual Perfect Webhosting package) - Added by Joan Pons almost 13 years ago

Hi Kai & Ulrich

Same here. 1and1 Dual account waiting for redmine
Sorry if you expected a solution for this problem....
Regards,
Joan

RE: Installing Redmine (1and1 Dual Perfect Webhosting package) - Added by Markus Plutka almost 11 years ago

Hi Kai & Ulrich,

I've managed to get redmine running on my 1&1 Basic account.
Are you still interested in this?

Regards,
Markus

RE: Installing Redmine (1and1 Dual Perfect Webhosting package) - Added by raynald candelier over 10 years ago

Hi Markus,
I am very interested in installing Redmine on my 1&1 account.
for example, i would like to know how to enable Passenger.

thank you for your help

Regards
Raynald

RE: Installing Redmine (1and1 Dual Perfect Webhosting package) - Added by Markus Plutka over 9 years ago

Hey everybody,

this is a small tutorial from the top of my head. There might be other ways but this one worked for me.

Install Ruby > 2

cd ~ (Start in your htdocs ($HOME))
mkdir src
cd src 
wget http://cache.ruby-lang.org/pub/ruby/2.2/ruby-2.2.1.tar.gz (or newer)
tar xfz ruby-2.2.1.tar.gz
cd ruby-2.2.1
./configure --disable-install-doc --prefix=$HOME 
make && make install
cd ~

Edit paths and env
Edit ~/.bash_profile to look like this:

#!/bin/bash
export PATH=~/bin:$PATH
export GEM_HOME=~/lib/ruby/gems/2.2.0
export GEM_PATH=${GEM_HOME}

source ~/.bash_profile
ruby -v (Proper ruby version)

Create ~/.gemrc to disable doc generation for faster gem install (optional)
gem: --no-rdoc --no-ri

Install redmine & gems
Extract redmine install to your redmine folder

gem install bundler
bundle install --without test development rmagick

Domain config
Point your subdomain entry to your redmine folder/public

Fast CGI
Files in redmine folder/public folder

.htaccess

Options +ExecCGI +FollowSymLinks -MultiViews

RewriteEngine on
RewriteBase /

RewriteRule ^$ index.html [QSA]

RewriteRule ^([^.]+)$ $1.html [QSA]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]

ErrorDocument 500 /500.html
ErrorDocument 404 /404.html

dispatch.fcgi (chmod 777 dispatch.fcgi)
substitute xx and yyyyyy according to your folder names (see with pwd)

#!/kunden/homepages/xx/dyyyyyyyyy/htdocs/bin/ruby

ENV['GEM_PATH'] = '/kunden/homepages/xx/dyyyyyyyyy/htdocs/lib/ruby/gems/2.2.0'
ENV['GEM_HOME'] = '/kunden/homepages/xx/dyyyyyyyyy/htdocs/lib/ruby/gems/2.2.0'
ENV['RAILS_ENV'] ||= 'development'

require File.dirname(__FILE__) + '/../config/boot'
require File.dirname(__FILE__) + '/../config/environment'

class Rack::PathInfoRewriter
  def initialize(app)
    @app = app
  end

  def call(env)
    env.delete('SCRIPT_NAME')
    request_uri = env['REQUEST_URI'].to_s
    parts = request_uri.split('?')
    env['PATH_INFO'] = parts[0]
    env['QUERY_STRING'] = parts[1].to_s
    env['REQUEST_METHOD'] ||= 'GET'
    @app.call(env)
  end
end

Rack::Handler::CGI.run Rack::PathInfoRewriter.new(RedmineApp::Application)

Proceed with install tutorial.

Use the 1&1 CGI monitor to debug.

Good look.

Markus

RE: Installing Redmine (1and1 Dual Perfect Webhosting package) - Added by Joachim R over 9 years ago

Hi Markus,
thank you for your tutorial, I was looking for that.

I did everything as you explained but I am getting the following error :

/kunden/homepages/XX/dYYYYYYYYY/htdocs/lib/ruby/gems/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/middleware/static.rb:106:in `call': undefined method `chomp' for nil:NilClass (NoMethodError)
        from /kunden/homepages/XX/dYYYYYYYYY/htdocs/lib/ruby/gems/2.2.0/gems/rack-1.6.0/lib/rack/sendfile.rb:113:in `call'
        from /kunden/homepages/XX/dYYYYYYYYY/htdocs/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/engine.rb:518:in `call'
        from /kunden/homepages/XX/dYYYYYYYYY/htdocs/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/application.rb:164:in `call'
        from /kunden/homepages/XX/dYYYYYYYYY/htdocs/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/railtie.rb:194:in `public_send'
        from /kunden/homepages/XX/dYYYYYYYYY/htdocs/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/railtie.rb:194:in `method_missing'
        from ./dispatch.fcgi:22:in `call'
        from /kunden/homepages/XX/dYYYYYYYYY/htdocs/lib/ruby/gems/2.2.0/gems/rack-1.6.0/lib/rack/handler/cgi.rb:33:in `serve'
        from /kunden/homepages/XX/dYYYYYYYYY/htdocs/lib/ruby/gems/2.2.0/gems/rack-1.6.0/lib/rack/handler/cgi.rb:9:in `run'
        from ./dispatch.fcgi:26:in `<main>'

Any idea what this could be ?
thanks
Joachim

RE: Installing Redmine (1and1 Dual Perfect Webhosting package) - Added by Markus Plutka over 9 years ago

Hi Joachim,

it seems that env['PATH_INFO'] is empty or not a string.

Maybe change dispatch.fcgi to this:

#!/kunden/homepages/XX/dYYYYYYYYY/htdocs/bin/ruby

ENV['GEM_PATH'] = '/kunden/homepages/XX/dYYYYYYYYY/htdocs/lib/ruby/gems/2.2.0'
ENV['GEM_HOME'] = '/kunden/homepages/XX/dYYYYYYYYY/htdocs/lib/ruby/gems/2.2.0'
ENV['RAILS_ENV'] ||= 'development'

require File.dirname(__FILE__) + '/../config/boot'
require File.dirname(__FILE__) + '/../config/environment'

class Rack::PathInfoRewriter
  def initialize(app)
    @app = app
  end

  def call(env)
    env.delete('SCRIPT_NAME')
    request_uri = env['REQUEST_URI'].to_s
    parts = request_uri.split('?')
    env['PATH_INFO'] = parts[0] || ''
    env['QUERY_STRING'] = parts[1].to_s || ''
    env['REQUEST_METHOD'] ||= 'GET'
    @app.call(env)
  end
end

Rack::Handler::CGI.run Rack::PathInfoRewriter.new(RedmineApp::Application)

This method seems to work for redmine < 2.5 only. Maybe it was a ressource problem in my case.
After all, it's not that fast.

Best regards,
Markus

RE: Installing Redmine (1and1 Dual Perfect Webhosting package) - Added by Joachim R over 9 years ago

Hi Markus,
thank you so much for your help.

I did not know for the version, so I went back an installed a version < 2.5. I also applied the change on dispatch.fcgi.

Testing from the command line or from the 1and1 interface (CGI test) are working.
But unfortunatly from a web browser, its not. I tweaked my .htaccess but I am still getting 500 error.

any idea of what this could be ?

Thanks again
best regards
Joachim

RE: Installing Redmine (1and1 Dual Perfect Webhosting package) - Added by I B over 8 years ago

Joachim R wrote:

Hi Markus,
thank you so much for your help.

I did not know for the version, so I went back an installed a version < 2.5. I also applied the change on dispatch.fcgi.

Testing from the command line or from the 1and1 interface (CGI test) are working.
But unfortunatly from a web browser, its not. I tweaked my .htaccess but I am still getting 500 error.

any idea of what this could be ?

Thanks again
best regards
Joachim

Sorry to resurrect an old thread, but have you been able to resolve this issue. Anyone else have any ideas?

FWIW I am working with Redmine 3.2.0. Everything works correctly when running the_dispatch.fcgi_ using CGI Output Monitor, but when navigating to the page (redmine/public/) I get a 500 error.

    (1-10/10)