# Apache + Mongrel via ProxyBalancer returning raw code only.

## Arkaniad

Hello, guys. I'm having a bit of problem.

Currently, my Apache2 setup runs Redmine (A Ruby on Rails application for project management, bug tracking etc) through mod_fastcgi. While it DOES work, It is quite slow and also not very easy to up-scale. The other night, I attempted to run my Redmine instance through three Mongrel clusters behind Apache (using mod_proxy_balancer.) While, the individual Mongrel clusters worked just fine, when they were accessed by Apache, it only returned raw HTML code of the actual page. Here is the configuration stub I am using for the particular virtualhost:

```

<VirtualHost *:80>

   ServerName redmine.myhost.foo

   RewriteEngine On

   

   RewriteBase /

   RewriteRule ^/$ /index.html [QSA]

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

   RewriteCond %{REQUEST_FILENAME} !-f

        RewriteRule ^/(.*)$ balancer://redmine%{REQUEST_URI} [P,QSA,L]   

   

   <Proxy balancer://redmine>

      BalancerMember http://127.0.0.1:8000

      BalancerMember http://127.0.0.1:8001

      BalancerMember http://127.0.0.1:8002

   </Proxy>

   ErrorLog /var/log/apache2/redmine_error_log

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

</VirtualHost>

```

I'm not fully sure why this is happening, since my Rails expirience is limited. If more information is required, I will provide.

----------

## gimpel

Does adding

```
ProxyPassReverse / balancer://redmine

ProxyPreserveHost on
```

help?

Also you are maybe missing a document root configuration. See http://www.redmine.org/projects/redmine/wiki/HowTo_run_Redmine_with_a_Mongrel_cluster

----------

## Arkaniad

Adding those lines do not work, it is still returning raw code.   :Confused: 

I can view it just fine when connecting directly to the Mongrel instance.

----------

