502 Proxy Error

Added by Daniel Bianchi over 9 years ago

I'm installed Redmine and follow these instructions http://www.redmine.org/wiki/redmine/HowTo_Install_Redmine_in_a_sub-URI_on_Windows_with_Apache

but when I put the address () appears in the browser this error: Proxy Error

The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request GET /redmine/.

Reason: Error reading from remote server

what am I doing wrong?


Replies (7)

RE: 502 Proxy Error - Added by Ivan Cenov over 9 years ago


Today, I received this error. Our sys admin had installed some service to watch the network traffic. After he stopped it, and Redmine appeared again. When I see him on Monday, I'll ask him for more information.


RE: 502 Proxy Error - Added by Daniel Bianchi over 9 years ago

Tanks Ivan.

RE: 502 Proxy Error - Added by Ivan Cenov over 9 years ago


Our sysadmin had installed Network Magic for a trial. After he had removed it, Redmine started to work again. May be some configuration issue...


RE: 502 Proxy Error - Added by Daniel Bianchi over 9 years ago

I believe I have these problems, since I'm using for the first time Ruby and Redmine.
Would it be better to use the Ruby / Redmine on a GNU / Linux?

Thank you very much.

RE: 502 Proxy Error - Added by Ivan Cenov over 9 years ago

I don't know about Linux installation. Ours is on Windows NT 2003.
We have
Ruby 1.8.7
Ruby On Rails 2.3.5
Redmine 1.0.4
mongrel 1.1.5
Apache 2.2.6 with mod_proxy, mod_proxy_http and mod_proxy_balancer

RE: 502 Proxy Error - Added by Daniel Bianchi over 9 years ago

missing some configuration of apache?

RE: 502 Proxy Error - Added by Ivan Cenov over 9 years ago

I am not Apache-insider but with lots of tries got Redmine working. The following is what I done (hope not omitted something essential):

Redmine is installed and proved to work when started as

ruby script/server -e production

We use Redmine as virtual host in Apache in the form http://redmine.mycompany.com
The virtual host configuration is (the file resides in e:\data\vhosts\ and Redmine resides in e:\data\redmine)

=============== Apache Virtual host =====================

NameVirtualHost *:80
<VirtualHost *:80>
    ServerName redmine.mycompany.com
    ServerAdmin admin@mycompany.com
    DocumentRoot e:/data/redmine/public
    DirectoryIndex index.html index.php

# httpd-proxy-mongrel.conf resides where virtual-hosts.conf resides.
    Include e:/data/vhosts/httpd-proxy-mongrel.conf

    ErrorLog e:/data/log/redmine.error.log
    TransferLog e:/data/log/redmine.transfer.log
    AddDefaultCharset WINDOWS-1251
    AddCharset WINDOWS-1251 .cp-1251 .win-1251

The contents of httpd-proxy-mongrel.conf is

# Redmine configuration behind Apache 2.2.x and mongrel

# Loading mod_proxy, mod_proxy_http and mod_proxy_balancer

<IfModule !mod_proxy.c>
    LoadModule proxy_module lib/modules/mod_proxy.so
<IfModule !mod_proxy_http.c>
    LoadModule proxy_http_module lib/modules/mod_proxy_http.so
<IfModule !mod_proxy_balancer.c>
    LoadModule proxy_balancer_module lib/modules/mod_proxy_balancer.so

<Directory E:/data/redmine/public/>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Order deny,allow
    Deny from all
    Allow from 192.168.22

<Proxy *>
    Order Deny,Allow
    Deny from all
    Allow from 192.168.22

ProxyPass / balancer://redmine_cluster/
ProxyPassReverse / balancer://redmine_cluster/

<Proxy balancer://redmine_cluster>
    BalancerMember http://redmine.mycompany.com:3001
    BalancerMember http://redmine.mycompany.com:3002
    BalancerMember http://redmine.mycompany.com:3003

This line (it is important, so as trailing "/" is important above past redmine_cluster)

Redmine::Utils::relative_url_root = "" 

should be put at the end of e:\data\redmine\config\environment.rb


# $Id: patch_for_mongrel.rb 168 2010-10-09 10:36:25Z imc $
# Fix for mongrel which still doesn't know about Rails 2.2's changes, 
# We provide a backwards compatible wrapper around the new
# ActionController::base.relative_url_root,
# so it can still be called off of the actually non-existing
# AbstractRequest class.

module ActionController
  class AbstractRequest < ActionController::Request
    def self.relative_url_root=(path)
    def self.relative_url_root
# Thanks to http://www.ruby-forum.com/topic/190287

should be put in e:\data\redmine\config\initializers\patch_for_mongrel.rb
(I don't know what it exactly does, but it surely does the right thing.)

============== Mongrel ==================

gem mongrel install

This will hopefully result in
    Successfully installed gem_plugin-0.2.3
    Successfully installed cgi_multipart_eof_fix-2.5.0
    Successfully installed mongrel-1.1.5-x86-mingw32

Download win32-service version 0.5.2 from http://rubyforge.org/frs/?group_id=1306
Download mongrel_service-0.3.4-i386-mswin32.gem from http://files.ruby.inoack.com/win32utils/
then execute following command from the folder where the downloaded files are

gem install mongrel_service

This will hopefully result in
    Successfully installed win32-service-0.5.2-x86-mswin32
    Successfully installed mongrel_service-0.3.4-x86-mswin32
    2 gems installed

At last install services
mongrel_rails service::install -N mongrel_redmine_3001 -D "Mongrel serving Redmine on 3001" -p 3001 -e production -c e:\data\Redmine
mongrel_rails service::install -N mongrel_redmine_3002 -D "Mongrel serving Redmine on 3002" -p 3002 -e production -c e:\data\Redmine
mongrel_rails service::install -N mongrel_redmine_3003 -D "Mongrel serving Redmine on 3003" -p 3003 -e production -c e:\data\Redmine

This works like a charm. I didn't understand why it stopped last week, may be some firewall, may something else... After removing Network Magic it restored functioning.